summaryrefslogtreecommitdiff
path: root/Test/test13/ErrorTraceTestLoopInvViolationBPL.bpl
blob: f1be4414cb87a032ef523ff76d2b050df93a55f2 (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
// simple assert
procedure asserting() {
  var x: int;

  x := 0;

  assert x == 1;
}

// invariant failing initially
procedure loopInvInitiallyViolated(y: int) {
  var x: int;

  x := y;

  while (true) invariant (x == 1); {
    x := 1;
  }
}

// invariant failing after iteration
procedure loopInvMaintenanceViolated() {
  var x: int;

  x := 0;

  while (true)  invariant x == 0; {
    x := 1;
  }
}