diff options
author | Rustan Leino <leino@microsoft.com> | 2012-01-12 10:38:14 -0800 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2012-01-12 10:38:14 -0800 |
commit | 96fdf08d3d67e15069bab10c9031515992bacdd7 (patch) | |
tree | 1d687f74e11fcf632312300f97c743fa9b2416fb /Test/dafny0 | |
parent | eb30557d70adb414dfd0b620c032bc558c5f7fe4 (diff) |
Dafny: handle refinement of nested tokens that come from SpliExpr (still need to deal with unsplit expressions, like quantifiers)
Diffstat (limited to 'Test/dafny0')
-rw-r--r-- | Test/dafny0/Answer | 8 | ||||
-rw-r--r-- | Test/dafny0/Predicates.dfy | 33 |
2 files changed, 40 insertions, 1 deletions
diff --git a/Test/dafny0/Answer b/Test/dafny0/Answer index 532330b8..1702ad53 100644 --- a/Test/dafny0/Answer +++ b/Test/dafny0/Answer @@ -1391,8 +1391,14 @@ Execution trace: Predicates.dfy(88,14): Error: assertion violation
Execution trace:
(0,0): anon0
+Predicates.dfy[Tricky_Full](121,5): Error BP5003: A postcondition might not hold on this return path.
+Predicates.dfy[Tricky_Full](120,15): Related location: This is the postcondition that might not hold.
+Predicates.dfy(131,7): Related location: Related location
+Predicates.dfy[Tricky_Full](111,9): Related location: Related location
+Execution trace:
+ (0,0): anon0
-Dafny program verifier finished with 26 verified, 3 errors
+Dafny program verifier finished with 33 verified, 4 errors
-------------------- SmallTests.dfy --------------------
SmallTests.dfy(30,11): Error: index out of range
diff --git a/Test/dafny0/Predicates.dfy b/Test/dafny0/Predicates.dfy index 334b3842..f7b6e07f 100644 --- a/Test/dafny0/Predicates.dfy +++ b/Test/dafny0/Predicates.dfy @@ -99,3 +99,36 @@ module AwareClient imports Tight { assert k == 4;
}
}
+
+// -------- Tricky refinement inheritance ----------------------------------------
+
+module Tricky_Base {
+ class Tree {
+ var x: int;
+ predicate Constrained
+ reads this;
+ {
+ x < 10
+ }
+ predicate Valid
+ reads this;
+ {
+ x < 100
+ }
+ method Init()
+ modifies this;
+ ensures Valid;
+ {
+ x := 20;
+ }
+ }
+}
+
+module Tricky_Full refines Tricky_Base {
+ class Tree {
+ predicate Valid
+ {
+ Constrained // this causes an error to be generated for the inherited Init
+ }
+ }
+}
|