diff options
author | Jason Koenig <unknown> | 2012-07-17 18:27:03 -0700 |
---|---|---|
committer | Jason Koenig <unknown> | 2012-07-17 18:27:03 -0700 |
commit | b76f8a0e1a7174b266aa64f82b08631a2efa5d10 (patch) | |
tree | 6e99a6c38ca4c9485282170d876dd6ecf62ad82d /Test/dafny0/Comprehensions.dfy | |
parent | 590079fd7a28692b67fe98c6bb2ab0bc915254c3 (diff) |
Dafny: allowed strictly finite datatypes in comprehensions, quantifiers, and parallel statements.
Diffstat (limited to 'Test/dafny0/Comprehensions.dfy')
-rw-r--r-- | Test/dafny0/Comprehensions.dfy | 3 |
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);
|