summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorGravatar Jason Koenig <unknown>2012-07-17 18:27:03 -0700
committerGravatar Jason Koenig <unknown>2012-07-17 18:27:03 -0700
commit149540a251282e2b0ed0a4be940d1d91d2908627 (patch)
tree412c80d65b7ef1087f201bdcaf2f2f5cc2af9afa /Test
parentcaf298f8cab0138c0dde7328b0565642094256a7 (diff)
Dafny: allowed strictly finite datatypes in comprehensions, quantifiers, and parallel statements.
Diffstat (limited to 'Test')
-rw-r--r--Test/dafny0/Comprehensions.dfy3
1 files changed, 3 insertions, 0 deletions
diff --git a/Test/dafny0/Comprehensions.dfy b/Test/dafny0/Comprehensions.dfy
index d53fb6a5..ca1fcfb7 100644
--- a/Test/dafny0/Comprehensions.dfy
+++ b/Test/dafny0/Comprehensions.dfy
@@ -11,6 +11,7 @@ method M()
function method Id(x: int): int { x } // for triggering
+datatype D = A | B;
// The following mainly test that set comprehensions can be compiled, but one would
// have to run the resulting program to check that the compiler is doing the right thing.
method Main()
@@ -18,6 +19,8 @@ method Main()
var q := set i,j | 0 <= i && i < 10 && 0 <= j && j < 3 :: i+j;
PrintSet(q);
q := set b: bool | true :: if b then 3 else 7;
+ var d := set b:D | true;
+ var test := forall d:D :: d == A || d == B;
PrintSet(q);
var m := set k | k in q :: 2*k;
PrintSet(m);