summaryrefslogtreecommitdiff
path: root/Test/og/Program1.bpl
blob: 56620da2d387c9988408faa15c704a53c1cfd976 (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
// RUN: %boogie -noinfer -typeEncoding:m -useArrayTheory "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
var {:phase 1} x:int;

procedure {:yields} {:phase 1} p() 
requires {:phase 1} x >= 5; 
ensures {:phase 1} x >= 8; 
{ 
    yield;
    assert {:phase 1} x >= 5; 
    call Incr(1); 
    yield;
    assert {:phase 1} x >= 6; 
    call Incr(1); 
    yield;
    assert {:phase 1} x >= 7;
    call Incr(1); 
}

procedure {:yields} {:phase 1} q() 
{ 
    call Incr(3); 
}

procedure {:yields} {:phase 0,1} Incr(val: int);
ensures {:atomic}
|{A:
  x := x + val; return true;
}|;