diff options
author | Rustan Leino <leino@microsoft.com> | 2011-05-27 00:56:15 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-05-27 00:56:15 -0700 |
commit | 0de8c9463a1e948fd11d9fe34c729f26b3e1af1b (patch) | |
tree | 927f94e5ddb259d493551fe0d87d2c134dcd7858 /Test/dafny0/ParseErrors.dfy | |
parent | 172751103cce5c6615df5613c48ddb5b1ae6fa7a (diff) |
Dafny: added chaining operators
Diffstat (limited to 'Test/dafny0/ParseErrors.dfy')
-rw-r--r-- | Test/dafny0/ParseErrors.dfy | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/dafny0/ParseErrors.dfy b/Test/dafny0/ParseErrors.dfy new file mode 100644 index 00000000..d6f3005d --- /dev/null +++ b/Test/dafny0/ParseErrors.dfy @@ -0,0 +1,20 @@ +// ---------------------- chaining operators -----------------------------------
+
+method TestChaining0(j: int, k: int, m: int)
+ requires j != k != m; // error: cannot have more than one != per chain
+ requires j == k == m; // dandy
+ requires j < k == m == m+1 != m+2 >= 100; // error: cannot mix < and >=
+ requires j >= k == m == m-1 != m-2 < 100; // error: cannot mix >= and <
+{
+}
+
+method TestChaining1<T>(s: set<T>, t: set<T>, u: set<T>, x: T, SuperSet: set<set<T>>)
+ requires s <= t <= u >= s+u; // error: cannot mix <= and >=
+ ensures s <= u;
+ ensures s !! t !! u; // error: !! is not chaining (but it would be nice if it were)
+ ensures x in s in SuperSet; // error: 'in' is not chaining
+ ensures x !in s in SuperSet; // error: 'in' is not chaining
+ ensures x in s !in SuperSet; // error: 'in' is not chaining
+ ensures x in s == t; // error: 'in' is not chaining
+{
+}
|