From acbc126c01fee3ab71647a7b16f4dcfc80eee2ea Mon Sep 17 00:00:00 2001 From: qunyanm Date: Fri, 18 Mar 2016 09:48:26 -0700 Subject: Fix issue 93. Add per-function fuel setting that can be adjusted locally based on context. --- Test/dafny4/Bug93.dfy | 37 +++++++++++++++++++++++++++++++++++++ Test/dafny4/Bug93.dfy.expect | 8 ++++++++ 2 files changed, 45 insertions(+) create mode 100644 Test/dafny4/Bug93.dfy create mode 100644 Test/dafny4/Bug93.dfy.expect (limited to 'Test/dafny4') 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 -- cgit v1.2.3