diff options
author | qunyanm <unknown> | 2016-03-18 09:48:26 -0700 |
---|---|---|
committer | qunyanm <unknown> | 2016-03-18 09:48:26 -0700 |
commit | acbc126c01fee3ab71647a7b16f4dcfc80eee2ea (patch) | |
tree | 1857c37efd45a6e132ce873588988d8a973aae9b /Test/dafny4 | |
parent | f48f5e1cef6482557d3f90677c5e41b75b2092b4 (diff) |
Fix issue 93. Add per-function fuel setting that can be adjusted locally based
on context.
Diffstat (limited to 'Test/dafny4')
-rw-r--r-- | Test/dafny4/Bug93.dfy | 37 | ||||
-rw-r--r-- | Test/dafny4/Bug93.dfy.expect | 8 |
2 files changed, 45 insertions, 0 deletions
diff --git a/Test/dafny4/Bug93.dfy b/Test/dafny4/Bug93.dfy new file mode 100644 index 00000000..5a1dd27f --- /dev/null +++ b/Test/dafny4/Bug93.dfy @@ -0,0 +1,37 @@ +// RUN: %dafny /compile:0 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+module Fuel {
+ function FunctionA(x:int) : int
+ {
+ x + 2
+ }
+
+ function FunctionB(y:int) : int
+ {
+ FunctionA(y - 2)
+ }
+
+ method {:fuel FunctionA,0,0} MethodX(z:int)
+ {
+ assert FunctionB(z) == z; // error: Cannot see the body of FunctionA
+ }
+}
+
+module Opaque {
+ function {:opaque} FunctionA(x:int) : int
+ {
+ x + 2
+ }
+
+ function FunctionB(y:int) : int
+ {
+ FunctionA(y - 2)
+ }
+
+ method MethodX(z:int)
+ {
+ assert FunctionB(z) == z;
+ }
+}
+
diff --git a/Test/dafny4/Bug93.dfy.expect b/Test/dafny4/Bug93.dfy.expect new file mode 100644 index 00000000..d0baf877 --- /dev/null +++ b/Test/dafny4/Bug93.dfy.expect @@ -0,0 +1,8 @@ +Bug93.dfy(17,28): Error: assertion violation
+Execution trace:
+ (0,0): anon0
+Bug93.dfy(34,28): Error: assertion violation
+Execution trace:
+ (0,0): anon0
+
+Dafny program verifier finished with 7 verified, 2 errors
|