From 4f0b823bdc1be13c2589cc46f650ab57d29e7117 Mon Sep 17 00:00:00 2001 From: qunyanm Date: Thu, 4 Feb 2016 12:35:46 -0800 Subject: Fix issue 128. Change the translation of CanCallAssumption for let-such-that expression from // CanCall[[ var b :| RHS(b,g); Body(b,g,h) ]] = // (forall b0,b1 :: typeAntecedent ==> // CanCall[[ RHS(b,g) ]] && // (RHS(b,g) ==> CanCall[[ Body(b,g,h) ]]) && // $let$canCall(b,g)) to // CanCall[[ var b0,b1 :| RHS(b0,b1,g); Body(b0,b1,g,h) ]] = // $let$canCall(g) && // CanCall[[ Body($let$b0(g), $let$b1(g), h) ]] --- Test/dafny4/Bug128.dfy | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Test/dafny4/Bug128.dfy (limited to 'Test/dafny4/Bug128.dfy') diff --git a/Test/dafny4/Bug128.dfy b/Test/dafny4/Bug128.dfy new file mode 100644 index 00000000..b7220335 --- /dev/null +++ b/Test/dafny4/Bug128.dfy @@ -0,0 +1,13 @@ +// RUN: %dafny /noNLarith /z3opt:pi.warnings=true /proverWarnings:1 /compile:0 /autoTriggers:1 "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +function GetIndexInSequence(s:seq, x:T) : int + requires x in s; + ensures 0 <= GetIndexInSequence(s, x) < |s|; + ensures s[GetIndexInSequence(s, x)] == x; { + var i :| 0 <= i < |s| && s[i] == x; + i + } + + + -- cgit v1.2.3