Skip to content

Commit af6de69

Browse files
author
Christoph sticksel
committed
Test files from Github issues
1 parent cc58f23 commit af6de69

File tree

4 files changed

+990
-0
lines changed

4 files changed

+990
-0
lines changed

tests/lustre/test-issue-116-1.lus

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
node main(
2+
a : bool;
3+
b : bool;
4+
c : bool;
5+
d : bool
6+
) returns (
7+
cost : int
8+
);
9+
var
10+
torch : bool;
11+
at_least_one_travelers : bool;
12+
no_more_than_two_travelers : bool;
13+
solved : bool;
14+
prop1 : bool;
15+
prop2 : bool;
16+
traveler__0__state : bool;
17+
traveler__0__torch : bool;
18+
traveler__0__ok : bool;
19+
traveler__1__state : bool;
20+
traveler__1__torch : bool;
21+
traveler__1__ok : bool;
22+
traveler__2__state : bool;
23+
traveler__2__torch : bool;
24+
traveler__2__ok : bool;
25+
traveler__3__state : bool;
26+
traveler__3__torch : bool;
27+
traveler__3__ok : bool;
28+
b2i__0__x : bool;
29+
b2i__0__y : int;
30+
b2i__1__x : bool;
31+
b2i__1__y : int;
32+
b2i__2__x : bool;
33+
b2i__2__y : int;
34+
b2i__3__x : bool;
35+
b2i__3__y : int;
36+
max__0__x : int;
37+
max__0__y : int;
38+
max__0__z : int;
39+
max__0__w : int;
40+
max__0__out : int;
41+
changed__0__x : bool;
42+
changed__0__c : bool;
43+
changed__1__x : bool;
44+
changed__1__c : bool;
45+
changed__2__x : bool;
46+
changed__2__c : bool;
47+
changed__3__x : bool;
48+
changed__3__c : bool;
49+
cost__0__state : bool;
50+
cost__0__value : int;
51+
cost__0__out : int;
52+
cost__1__state : bool;
53+
cost__1__value : int;
54+
cost__1__out : int;
55+
cost__2__state : bool;
56+
cost__2__value : int;
57+
cost__2__out : int;
58+
cost__3__state : bool;
59+
cost__3__value : int;
60+
cost__3__out : int;
61+
max__0__max2__0__x : int;
62+
max__0__max2__0__y : int;
63+
max__0__max2__0__out : int;
64+
max__0__max2__1__x : int;
65+
max__0__max2__1__y : int;
66+
max__0__max2__1__out : int;
67+
max__0__max2__2__x : int;
68+
max__0__max2__2__y : int;
69+
max__0__max2__2__out : int;
70+
let
71+
traveler__0__state = a;
72+
73+
traveler__0__torch = torch;
74+
75+
traveler__0__ok = ((traveler__0__state = false) -> ((traveler__0__state <> (pre traveler__0__state)) => ((pre traveler__0__state) = traveler__0__torch)));
76+
77+
traveler__1__state = b;
78+
79+
traveler__1__torch = torch;
80+
81+
traveler__1__ok = ((traveler__1__state = false) -> ((traveler__1__state <> (pre traveler__1__state)) => ((pre traveler__1__state) = traveler__1__torch)));
82+
83+
traveler__2__state = c;
84+
85+
traveler__2__torch = torch;
86+
87+
traveler__2__ok = ((traveler__2__state = false) -> ((traveler__2__state <> (pre traveler__2__state)) => ((pre traveler__2__state) = traveler__2__torch)));
88+
89+
traveler__3__state = d;
90+
91+
traveler__3__torch = torch;
92+
93+
traveler__3__ok = ((traveler__3__state = false) -> ((traveler__3__state <> (pre traveler__3__state)) => ((pre traveler__3__state) = traveler__3__torch)));
94+
95+
torch = (true -> (not (pre torch)));
96+
97+
at_least_one_travelers = (true -> ((((a <> (pre a)) or (b <> (pre b))) or (c <> (pre c))) or (d <> (pre d))));
98+
99+
no_more_than_two_travelers = ((((b2i__0__y + b2i__1__y) + b2i__2__y) + b2i__3__y) <= 2);
100+
101+
cost = (0 -> ((pre cost) + max__0__out));
102+
103+
solved = (((a and b) and c) and d);
104+
105+
prop1 = (not (solved and (cost < 15)));
106+
107+
prop2 = (not (solved and (cost = 15)));
108+
109+
b2i__0__x = changed__0__c;
110+
111+
b2i__0__y = (if b2i__0__x then 1 else 0);
112+
113+
b2i__1__x = changed__1__c;
114+
115+
b2i__1__y = (if b2i__1__x then 1 else 0);
116+
117+
b2i__2__x = changed__2__c;
118+
119+
b2i__2__y = (if b2i__2__x then 1 else 0);
120+
121+
b2i__3__x = changed__3__c;
122+
123+
b2i__3__y = (if b2i__3__x then 1 else 0);
124+
125+
max__0__x = cost__0__out;
126+
127+
max__0__y = cost__1__out;
128+
129+
max__0__z = cost__2__out;
130+
131+
max__0__w = cost__3__out;
132+
133+
max__0__out = max__0__max2__0__out;
134+
135+
changed__0__x = a;
136+
137+
changed__0__c = (false -> (changed__0__x <> (pre changed__0__x)));
138+
139+
changed__1__x = b;
140+
141+
changed__1__c = (false -> (changed__1__x <> (pre changed__1__x)));
142+
143+
changed__2__x = c;
144+
145+
changed__2__c = (false -> (changed__2__x <> (pre changed__2__x)));
146+
147+
changed__3__x = d;
148+
149+
changed__3__c = (false -> (changed__3__x <> (pre changed__3__x)));
150+
151+
cost__0__state = a;
152+
153+
cost__0__value = 1;
154+
155+
cost__0__out = (0 -> (if (cost__0__state <> (pre cost__0__state)) then cost__0__value else 0));
156+
157+
cost__1__state = b;
158+
159+
cost__1__value = 2;
160+
161+
cost__1__out = (0 -> (if (cost__1__state <> (pre cost__1__state)) then cost__1__value else 0));
162+
163+
cost__2__state = c;
164+
165+
cost__2__value = 5;
166+
167+
cost__2__out = (0 -> (if (cost__2__state <> (pre cost__2__state)) then cost__2__value else 0));
168+
169+
cost__3__state = d;
170+
171+
cost__3__value = 8;
172+
173+
cost__3__out = (0 -> (if (cost__3__state <> (pre cost__3__state)) then cost__3__value else 0));
174+
175+
max__0__max2__0__x = max__0__x;
176+
177+
max__0__max2__0__y = max__0__max2__1__out;
178+
179+
max__0__max2__0__out = (if (max__0__max2__0__x >= max__0__max2__0__y) then max__0__max2__0__x else max__0__max2__0__y);
180+
181+
max__0__max2__1__x = max__0__y;
182+
183+
max__0__max2__1__y = max__0__max2__2__out;
184+
185+
max__0__max2__1__out = (if (max__0__max2__1__x >= max__0__max2__1__y) then max__0__max2__1__x else max__0__max2__1__y);
186+
187+
max__0__max2__2__x = max__0__z;
188+
189+
max__0__max2__2__y = max__0__w;
190+
191+
max__0__max2__2__out = (if (max__0__max2__2__x >= max__0__max2__2__y) then max__0__max2__2__x else max__0__max2__2__y);
192+
193+
assert traveler__0__ok;
194+
195+
assert traveler__1__ok;
196+
197+
assert traveler__2__ok;
198+
199+
assert traveler__3__ok;
200+
201+
assert at_least_one_travelers;
202+
203+
assert no_more_than_two_travelers;
204+
205+
--%PROPERTY prop1;
206+
--%PROPERTY prop2;
207+
208+
tel;

tests/lustre/test-issue-116-2.lus

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node integ(x : int) returns (sum : int);
2+
let
3+
sum = x + (0 -> pre sum);
4+
tel;
5+
6+
node main(x : int; y : int; r : real) returns (z : int);
7+
var
8+
history : bool;
9+
prop1 : bool;
10+
prop2 : bool;
11+
let
12+
z = integ(x);
13+
14+
history = x > 0 and (true -> pre history);
15+
prop1 = history => z > 0;
16+
17+
--%PROPERTY prop1;
18+
19+
prop2 = integ(x) + integ(y) = integ(x + y) -> pre(integ(x) + integ(y) = integ(x + y) -> not(0.0 < r and r < 1.0));
20+
--%PROPERTY prop2;
21+
tel;

0 commit comments

Comments
 (0)