summaryrefslogtreecommitdiff
path: root/Test/test2/IfThenElse1.bpl
blob: 8a867f502c8564b69a3c5a6fd92990d6c1e0a212 (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
type t1;

procedure ok()
{
  var b:bool, x:int, y:int;

  assert x == if b then x else x;
  assert x == if true then x else y;
}

procedure ok2()
{
  var x:int, y:int;
  var a:t1, b:t1, c:t1;

  c := if x > y then a else b;
  assert c == a || c == b;
  assume x > y;
  assert c == a;
}

procedure fail1()
{
  var b:bool, x:int, y:int;

  assert x == if b then x else y;
}

procedure fail2()
{
  var b:bool, x:int, y:int;

  assert x == if false then x else y;
}