summaryrefslogtreecommitdiff
path: root/Test/test13/ErrorTraceTestLoopInvViolationBPL.bpl
blob: c1bdfa234cde976a2c41ccd4064b2e7bd0388b54 (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
// RUN: %boogie %s > %t
// RUN: %diff %s.expect %t
// 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;
  }
}