summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2015-11-06 13:51:08 -0800
committerGravatar qunyanm <unknown>2015-11-06 13:51:08 -0800
commit23067608f2d8855abd64982cabfe7f0c7f8e4f5a (patch)
treea52a4b8af99584e9bd951d9e484f477eedb4524f
parentd3c778854c2dc792a2dfbd9c5b05d667d18fb4c4 (diff)
Fix issue 99. When annotate a quantifier expr that has a SplitQuantifier, we
need exclude the private terms (the ones that includes the quantifier expr's bv) from it exported terms.
-rw-r--r--Source/Dafny/Triggers/TriggersCollector.cs4
-rw-r--r--Test/dafny4/Bug99.dfy11
-rw-r--r--Test/dafny4/Bug99.dfy.expect2
3 files changed, 15 insertions, 2 deletions
diff --git a/Source/Dafny/Triggers/TriggersCollector.cs b/Source/Dafny/Triggers/TriggersCollector.cs
index c25f65b9..698ea3b5 100644
--- a/Source/Dafny/Triggers/TriggersCollector.cs
+++ b/Source/Dafny/Triggers/TriggersCollector.cs
@@ -201,8 +201,8 @@ namespace Microsoft.Dafny.Triggers {
(expr is UnaryOpExpr && (((UnaryOpExpr)expr).Op == UnaryOpExpr.Opcode.Cardinality)) || // FIXME || ((UnaryOpExpr)expr).Op == UnaryOpExpr.Opcode.Fresh doesn't work, as fresh is a pretty tricky predicate when it's not about datatypes. See translator.cs:10944
(expr is BinaryExpr && (((BinaryExpr)expr).Op == BinaryExpr.Opcode.NotIn || ((BinaryExpr)expr).Op == BinaryExpr.Opcode.In))) {
annotation = AnnotatePotentialCandidate(expr);
- } else if (expr is QuantifierExpr && ((QuantifierExpr)expr).SplitQuantifier == null) {
- annotation = AnnotateQuantifier((QuantifierExpr)expr);
+ } else if (expr is QuantifierExpr) {
+ annotation = AnnotateQuantifier((QuantifierExpr)expr);
} else if (expr is LetExpr) {
annotation = AnnotateLetExpr((LetExpr)expr);
} else if (expr is IdentifierExpr) {
diff --git a/Test/dafny4/Bug99.dfy b/Test/dafny4/Bug99.dfy
new file mode 100644
index 00000000..3f95ce9f
--- /dev/null
+++ b/Test/dafny4/Bug99.dfy
@@ -0,0 +1,11 @@
+// RUN: %dafny /autoTriggers:1 /compile:0 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+predicate P(e:int, p:int) { true }
+predicate Q(i:int, t:int)
+
+lemma Tester(x:int)
+{
+ assert forall i :: Q(i, x) ==> (forall p {:trigger P(i, p)} :: P(i, p));
+
+}
diff --git a/Test/dafny4/Bug99.dfy.expect b/Test/dafny4/Bug99.dfy.expect
new file mode 100644
index 00000000..73ba063c
--- /dev/null
+++ b/Test/dafny4/Bug99.dfy.expect
@@ -0,0 +1,2 @@
+
+Dafny program verifier finished with 4 verified, 0 errors