summaryrefslogtreecommitdiff
path: root/Test/civl/Program3.bpl
blob: f8c4e13221ac5866d1fcfe0afc51fe24231c525c (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
// RUN: %boogie -noinfer -typeEncoding:m -useArrayTheory "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
var {:layer 0,1} x:int;

procedure {:yields} {:layer 1} yield_x()
ensures {:layer 1} x >= old(x); 
{
    yield;
    assert {:layer 1} x >= old(x);
}

procedure {:yields} {:layer 1} p() 
requires {:layer 1} x >= 5; 
ensures {:layer 1} x >= 8; 
{ 
    call yield_x();
    call Incr(1); 
    call yield_x();
    call Incr(1); 
    call yield_x();
    call Incr(1); 
    call yield_x();
}

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

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