diff options
author | rustanleino <unknown> | 2010-03-19 04:22:48 +0000 |
---|---|---|
committer | rustanleino <unknown> | 2010-03-19 04:22:48 +0000 |
commit | 4622c8070d0c9601dbe2fcdd57f68850f1fbda3f (patch) | |
tree | 25190c5ef23ab440dc9e10a50b6850d790a34197 /Test/dafny0/BadFunction.dfy | |
parent | 525020dacd005014ec4b90e9ce619979d5396232 (diff) |
Dafny: Ensures that function axioms are not being used while their consistency is being checked.
Diffstat (limited to 'Test/dafny0/BadFunction.dfy')
-rw-r--r-- | Test/dafny0/BadFunction.dfy | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Test/dafny0/BadFunction.dfy b/Test/dafny0/BadFunction.dfy new file mode 100644 index 00000000..3affaa80 --- /dev/null +++ b/Test/dafny0/BadFunction.dfy @@ -0,0 +1,13 @@ +// The following function gives rise to an inconsistent axiom, except
+// for its CanUseFunctionDefs antecedent, which saves the day.
+function F(x: int): int
+ decreases x;
+{
+ F(x) + 1 // error: does not decrease termination metric
+}
+
+method M()
+{
+ assert F(5) == 0; // no error is generated here, because of the inconsistent axiom
+ assert false; // ditto
+}
|