summaryrefslogtreecommitdiff
path: root/Test/test2/InvariantVerifiedUnder0.bpl
blob: dc8e0d4adc0eef261943eca6ce87f9a4697f9b6f (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
50
51
52
53
54
// RUN: %boogie -noinfer "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

procedure Test0()
{
    while (*)
      invariant {:verified_under false} false;  // error
    {}
}


procedure Test1()
{
    while (*)
      invariant {:verified_under true} false;
    {}
}


procedure Test2(P: bool, Q: bool, A: bool)
{
    while (*)
      invariant {:verified_under A} P;  // error
      invariant {:verified_under A} Q;  // error
    {}
}


procedure Test3(P: bool, Q: bool, A: bool)
  requires !A ==> P;
{
    while (*)
      invariant {:verified_under A} P;
      invariant {:verified_under A} Q;  // error
    {}
}

procedure Test4(P: bool, Q: bool, A: bool)
{
    while (*)
      invariant {:verified_under A} {:verified_under true} P;  // error
      invariant {:verified_under A} {:verified_under true} Q;  // error
    {}
}


procedure Test5(P: bool, Q: bool, A: bool)
  requires !A ==> Q;
{
    while (*)
      invariant {:verified_under A} {:verified_under true} P;  // error
      invariant {:verified_under A} {:verified_under true} Q;
    {}
}