From 6e935875b5cfbdee8a7f6573f9f01c48db746d56 Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Wed, 19 Aug 2015 22:22:54 -0700 Subject: 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 --- Test/wishlist/sequences-s0-in-s.dfy | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Test/wishlist/sequences-s0-in-s.dfy (limited to 'Test/wishlist/sequences-s0-in-s.dfy') 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, 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, i: nat) + requires forall x {:autotriggers false} :: x in s ==> x > 0; + requires |s| > 0 { + assert s[0] > 0; // Works +} -- cgit v1.2.3 From 3d45aa05a023c092167d938a72adf78cf1f76fdf Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Fri, 28 Aug 2015 20:47:42 -0700 Subject: Clarify a comment --- Test/wishlist/sequences-s0-in-s.dfy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Test/wishlist/sequences-s0-in-s.dfy') diff --git a/Test/wishlist/sequences-s0-in-s.dfy b/Test/wishlist/sequences-s0-in-s.dfy index 20127917..c221dbb2 100644 --- a/Test/wishlist/sequences-s0-in-s.dfy +++ b/Test/wishlist/sequences-s0-in-s.dfy @@ -21,5 +21,5 @@ method InSeqTriggers(s: seq, i: nat) method InSeqNoAutoTriggers(s: seq, i: nat) requires forall x {:autotriggers false} :: x in s ==> x > 0; requires |s| > 0 { - assert s[0] > 0; // Works + assert s[0] > 0; // Works (Z3 matches on $Box above) } -- cgit v1.2.3