summaryrefslogtreecommitdiff
path: root/Test/dafny4
diff options
context:
space:
mode:
authorGravatar leino <unknown>2015-04-28 21:04:11 -0700
committerGravatar leino <unknown>2015-04-28 21:04:11 -0700
commitb1eb6d157f3a148b08489b2a5eb950797b1adcfc (patch)
tree3c6a8a23fee97c8705d48d9a4e62a32af6fd112b /Test/dafny4
parentfc29e6df8a452977d8b7b354b37ac8f2e77b3a4b (diff)
Added a test where Dafny verifies something that the Juggernaut tool can infer
Diffstat (limited to 'Test/dafny4')
-rw-r--r--Test/dafny4/Juggernaut.dfy20
-rw-r--r--Test/dafny4/Juggernaut.dfy.expect2
2 files changed, 22 insertions, 0 deletions
diff --git a/Test/dafny4/Juggernaut.dfy b/Test/dafny4/Juggernaut.dfy
new file mode 100644
index 00000000..783f725b
--- /dev/null
+++ b/Test/dafny4/Juggernaut.dfy
@@ -0,0 +1,20 @@
+// RUN: %dafny /compile:0 /dprint:"%t.dprint" "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+method Jug()
+{
+ var x, y, z;
+ while x > 0 && y > 0 && z > 0
+ decreases x < y, z
+ {
+ if y > x {
+ y := z;
+ x := *;
+ z := x - 1;
+ } else {
+ z := z - 1;
+ x := *;
+ y := x - 1;
+ }
+ }
+}
diff --git a/Test/dafny4/Juggernaut.dfy.expect b/Test/dafny4/Juggernaut.dfy.expect
new file mode 100644
index 00000000..069e7767
--- /dev/null
+++ b/Test/dafny4/Juggernaut.dfy.expect
@@ -0,0 +1,2 @@
+
+Dafny program verifier finished with 2 verified, 0 errors