summaryrefslogtreecommitdiff
path: root/Test/test21/Orderings3.bpl
blob: c94d298cdbd60d6425f851666fbe8424d1e1684f (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
// Example from the Boogie 2 language report


type Wicket;


const unique a: Wicket extends complete;
const unique b: Wicket;
const unique c: Wicket extends a, b complete;
const unique d: Wicket extends c;
const unique e: Wicket;

procedure P() returns () {

  assert !(exists x:Wicket :: a <: x && a != x);
  assert (forall x:Wicket :: x <: a ==> x == a || x <: c);

  assert c <: b && !(exists x:Wicket :: c <: x && x <: b && x != c && x != b);

  assert !(b <: a) && !(b <: c);

  assert c <: a && c <: b && d <: c;
  assert (forall x:Wicket :: c <: x ==> c==x || a <: x || b <: x);
  assert (forall x:Wicket :: x <: c ==> c==x || x <: d);

  assert d <: c;
  assert !(a <: d) && !(b <: d) && !(c <: d);

  assert false;           // unprovable
}

procedure Q() returns () {
  
  assert (forall x:Wicket :: x <: b && x != b ==> x <: c);   // unprovable

  assert !(exists x:Wicket :: b <: x && b != x);             // unprovable

}