summaryrefslogtreecommitdiff
path: root/Test/dafny0
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-01-23 18:13:36 -0800
committerGravatar Rustan Leino <unknown>2013-01-23 18:13:36 -0800
commit1005adb004baf133b265eda5bfdc53022437e6ef (patch)
treeb2fd13051b5f484a79a9b2303404aafc2da5858f /Test/dafny0
parent967bd4d7a4223d710f8f10659cdced173b249eac (diff)
Fixed bug in translation of method termination checks, and also fixed a (previously undetected) specification bug in the test suite.
Diffstat (limited to 'Test/dafny0')
-rw-r--r--Test/dafny0/Answer2
-rw-r--r--Test/dafny0/Termination.dfy16
2 files changed, 17 insertions, 1 deletions
diff --git a/Test/dafny0/Answer b/Test/dafny0/Answer
index e3e513a4..cd5529fe 100644
--- a/Test/dafny0/Answer
+++ b/Test/dafny0/Answer
@@ -1093,7 +1093,7 @@ Execution trace:
Termination.dfy(291,3): anon12_Else
(0,0): anon13_Else
-Dafny program verifier finished with 57 verified, 7 errors
+Dafny program verifier finished with 59 verified, 7 errors
-------------------- DTypes.dfy --------------------
DTypes.dfy(15,14): Error: assertion violation
diff --git a/Test/dafny0/Termination.dfy b/Test/dafny0/Termination.dfy
index 83baade1..45520b4a 100644
--- a/Test/dafny0/Termination.dfy
+++ b/Test/dafny0/Termination.dfy
@@ -410,3 +410,19 @@ module MapTests {
{
}
}
+
+// --------------------- The following regression test case relies on the previous rank
+// --------------------- really being evaluated in the initial state
+
+class C {
+ var v: nat;
+ method Terminate()
+ modifies this;
+ decreases v;
+ {
+ if (v != 0) {
+ v := v - 1;
+ Terminate();
+ }
+ }
+}