summaryrefslogtreecommitdiff
path: root/Test/AbsHoudini/test10.bpl
blob: abb993f7ef1fb21e504cd3f990f0538e01ba270f (plain)
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
var sdv_7: int;
var sdv_21: int;
const {:existential true} b1: bool;
const{:existential true}  b2: bool;
const{:existential true}  b3: bool;
const{:existential true}  b4: bool;

procedure push(a:int)
modifies sdv_7, sdv_21;
{
   sdv_21 := sdv_7;
   sdv_7 := a;
}

procedure pop()
modifies sdv_7, sdv_21;
{
   sdv_7 := sdv_21;
   havoc sdv_21;
}

procedure foo()
modifies sdv_7, sdv_21;
requires {:candidate} b1 ==> (sdv_7 == 0);
ensures{:candidate}  b2 ==> (sdv_7 == old(sdv_7));
{
   call push(2);
   call pop();
   call bar();
}

procedure bar()
requires{:candidate} b3 ==> (sdv_7 == 0);
ensures{:candidate}  b4 ==> (sdv_7 == old(sdv_7));
modifies sdv_7, sdv_21;
{
   call push(1);
   call pop();
}

procedure main()
modifies sdv_7, sdv_21;
{
   sdv_7 := 0;
   call foo();
}