diff options
author | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
---|---|---|
committer | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
commit | ce1c2de044c91624370411e23acab13b0381949b (patch) | |
tree | 592539996fe08050ead5ee210c973801611dde40 /Test/test21/InterestingExamples1.bpl |
Initial set of files.
Diffstat (limited to 'Test/test21/InterestingExamples1.bpl')
-rw-r--r-- | Test/test21/InterestingExamples1.bpl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Test/test21/InterestingExamples1.bpl b/Test/test21/InterestingExamples1.bpl new file mode 100644 index 00000000..3ec7449e --- /dev/null +++ b/Test/test21/InterestingExamples1.bpl @@ -0,0 +1,27 @@ +
+type Set = <a> [a] bool;
+type Field a;
+type Heap = <b> [ref, Field b] b;
+
+
+const emptySet : Set;
+axiom (forall<t> x:t :: !emptySet[x]);
+
+procedure P() returns () {
+ var x : Set, f : Field Set, g : Field int, heap : Heap, o : ref;
+
+ x := emptySet;
+ heap[o, f] := x;
+ heap[o, g] := 13;
+ assert heap[o, f] == emptySet && heap[o, g] == 13;
+
+ heap[o, f] := heap[o, f][17 := true];
+ heap[o, f] := heap[o, f][g := true];
+
+ assert (forall<t> y:t :: heap[o, f][y] == (y == 17 || y == g));
+ assert (forall<t> y:t :: heap[o, f][y] == (y == 16 || y == g)); // should not hold
+
+}
+
+type ref;
+
|