summaryrefslogtreecommitdiff
path: root/Test/AbsHoudini/pred5.bpl
diff options
context:
space:
mode:
Diffstat (limited to 'Test/AbsHoudini/pred5.bpl')
-rw-r--r--Test/AbsHoudini/pred5.bpl24
1 files changed, 24 insertions, 0 deletions
diff --git a/Test/AbsHoudini/pred5.bpl b/Test/AbsHoudini/pred5.bpl
new file mode 100644
index 00000000..6940e820
--- /dev/null
+++ b/Test/AbsHoudini/pred5.bpl
@@ -0,0 +1,24 @@
+function {:existential true} b1(x: bool) : bool;
+
+procedure main()
+{
+ var i: int;
+ var x: int;
+ var arr: [int] int;
+
+ i := 0;
+
+ while(*)
+ invariant b1((i >= 0) && (forall j: int :: (0 <= j && j < i) ==> arr[j] == 0));
+ {
+ havoc x;
+ assume x == 0;
+
+ arr[i] := x;
+ i := i + 1;
+ }
+
+ havoc x;
+ assume x >= 0 && x < i;
+ assert b1(arr[x] == 0);
+}