summaryrefslogtreecommitdiff
path: root/Test/bitvectors/arrays.bpl
blob: dae54e63cac42123dad9f99a97ae018b487c7800 (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
// RUN: %boogie -proverWarnings:1 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
const unique f1 : Field int;
const unique f2 : Field bv32;
const unique f3 : Field bool;

const unique r1 : ref;
const unique r2 : ref;

var H : <x>[ref,Field x]x;

procedure foo()
  modifies H;
{
  var i : int;
  var b : bv32;
  var c : bool;

  H[r1, f1] := 3;
  H[r1, f2] := 77bv32;
  H[r1, f3] := true;
  i := H[r1,f1];
  b := H[r1,f2];
  c := H[r1,f3];
  assert i == 3;
  assert b == 77bv32;
  assert H[r1,f3];
}

var B : [bv32]bv32;

procedure bar()
  modifies B;
{
  var b : bv32;

  B[42bv32] := 77bv32;
  b := B[42bv32];
  assert b == 77bv32;
}


type Field a, ref;