summaryrefslogtreecommitdiff
path: root/Test/lazyinline/foo.bpl
blob: bd45258ae9aaa017032e750b59114ff4311ca495 (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
var g: int;

procedure A()
requires g == 0;
modifies g;
ensures g == 2;
{
  var x : int;
  x := 4;
  while (g < x) {
    g := g + 1;
    x := x - 1;
  }
  assert x == 2;
}

procedure B(j: int) returns (x: int)
{
  var i: int;
  var y: int;

  y := 0;
  i := 0;
  x := j;
  while (i < 100) {
     x := x + 1 + y;
     i := i + 1;
  }
  assert y == 0;
}