summaryrefslogtreecommitdiff
path: root/Test/AbsHoudini/f1.bpl
blob: b7ee9011adde540d1f76e9172954e25a5b72f5a6 (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
var g: int;

procedure {:entrypoint} main()
  modifies g;
{
   var x: int;
   var c: bool;

   g := 1;
  
   if(c) {
     g := g + 1;
   } else {
     g := 3;
   }

   call foo();

   if(old(g) == 0) { g := 1; }
}

procedure foo() 
  modifies g;
{
  g := g + 1;
}

procedure {:template} summaryTemplate();
  ensures {:post} g == old(g) + 1;
  ensures {:post} g == old(g) + 2;
  ensures {:post} g == old(g) + 3;
  ensures {:pre} old(g) == 0;