diff options
author | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-08-19 22:22:54 -0700 |
---|---|---|
committer | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-08-19 22:22:54 -0700 |
commit | 6e935875b5cfbdee8a7f6573f9f01c48db746d56 (patch) | |
tree | f5b79506ae84c908a68d2c1aa9214daa18ec652b /Test/wishlist/sequences-s0-in-s.dfy | |
parent | 8afb07fb60f9521212066fbbff233c034ee8af40 (diff) |
Add a wishlist folder to the test suite, with things that we do not support (yet!)
The curent examples include semi-bugs regarding calc statements and strings, and
stuff about sequences
Diffstat (limited to 'Test/wishlist/sequences-s0-in-s.dfy')
-rw-r--r-- | Test/wishlist/sequences-s0-in-s.dfy | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Test/wishlist/sequences-s0-in-s.dfy b/Test/wishlist/sequences-s0-in-s.dfy new file mode 100644 index 00000000..20127917 --- /dev/null +++ b/Test/wishlist/sequences-s0-in-s.dfy @@ -0,0 +1,25 @@ +// RUN: %dafny /compile:0 /autoTriggers:1 /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+// The following is also due to a weakness in the axiomatization: namely, it is
+// not easy to learn, using Dafny's axioms, that s[0] in s. One can of course
+// prove it, but it doesn't come for free.
+
+method InSeqTriggers(s: seq<int>, i: nat)
+ requires forall x :: x in s ==> x > 0;
+ requires |s| > 0 {
+ if * {
+ // Fails
+ assert s[0] > 0; // WISH
+ } else if * {
+ // Works
+ assert s[0] in s;
+ assert s[0] > 0;
+ }
+}
+
+method InSeqNoAutoTriggers(s: seq<int>, i: nat)
+ requires forall x {:autotriggers false} :: x in s ==> x > 0;
+ requires |s| > 0 {
+ assert s[0] > 0; // Works
+}
|