summaryrefslogtreecommitdiff
path: root/Test/triggers/splitting-picks-the-right-tokens.dfy
diff options
context:
space:
mode:
authorGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-23 00:09:36 -0700
committerGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-23 00:09:36 -0700
commite0dbb8af7290beb81350acd0088866c0ca54acb8 (patch)
tree00e1e2ab7d10142ddf0218c4260e66532ee9ca52 /Test/triggers/splitting-picks-the-right-tokens.dfy
parent1a0ef1ae83a88966a2d68e5eba5a70a215f28f3e (diff)
Improve error reporting for split quantifiers
Diffstat (limited to 'Test/triggers/splitting-picks-the-right-tokens.dfy')
-rw-r--r--Test/triggers/splitting-picks-the-right-tokens.dfy24
1 files changed, 24 insertions, 0 deletions
diff --git a/Test/triggers/splitting-picks-the-right-tokens.dfy b/Test/triggers/splitting-picks-the-right-tokens.dfy
new file mode 100644
index 00000000..76065eca
--- /dev/null
+++ b/Test/triggers/splitting-picks-the-right-tokens.dfy
@@ -0,0 +1,24 @@
+// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /autoTriggers:1 /printTooltips "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+// This file ensures that trigger splitting picks the right tokens
+
+function Id(i: int): int { i }
+
+method MSuchThat()
+ requires forall x | x > 0 :: Id(x) > 1 && x > 2 && x > -1 { }
+
+method MImplies()
+ // The bodies of the two terms that are produced here are both
+ // BinaryExpressions(==>); the token they use, however, is that of the RHS
+ // terms of these implications; otherwise, error messages would get stacked on
+ // the ==> sign
+ requires forall x :: x > 0 ==> Id(x) > 1 && x > 2 && x > -1 { }
+
+method M() {
+ if * {
+ MImplies();
+ } else {
+ MSuchThat();
+ }
+}