diff options
author | Rustan Leino <leino@microsoft.com> | 2011-10-19 18:35:52 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-10-19 18:35:52 -0700 |
commit | 30049127c65c744dbbb243fc25b8b547effeb79d (patch) | |
tree | d01948973cbfcd76a295d4bdb29d3841de6b7636 /Test/dafny2 | |
parent | b1874001c408f9e7b5fb5024d526559f09e1b3b1 (diff) |
Dafny: fixed performance-buggy translation of exists, and also added some other features in SplitExpr (such as induction on existential quantifiers)
Diffstat (limited to 'Test/dafny2')
-rw-r--r-- | Test/dafny2/COST-verif-comp-2011-4-FloydCycleDetect.dfy | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Test/dafny2/COST-verif-comp-2011-4-FloydCycleDetect.dfy b/Test/dafny2/COST-verif-comp-2011-4-FloydCycleDetect.dfy index d846269d..774008b8 100644 --- a/Test/dafny2/COST-verif-comp-2011-4-FloydCycleDetect.dfy +++ b/Test/dafny2/COST-verif-comp-2011-4-FloydCycleDetect.dfy @@ -231,12 +231,7 @@ class Node { requires 0 <= a && 1 <= b;
requires forall k,l :: 0 <= k < l < a ==> Nexxxt(k, S) != Nexxxt(l, S);
requires Nexxxt(a, S) == null || Nexxxt(a, S).Nexxxt(b, S) == Nexxxt(a, S);
- // The next line most straightforwardly expresses the postcondition of this method:
- // ensures exists T :: 0 <= T <= a+b && Nexxxt(T, S) == Nexxxt(1+2*T, S);
- // However, Dafny does an unfortunate (I would say performance-buggy) translation of existential
- // quantifiers, which the alternative formulation of "exists x :: P(x)" as
- // "(forall x :: !P(x)) ==> false" works around. This translation issue should be fixed.
- ensures (forall T :: !(0 <= T <= a+b && Nexxxt(T, S) == Nexxxt(1+2*T, S))) ==> false;
+ ensures exists T :: 0 <= T < a+b && Nexxxt(T, S) == Nexxxt(1+2*T, S);
{
if (Nexxxt(a, S) == null) {
Lemma_NullIsTerminal(1+2*a, S);
@@ -276,7 +271,6 @@ class Node { i, t, vt, h := i+1, t+1, vt+1, h+2;
}
assert a <= t < a + b && Nexxxt(t, S) == Nexxxt(1 + 2*t, S);
- assert exists T :: 0 <= T < a+b && Nexxxt(T, S) == Nexxxt(1+2*T, S);
}
}
|