summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2015-11-25 10:27:02 -0800
committerGravatar qunyanm <unknown>2015-11-25 10:27:02 -0800
commitb8fad094ad74180ca16670bebe602737d856b5da (patch)
treee14e7b6caac6fc2282b585b4bdbcd30b4a0a077a /Source/Dafny/Printer.cs
parent7dfa02c3da9f68b10b20e6afcd81767d3c6ebf02 (diff)
Fix issue 103. Emit the quantifiers for ForallStmt before AutoTrigger so that
the auto-triggers can be computed for ForallStmt.
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index 145e82e7..0a25b941 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -841,11 +841,22 @@ namespace Microsoft.Dafny {
wr.Write("}");
} else if (stmt is ForallStmt) {
- var s = (ForallStmt)stmt;
+ var s = (ForallStmt)stmt;
+ Attributes attributes = s.Attributes;
+ if (attributes == null && s.ForallExpressions != null) {
+ foreach (Expression expr in s.ForallExpressions) {
+ ForallExpr e = (ForallExpr)expr;
+ while (e != null && attributes == null) {
+ attributes = e.Attributes;
+ e = (ForallExpr)e.SplitQuantifierExpression;
+ }
+ if (attributes != null) { break; }
+ }
+ }
wr.Write("forall");
if (s.BoundVars.Count != 0) {
wr.Write(" ");
- PrintQuantifierDomain(s.BoundVars, s.Attributes, s.Range);
+ PrintQuantifierDomain(s.BoundVars, attributes, s.Range);
}
if (s.Ens.Count == 0) {
wr.Write(" ");