summaryrefslogtreecommitdiff
path: root/Test/dafny0/TypeAntecedents.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2011-05-27 01:44:26 -0700
committerGravatar Rustan Leino <leino@microsoft.com>2011-05-27 01:44:26 -0700
commit803f42612314d2d27f20dfa476bf0ff8ed24d958 (patch)
treef341d7239381047f31d761938df3b9e1f7a3874c /Test/dafny0/TypeAntecedents.dfy
parente1bf8c0bfff274a0651fb581951cfcaae8b34007 (diff)
Dafny: permanently changed the syntax of "datatype" declarations to what previously was an alternative syntax
Diffstat (limited to 'Test/dafny0/TypeAntecedents.dfy')
-rw-r--r--Test/dafny0/TypeAntecedents.dfy17
1 files changed, 5 insertions, 12 deletions
diff --git a/Test/dafny0/TypeAntecedents.dfy b/Test/dafny0/TypeAntecedents.dfy
index 38050b88..2bedd37d 100644
--- a/Test/dafny0/TypeAntecedents.dfy
+++ b/Test/dafny0/TypeAntecedents.dfy
@@ -1,10 +1,8 @@
// -------- This is an example of what was once logically (although not trigger-ly) unsound ---
-datatype Wrapper<T> {
- Wrap(T);
-}
-datatype Unit { It; }
-datatype Color { Yellow; Blue; }
+datatype Wrapper<T> = Wrap(T);
+datatype Unit = It;
+datatype Color = Yellow | Blue;
function F(a: Wrapper<Unit>): bool
ensures a == Wrapper.Wrap(Unit.It);
@@ -49,10 +47,7 @@ class MyClass {
function H(): int { 5 }
}
-datatype List {
- Nil;
- Cons(MyClass, List);
-}
+datatype List = Nil | Cons(MyClass, List);
method M(list: List, S: set<MyClass>) returns (ret: int)
modifies S;
@@ -97,8 +92,6 @@ function NF(): MyClass;
function TakesADatatype(a: List): int { 12 }
-datatype GenData<T> {
- Pair(T, T);
-}
+datatype GenData<T> = Pair(T, T);
function AlsoTakesADatatype<U>(p: GenData<U>): int { 17 }