blob: 2f08618af7e7ef720ab5118127179a8e4ee02915 (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/*
In functions marked with {:selective_checking} all asserts are turned into assumes,
except for the ones reachable from the commands marked with {:start_checking_here}.
Thus, "assume {:start_checking_here} whatever;" is an inverse of "assume false;".
The first one disables all verification before it, and the second one disables
all verification after.
*/
procedure {:selective_checking} foo()
{
var x, y, z : int;
assert x < y;
assert y < z;
assume {:start_checking_here} true;
assert x < z;
}
procedure {:selective_checking} foo_fail1()
{
var x, y, z : int;
assert x < y;
assume {:start_checking_here} true;
assert x < z;
}
procedure {:selective_checking} foo_fail2()
{
var x, y, z : int;
assert x < y;
if (*) {
assume {:start_checking_here} true;
}
assert x < z;
}
procedure foo_no_selch()
{
var x, y, z : int;
assert x < y;
assume {:start_checking_here} true;
assert x < z;
}
|