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 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Test/dafny4/Bug93.dfy (limited to 'Test/dafny4/Bug93.dfy') 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; + } +} + -- cgit v1.2.3