Newer
Older
Erwan Jahier
committed
Non-regression tests
Erwan Jahier
committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
usage: lus2lic [options] <lustre files> | lus2lic -help
--version Print the current version then exit
--output-file <file>
-o <file> Set the output file name
--node <node>
-n <node> Set the main node (all items are compiled if unset)
--compile-all-items
-all Compile all items of the program
-unit Run some (internal) unit tests
--verbose
-v Set verbose mode on (i.e., verbose level = 1)
--verbose-level <int>
-vl <int> Set verbose level
--keep-nested-calls Keep nested calls
-h
-help
--help Display this list of options
Opening file should_work/NONREG/ex.lus
type _ex::t = A_A_A_int_1_2_3^4;
type _ex::t1 = A_A_A_A_int_1_2_3_4^4;
type _ex::t2 = struct {a : int; b : A_A_bool_11_22};
type _ex::s1 = struct {x : int; y : A_A_A_A_int_1_2_3_4};
type _ex::s = struct {x : A_A_A_A_int_1_2_3_4; y : _ex::s1};
node ex::ex(a:_ex::s) returns (b:int);
var
_v1:A_A_A_A_int_1_2_3_4;
_v2:A_A_A_int_1_2_3;
_v3:A_A_int_1_2;
_v4:A_int_1;
_v5:int;
_v6:_ex::s1;
_v7:A_A_A_A_int_1_2_3_4;
_v8:A_A_A_int_1_2_3;
_v9:A_A_int_1_2;
_v10:A_int_1;
_v11:int;
let
b = _v5 + _v11;
_v1 = a.x;
_v2 = _v1[0];
_v3 = _v2[0];
_v4 = _v3[0];
_v5 = _v4[0];
_v6 = a.y;
_v7 = _v6.y;
_v8 = _v7[0];
_v9 = _v8[0];
_v10 = _v9[0];
_v11 = _v10[0];
tel
-- end of node ex::ex
-- automatically defined aliases:
type A_A_A_A_int_1_2_3_4 = A_A_A_int_1_2_3^4;
type A_A_bool_11_22 = A_bool_11^22;
type A_bool_11 = bool^11;
type A_A_A_int_1_2_3 = A_A_int_1_2^3;
type A_A_int_1_2 = A_int_1^2;
type A_int_1 = int^1;
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/CURRENT.lus
Opening file should_work/NONREG/CURRENT.lus
node CURRENT::CURRENT(x:bool; y:bool when x) returns (z:bool when x);
-- end of node CURRENT::CURRENT
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/Int.lus
Opening file should_work/NONREG/Int.lus
const Int8::n = 8;
type _Int8::Int = bool^8;
const Int8::zero = [false, false, false, false, false, false, false, false];
function Int8::fulladd(
ci:bool;
x:bool;
y:bool)
returns (
s:bool;
co:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
_v4:bool;
_v5:bool;
let
s = ci xor _v1;
_v1 = x xor y;
co = _v4 or _v5;
_v2 = ci and x;
_v3 = x and y;
_v4 = _v2 or _v3;
_v5 = y and ci;
-- end of node Int8::fulladd
function Int8::incr(x:A_bool_8) returns (incr:A_bool_8);
(co, incr) = fillred<<Int8::fulladd, 8>>(true, x, Int8::zero);
tel
-- end of node Int8::incr
function Int8::add(x:A_bool_8; y:A_bool_8) returns (sum:A_bool_8);
(co, sum) = fillred<<Int8::fulladd, 8>>(false, x, y);
tel
-- end of node Int8::add
node mainPack::Nat(evt:bool; reset:bool) returns (nat:_Int8::Int);
var
_v1:bool;
_v2:_Int8::Int;
_v3:_Int8::Int;
_v4:_Int8::Int;
_v5:_Int8::Int;
nat = if _v1 then Int8::zero else _v5;
_v1 = true -> reset;
_v2 = pre nat;
_v3 = Int8::incr(_v2);
_v4 = pre nat;
_v5 = if evt then _v3 else _v4;
tel
-- end of node mainPack::Nat
-- automatically defined aliases:
type A_bool_8 = bool^8;
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/PCOND.lus
Opening file should_work/NONREG/PCOND.lus
node PCOND::PCOND(
hA:bool when h0;
hB:bool when h0;
hC:bool when h0;
A:int when hA;
B:int when hB;
C:bool when hC;
hD:bool when hC;
D:bool when hD)
returns (
hX:bool when h0;
var
_v1:bool when h0;
_v2:bool when h0;
_v3:bool when hC;
_v4:bool when h0;
_v5:bool when h0;
_v6:bool when hC;
_v7:bool when h0;
_v8:bool when h0;
_v9:bool when h0;
_v10:bool when h0;
_v11:bool when hC;
_v12:bool when h0;
_v13:bool when h0;
_v14:int when h0;
_v15:int when h0;
_v16:int when h0;
hX = _v2 and _v10;
_v1 = current hD;
_v2 = hC and _v1;
_v3 = current D;
_v4 = current _v3;
_v5 = hA and _v4;
_v6 = current D;
_v7 = current _v6;
_v8 = not _v7;
_v9 = hB and _v8;
_v10 = _v5 or _v9;
X = _v16 when True(hX);
_v11 = current D;
_v12 = current _v11;
_v13 = hA and _v12;
_v14 = current A;
_v15 = current B;
_v16 = if _v13 then _v14 else _v15;
-- end of node PCOND::PCOND
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/PCOND1.lus
Opening file should_work/NONREG/PCOND1.lus
node PCOND1::PCOND1(
hA:bool when h0;
hB:bool when h0;
hC:bool when h0;
A:int when hA;
B:int when hB;
C:bool when hC;
hD:bool when hC;
D:bool when hD)
hX:bool when h0);
var
_v1:bool when h0;
_v2:bool when h0;
_v3:bool when h0;
hX = _v2 and _v3;
_v1 = current hD;
_v2 = hC and _v1;
_v3 = h0 when True(h0);
-- end of node PCOND1::PCOND1
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/SOURIS.lus
Opening file should_work/NONREG/SOURIS.lus
node SOURIS::SOURIS(
B1:bool;
B2:bool;
B3:bool;
TOP:bool)
returns (
SIMPLE:bool;
DOUBLE:bool;
TRIPLE:bool;
BOUTON:int);
var
count:int;
prev:int;
date:int;
SIMPLE_2:bool;
clic:bool;
chgt:bool;
fin_tps:bool;
fin_tps2:bool;
etat0:bool;
etat1:bool;
etat2:bool;
etat3:bool;
_v1:bool;
_v2:bool;
_v3:bool;
_v4:int;
_v5:int;
_v6:bool;
_v7:bool;
_v8:bool;
_v9:bool;
_v10:bool;
_v11:bool;
_v12:bool;
_v13:bool;
_v14:bool;
_v15:bool;
_v16:bool;
_v17:bool;
_v18:bool;
_v19:bool;
_v20:bool;
_v21:bool;
_v22:bool;
_v23:bool;
_v24:bool;
_v25:bool;
_v26:bool;
_v27:bool;
_v28:bool;
_v29:bool;
_v30:bool;
_v31:bool;
_v32:bool;
_v33:int;
_v34:int;
_v35:int;
_v36:int;
_v37:int;
_v38:bool;
_v39:int;
_v40:bool;
_v41:bool;
_v42:int;
_v43:bool;
_v44:int;
_v45:bool;
_v46:bool;
_v47:bool;
_v48:bool;
_v49:bool;
_v50:bool;
_v51:bool;
_v52:bool;
_v53:bool;
_v54:bool;
_v55:bool;
_v56:bool;
_v57:bool;
_v58:int;
_v59:bool;
_v60:bool;
_v61:bool;
_v62:bool;
_v63:int;
_v64:int;
_v65:int;
_v66:int;
_v67:int;
_v68:int;
_v69:int;
_v70:int;
_v71:int;
_v72:int;
_v73:int;
_v74:int;
_v75:int;
_v76:int;
_v77:bool;
_v78:bool;
_v79:bool;
_v80:bool;
_v81:bool;
_v82:bool;
_v83:bool;
_v84:bool;
_v85:bool;
_v86:bool;
_v87:bool;
_v88:bool;
_v89:bool;
_v90:bool;
_v91:bool;
_v92:bool;
_v93:bool;
_v94:bool;
_v95:bool;
_v96:bool;
_v97:bool;
_v98:bool;
_v99:bool;
_v100:bool;
_v101:bool;
_v102:bool;
_v103:bool;
_v104:bool;
_v105:bool;
_v106:bool;
_v107:bool;
_v108:bool;
_v109:bool;
_v110:bool;
_v111:bool;
_v112:bool;
_v113:bool;
_v114:bool;
_v115:bool;
_v116:bool;
_v117:bool;
_v118:bool;
_v119:bool;
_v120:bool;
_v121:bool;
_v122:bool;
_v123:bool;
_v124:bool;
_v125:bool;
_v126:bool;
_v127:bool;
_v128:bool;
_v129:bool;
_v130:bool;
_v131:bool;
_v132:bool;
_v133:bool;
_v134:bool;
_v135:bool;
_v136:bool;
_v137:bool;
_v138:bool;
_v139:bool;
_v140:bool;
_v141:bool;
_v142:bool;
_v143:bool;
_v144:bool;
_v145:bool;
_v146:bool;
_v147:bool;
_v148:bool;
_v149:bool;
_v150:int;
_v151:int;
_v152:int;
_v153:bool;
_v154:bool;
_v155:bool;
_v156:bool;
_v157:bool;
_v158:bool;
_v159:bool;
_v160:bool;
_v161:bool;
_v162:bool;
_v163:bool;
_v164:bool;
_v165:bool;
_v166:bool;
_v167:bool;
_v168:bool;
_v169:bool;
_v170:bool;
_v171:bool;
_v172:bool;
_v173:bool;
_v174:bool;
_v175:bool;
_v176:bool;
_v177:bool;
_v178:bool;
_v179:bool;
_v180:bool;
_v181:bool;
_v182:bool;
_v183:bool;
_v184:bool;
_v185:bool;
_v186:bool;
_v187:bool;
_v188:bool;
_v189:bool;
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
date = 0 -> _v5;
_v1 = etat2 or etat3;
_v2 = pre etat1;
_v3 = _v1 and _v2;
_v4 = pre date;
_v5 = if _v3 then count else _v4;
chgt = false -> _v24;
_v6 = not clic;
_v7 = prev = 3;
_v8 = B3 and _v7;
_v9 = prev = 1;
_v10 = B1 and _v9;
_v11 = _v8 or _v10;
_v12 = prev = 2;
_v13 = B2 and _v12;
_v14 = _v11 or _v13;
_v15 = prev = 0;
_v16 = _v14 or _v15;
_v17 = not B1;
_v18 = not B2;
_v19 = _v17 and _v18;
_v20 = not B3;
_v21 = _v19 and _v20;
_v22 = _v16 or _v21;
_v23 = if _v22 then false else true;
_v24 = if _v6 then false else _v23;
clic = _v26 and _v29;
_v25 = B1 xor B2;
_v26 = _v25 xor B3;
_v27 = B1 and B2;
_v28 = _v27 and B3;
_v29 = not _v28;
prev = 0 -> _v36;
_v30 = pre B1;
_v31 = pre B2;
_v32 = pre B3;
_v33 = pre prev;
_v34 = if _v32 then 3 else _v33;
_v35 = if _v31 then 2 else _v34;
_v36 = if _v30 then 1 else _v35;
fin_tps = false -> _v41;
_v37 = pre count;
_v38 = _v37 > 6;
_v39 = pre count;
_v40 = _v39 > 7;
_v41 = if TOP then _v38 else _v40;
fin_tps2 = false -> _v46;
_v42 = pre count;
_v43 = _v42 > 4;
_v44 = pre count;
_v45 = _v44 > 5;
_v46 = if TOP then _v43 else _v45;
count = 0 -> _v76;
_v47 = pre etat0;
_v48 = pre etat1;
_v49 = _v48 and chgt;
_v50 = _v47 or _v49;
_v51 = pre etat2;
_v52 = _v51 and chgt;
_v53 = _v50 or _v52;
_v54 = pre etat3;
_v55 = _v54 and chgt;
_v56 = _v53 or _v55;
_v57 = etat1 and _v56;
_v58 = if TOP then 1 else 0;
_v59 = pre etat2;
_v60 = pre etat3;
_v61 = _v59 or _v60;
_v62 = etat1 and _v61;
_v63 = pre count;
_v64 = pre date;
_v65 = _v63 - _v64;
_v66 = _v65 + 1;
_v67 = pre count;
_v68 = pre date;
_v69 = _v67 - _v68;
_v70 = if TOP then _v66 else _v69;
_v71 = pre count;
_v72 = _v71 + 1;
_v73 = pre count;
_v74 = if TOP then _v72 else _v73;
_v75 = if _v62 then _v70 else _v74;
_v76 = if _v57 then _v58 else _v75;
etat0 = true -> _v98;
_v77 = pre etat1;
_v78 = _v77 and fin_tps;
_v79 = not clic;
_v80 = _v78 and _v79;
_v81 = pre etat2;
_v82 = _v81 and clic;
_v83 = not chgt;
_v84 = _v82 and _v83;
_v85 = _v80 or _v84;
_v86 = pre etat2;
_v87 = _v86 and fin_tps;
_v88 = _v85 or _v87;
_v89 = pre etat3;
_v90 = _v89 and clic;
_v91 = not chgt;
_v92 = _v90 and _v91;
_v93 = _v88 or _v92;
_v94 = pre etat0;
_v95 = not clic;
_v96 = _v94 and _v95;
_v97 = _v93 or _v96;
_v98 = if _v97 then true else false;
etat1 = false -> _v117;
_v99 = pre etat0;
_v100 = _v99 and clic;
_v101 = pre etat2;
_v102 = _v101 and chgt;
_v103 = _v100 or _v102;
_v104 = pre etat3;
_v105 = chgt or fin_tps;
_v106 = _v104 and _v105;
_v107 = _v103 or _v106;
_v108 = pre etat1;
_v109 = not clic;
_v110 = _v108 and _v109;
_v111 = not fin_tps;
_v112 = _v110 and _v111;
_v113 = _v107 or _v112;
_v114 = pre etat1;
_v115 = _v114 and chgt;
_v116 = _v113 or _v115;
_v117 = if _v116 then true else false;
etat2 = false -> _v130;
_v118 = pre etat1;
_v119 = _v118 and clic;
_v120 = not fin_tps2;
_v121 = _v119 and _v120;
_v122 = not chgt;
_v123 = _v121 and _v122;
_v124 = pre etat2;
_v125 = not clic;
_v126 = _v124 and _v125;
_v127 = not fin_tps;
_v128 = _v126 and _v127;
_v129 = _v123 or _v128;
_v130 = if _v129 then true else false;
etat3 = false -> _v142;
_v131 = pre etat1;
_v132 = _v131 and clic;
_v133 = _v132 and fin_tps2;
_v134 = not chgt;
_v135 = _v133 and _v134;
_v136 = pre etat3;
_v137 = not clic;
_v138 = _v136 and _v137;
_v139 = not fin_tps;
_v140 = _v138 and _v139;
_v141 = _v135 or _v140;
_v142 = if _v141 then true else false;
BOUTON = 0 -> _v152;
_v143 = pre SIMPLE_2;
_v144 = not _v143;
_v145 = SIMPLE and _v144;
_v146 = _v145 or DOUBLE;
_v147 = _v146 or TRIPLE;
_v148 = pre SIMPLE_2;
_v149 = SIMPLE and _v148;
_v150 = pre prev;
_v151 = if _v149 then _v150 else 0;
_v152 = if _v147 then prev else _v151;
SIMPLE = false -> _v167;
_v153 = pre etat1;
_v154 = _v153 and etat0;
_v155 = pre etat1;
_v156 = _v155 and chgt;
_v157 = _v154 or _v156;
_v158 = pre etat3;
_v159 = _v158 and etat1;
_v160 = _v159 and fin_tps;
_v161 = _v157 or _v160;
_v162 = pre etat3;
_v163 = _v162 and etat1;
_v164 = _v163 and chgt;
_v165 = _v161 or _v164;
_v166 = pre SIMPLE_2;
_v167 = _v165 or _v166;
SIMPLE_2 = false -> _v175;
_v168 = pre etat3;
_v169 = _v168 and etat1;
_v170 = _v169 and chgt;
_v171 = pre etat1;
_v172 = pre SIMPLE_2;
_v173 = _v171 and _v172;
_v174 = _v173 and chgt;
_v175 = _v170 or _v174;
DOUBLE = false -> _v180;
_v176 = pre etat2;
_v177 = _v176 and chgt;
_v178 = pre etat2;
_v179 = _v178 and fin_tps;
_v180 = _v177 or _v179;
TRIPLE = false -> _v189;
_v181 = pre etat3;
_v182 = _v181 and etat0;
_v183 = pre etat2;
_v184 = not fin_tps;
_v185 = _v183 and _v184;
_v186 = not chgt;
_v187 = _v185 and _v186;
_v188 = _v187 and etat0;
_v189 = _v182 or _v188;
-- end of node SOURIS::SOURIS
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/Watch.lus
Opening file should_work/NONREG/Watch.lus
type _Watch::STATUS_TYPE;
type _Watch::ALARM_TIME_TYPE;
type _Watch::WATCH_TIME_POSITION;
type _Watch::ALARM_TIME_POSITION;
type _Watch::DISPLAY_TYPE;
type _Watch::WATCH_TIME_TYPE;
type _Watch::STOPWATCH_TIME_TYPE;
type _Watch::MAIN_DISPLAY_TYPE;
type _Watch::LABELS_TYPE;
type _Watch::DISPLAY_POSITION;
type _Watch::MINI_DISPLAY_TYPE;
type _Watch::string;
const Watch::INITIAL_WATCH_POSITION:_Watch::WATCH_TIME_POSITION;
const Watch::INITIAL_WATCH_TIME:_Watch::WATCH_TIME_TYPE;
const Watch::ALARM_DURATION:int;
const Watch::stringST:_Watch::string;
const Watch::stringAL:_Watch::string;
const Watch::INITIAL_ALARM_TIME:_Watch::ALARM_TIME_TYPE;
const Watch::INITIAL_ALARM_POSITION:_Watch::ALARM_TIME_POSITION;
const Watch::NULL_POSITION:_Watch::DISPLAY_POSITION;
const Watch::INITIAL_STOPWATCH_TIME:_Watch::STOPWATCH_TIME_TYPE;
extern function Watch::ALARM_TO_DISPLAY_POS(
apos:_Watch::ALARM_TIME_POSITION)
returns (
dpos:_Watch::DISPLAY_POSITION);
extern function Watch::INCREMENT_STOPWATCH_TIME(
time:_Watch::STOPWATCH_TIME_TYPE)
returns (
newtime:_Watch::STOPWATCH_TIME_TYPE);
node Watch::TWO_STATES(
init:bool;
set:bool;
reset:bool)
returns (
state:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
_v4:bool;
_v5:bool;
_v6:bool;
_v7:bool;
_v8:bool;
state = init -> _v8;
_v1 = pre state;
_v2 = not _v1;
_v3 = set and _v2;
_v4 = pre state;
_v5 = reset and _v4;
_v6 = pre state;
_v7 = if _v5 then false else _v6;
_v8 = if _v3 then true else _v7;
-- end of node Watch::TWO_STATES
node Watch::DIVIDE(scale:int) returns (quotient:bool);
var
n:int;
_v1:int;
_v2:int;
_v3:bool;
_v4:int;
_v5:int;
_v6:int;
_v7:bool;
let
n = 0 -> _v6;
quotient = true -> _v7;
_v1 = pre n;
_v2 = _v1 + 1;
_v3 = _v2 = scale;
_v4 = pre n;
_v5 = _v4 + 1;
_v6 = if _v3 then 0 else _v5;
_v7 = if _v3 then true else false;
-- end of node Watch::DIVIDE
extern function Watch::MAKE_DISPLAY(
main:_Watch::MAIN_DISPLAY_TYPE;
mini:_Watch::MINI_DISPLAY_TYPE;
alpha:_Watch::string;
status:_Watch::STATUS_TYPE;
enhanced:_Watch::DISPLAY_POSITION;
labels:_Watch::LABELS_TYPE)
display:_Watch::DISPLAY_TYPE);
extern function Watch::WATCH_TIME_TO_MAIN_DISPLAY(
time:_Watch::WATCH_TIME_TYPE)
display:_Watch::MAIN_DISPLAY_TYPE);
extern function Watch::WATCH_DATE_TO_MINI_DISPLAY(
time:_Watch::WATCH_TIME_TYPE)
display:_Watch::MINI_DISPLAY_TYPE);
extern function Watch::WATCH_DAY_TO_ALPHA_DISPLAY(
time:_Watch::WATCH_TIME_TYPE)
display:_Watch::string);
extern function Watch::STOPWATCH_TIME_TO_MAIN_DISPLAY(
time:_Watch::STOPWATCH_TIME_TYPE)
display:_Watch::MAIN_DISPLAY_TYPE);
extern function Watch::WATCH_TIME_TO_MINI_DISPLAY(
time:_Watch::WATCH_TIME_TYPE)
display:_Watch::MINI_DISPLAY_TYPE);
extern function Watch::ALARM_TIME_TO_MAIN_DISPLAY(
time:_Watch::ALARM_TIME_TYPE)
display:_Watch::MAIN_DISPLAY_TYPE);
node Watch::DISPLAY(
mode_is_watch:bool;
mode_is_stopwatch:bool;
mode_is_alarm:bool;
watch_time:_Watch::WATCH_TIME_TYPE;
stopwatch_time:_Watch::STOPWATCH_TIME_TYPE;
alarm_time:_Watch::ALARM_TIME_TYPE;
position_enhanced:_Watch::DISPLAY_POSITION;
status:_Watch::STATUS_TYPE;
labels:_Watch::LABELS_TYPE)
display:_Watch::DISPLAY_TYPE);
main_display:_Watch::MAIN_DISPLAY_TYPE;
mini_display:_Watch::MINI_DISPLAY_TYPE;
alpha_display:_Watch::string;
_v1:_Watch::MAIN_DISPLAY_TYPE;
_v2:_Watch::MINI_DISPLAY_TYPE;
_v3:_Watch::string;
_v4:_Watch::MAIN_DISPLAY_TYPE;
_v5:_Watch::MINI_DISPLAY_TYPE;
_v6:_Watch::MAIN_DISPLAY_TYPE;
_v7:_Watch::MINI_DISPLAY_TYPE;
_v8:_Watch::MAIN_DISPLAY_TYPE;
_v9:_Watch::MINI_DISPLAY_TYPE;
_v10:_Watch::string;
display = Watch::MAKE_DISPLAY(main_display, mini_display, alpha_display,
status, position_enhanced, labels);
main_display = if mode_is_watch then _v1 else _v8;
mini_display = if mode_is_watch then _v2 else _v9;
alpha_display = if mode_is_watch then _v3 else _v10;
_v1 = Watch::WATCH_TIME_TO_MAIN_DISPLAY(watch_time);
_v2 = Watch::WATCH_DATE_TO_MINI_DISPLAY(watch_time);
_v3 = Watch::WATCH_DAY_TO_ALPHA_DISPLAY(watch_time);
_v4 = Watch::STOPWATCH_TIME_TO_MAIN_DISPLAY(stopwatch_time);
_v5 = Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time);
_v6 = Watch::ALARM_TIME_TO_MAIN_DISPLAY(alarm_time);
_v7 = Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time);
_v8 = if mode_is_stopwatch then _v4 else _v6;
_v9 = if mode_is_stopwatch then _v5 else _v7;
_v10 = if mode_is_stopwatch then Watch::stringST else Watch::stringAL;
-- end of node Watch::DISPLAY
extern function Watch::SOMME(i1:int; i2:int; i3:int) returns (somme:int);
extern function Watch::COMPARE_WATCH_ALARM_TIME(
watch_time:_Watch::WATCH_TIME_TYPE;
alarm_time:_Watch::ALARM_TIME_TYPE)
node Watch::EDGE(b:bool) returns (edge:bool);
var
_v1:bool;
_v2:bool;
_v3:bool;
edge = b -> _v3;
_v1 = pre b;
_v2 = not _v1;
_v3 = b and _v2;
-- end of node Watch::EDGE
extern function Watch::TOGGLE_24H_IN_ALARM_MODE(
time:_Watch::ALARM_TIME_TYPE)
newtime:_Watch::ALARM_TIME_TYPE);
extern function Watch::SET_ALARM_TIME(
time:_Watch::ALARM_TIME_TYPE;
position:_Watch::ALARM_TIME_POSITION)
new_time:_Watch::ALARM_TIME_TYPE);
extern function Watch::NEXT_ALARM_TIME_POSITION(
position:_Watch::ALARM_TIME_POSITION)
new_position:_Watch::ALARM_TIME_POSITION);
node Watch::ALARM(
toggle_24h:bool;
toggle_alarm:bool;
in_set:bool;
set:bool;
next_position:bool;
stop_beep:bool;
second:bool;
watch_time:_Watch::WATCH_TIME_TYPE)
time:_Watch::ALARM_TIME_TYPE;
enhance:_Watch::ALARM_TIME_POSITION;
position_set:_Watch::ALARM_TIME_POSITION;
start_beeping:bool;
time_out:bool;
count:int;
internal_status:int;
_v1:bool;
_v2:int;
_v3:bool;
_v4:int;
_v5:bool;
_v6:bool;
_v7:int;
_v8:bool;
_v9:bool;
_v10:int;
_v11:int;
_v12:int;
_v13:int;
_v14:bool;
_v15:bool;
_v16:int;
_v17:int;
_v18:int;
_v19:int;
_v20:int;
_v21:int;
_v22:int;
_v23:bool;
_v24:bool;
_v25:bool;
_v26:bool;
_v27:bool;
_v28:bool;
_v29:_Watch::ALARM_TIME_TYPE;
_v30:_Watch::ALARM_TIME_TYPE;
_v31:_Watch::ALARM_TIME_TYPE;
_v32:_Watch::ALARM_TIME_TYPE;
_v33:_Watch::ALARM_TIME_TYPE;
_v34:_Watch::ALARM_TIME_TYPE;
_v35:_Watch::ALARM_TIME_TYPE;
_v36:bool;
_v37:bool;
_v38:_Watch::ALARM_TIME_POSITION;
_v39:_Watch::ALARM_TIME_POSITION;
_v40:_Watch::ALARM_TIME_POSITION;
_v41:_Watch::ALARM_TIME_POSITION;
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
start_beeping = _v1 and status;
_v1 = Watch::COMPARE_WATCH_ALARM_TIME(watch_time, time);
status = internal_status = 1;
internal_status = 0 -> _v12;
_v2 = pre internal_status;
_v3 = _v2 = 0;
_v4 = if _v3 then 1 else 0;
_v5 = not in_set;
_v6 = Watch::EDGE(_v5);
_v7 = pre internal_status;
_v8 = _v7 = 0;
_v9 = _v6 and _v8;
_v10 = pre internal_status;
_v11 = if _v9 then 1 else _v10;
_v12 = if toggle_alarm then _v4 else _v11;
count = 0 -> _v21;
_v13 = pre count;
_v14 = _v13 <> 0;
_v15 = _v14 and second;
_v16 = pre count;
_v17 = _v16 - 1;
_v18 = pre count;
_v19 = 0 -> _v18;
_v20 = if _v15 then _v17 else _v19;
_v21 = if start_beeping then Watch::ALARM_DURATION else _v20;
time_out = false -> _v25;
_v22 = pre count;
_v23 = _v22 <> 0;
_v24 = count = 0;
_v25 = _v23 and _v24;
beep = if _v28 then 4 else 0;
_v26 = stop_beep or time_out;
_v27 = Watch::TWO_STATES(false, start_beeping, _v26);
_v28 = _v27 and second;
time = Watch::INITIAL_ALARM_TIME -> _v35;
_v29 = pre time;
_v30 = Watch::TOGGLE_24H_IN_ALARM_MODE(_v29);
_v31 = pre time;
_v32 = Watch::SET_ALARM_TIME(_v31, position_set);
_v33 = pre time;
_v34 = if set then _v32 else _v33;
_v35 = if toggle_24h then _v30 else _v34;
position_set = if _v37 then Watch::INITIAL_ALARM_POSITION else _v41;
_v36 = Watch::EDGE(in_set);
_v37 = true -> _v36;
_v38 = pre position_set;
_v39 = Watch::NEXT_ALARM_TIME_POSITION(_v38);
_v40 = pre position_set;
_v41 = if next_position then _v39 else _v40;
-- end of node Watch::ALARM
extern function Watch::LABELS(
mode_is_watch:bool;
mode_is_stopwatch:bool;
mode_is_alarm:bool;
mode_is_set_watch:bool;
mode_is_set_alarm:bool)
returns (
labels:_Watch::LABELS_TYPE);
extern function Watch::WATCH_TO_DISPLAY_POS(
wpos:_Watch::WATCH_TIME_POSITION)
dpos:_Watch::DISPLAY_POSITION);
extern function Watch::STATUS(
alarm_is_set:bool;
chime_is_set:bool;
stopwatch_running:bool;
stopwatch_lapping:bool)
returns (
status:_Watch::STATUS_TYPE);
extern function Watch::IS_O_CLOCK(
time:_Watch::WATCH_TIME_TYPE)
extern function Watch::INCREMENT_WATCH_TIME(
time:_Watch::WATCH_TIME_TYPE)
newtime:_Watch::WATCH_TIME_TYPE);
extern function Watch::TOGGLE_24H_IN_WATCH_MODE(
time:_Watch::WATCH_TIME_TYPE)