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/houdini/houd4.bpl |
Initial set of files.
Diffstat (limited to 'Test/houdini/houd4.bpl')
-rw-r--r-- | Test/houdini/houd4.bpl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Test/houdini/houd4.bpl b/Test/houdini/houd4.bpl new file mode 100644 index 00000000..9895d633 --- /dev/null +++ b/Test/houdini/houd4.bpl @@ -0,0 +1,27 @@ +const {:existential true} b1:bool;
+const {:existential true} b2:bool;
+const {:existential true} b3:bool;
+const {:existential true} b4:bool;
+
+var array:[int]int;
+
+procedure foo (i:int)
+requires b2 ==> i > 0;
+ensures b3 ==> array[i] > 0;
+modifies array;
+ensures (forall x:int :: {array[x]} x == i || array[x] == old(array)[x]);
+{
+ array[i] := 2 * i;
+}
+
+procedure bar (j:int) returns (result:int)
+requires b4 ==> j > 0;
+modifies array;
+ensures (forall x:int :: {array[x]} (b1 && x == j) || array[x] == old(array)[x]);
+{
+ call foo(j);
+ result := array[j];
+}
+
+// expected outcome: Correct
+// expected assignment: b1->True,b2->True,b3->True,b4->True
\ No newline at end of file |