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 +++++++++++++ Test/dafny4/Bug128.dfy.expect | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 Test/dafny4/Bug128.dfy create mode 100644 Test/dafny4/Bug128.dfy.expect (limited to 'Test') 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 + } + + + diff --git a/Test/dafny4/Bug128.dfy.expect b/Test/dafny4/Bug128.dfy.expect new file mode 100644 index 00000000..700ad964 --- /dev/null +++ b/Test/dafny4/Bug128.dfy.expect @@ -0,0 +1,4 @@ +Prover warning: pattern does not contain all quantified variables. +Prover warning: pattern does not contain all quantified variables. + +Dafny program verifier finished with 1 verified, 0 errors -- cgit v1.2.3