blob: 5a491877a80f2f8b88d64dd94b66b149c1e158a9 (
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
|
function {:existential true} {:absdomain "Intervals"} b1(x: int) : bool;
procedure main()
{
var i: int;
var x: int;
var arr: [int] int;
i := 0;
while(*)
invariant (i >= 0) && (forall j: int :: (0 <= j && j < i) ==> b1(arr[j]));
{
havoc x;
assume x == 0 || x == 1;
arr[i] := x;
i := i + 1;
}
havoc x;
assume x >= 0 && x < i;
assert arr[x] == 0 || arr[x] == 1;
}
|