-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest-ltl-2.ucl
52 lines (45 loc) · 1.08 KB
/
test-ltl-2.ucl
1
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
module main {
input a, b : integer;
input valid : boolean;
output sum : integer;
output ready : boolean;
var a_past, b_past : integer;
var ready_next : boolean;
var stepcnt : integer;
var inited : boolean;
init {
a_past = 0;
b_past = 0;
ready_next = false;
inited = false;
stepcnt = 0;
}
next {
sum = a_past + b_past;
ready = ready_next;
if (!inited) {
stepcnt = stepcnt + 1;
if (stepcnt > 1) {
inited = true;
}
}
assert (inited && history(valid, 1)) ==> (a_past == history(a, 1));
assert (inited && old(valid)) ==> (a_past == old(a));
assert (old(valid) == history(valid, 1));
if (valid) {
a_past = a;
b_past = b;
}
ready_next = valid;
}
property[LTL] sum_property : G(valid ==> X(ready));
// property ready_property : (inited && history(valid, 2)) ==> history(ready, 1);
control {
print_module;
// f = unroll (3);
// check;
print_results;
// f.print_cex(inited, a_past, a, valid /*, history(a_past, 1)*/);
// f->print_smt2;
}
}