diff options
author | Rustan Leino <unknown> | 2013-06-20 16:10:48 -0700 |
---|---|---|
committer | Rustan Leino <unknown> | 2013-06-20 16:10:48 -0700 |
commit | f75149436835b10ebba203a7a72ba52e723be03b (patch) | |
tree | 3dfb7e183b47edfad800866b7b8d64fada37274a /Test/dafny0/Datatypes.dfy | |
parent | cbb62c37bcfe5fa6d3b41f30d7a2c4ee711fc036 (diff) |
One more test case for the "datatype constructor cases" axiom, namely the example given in Issue 18 on dafny.codeplex.com (which was fixed in the previous check-in).
Diffstat (limited to 'Test/dafny0/Datatypes.dfy')
-rw-r--r-- | Test/dafny0/Datatypes.dfy | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Test/dafny0/Datatypes.dfy b/Test/dafny0/Datatypes.dfy index f2884b6a..5598844d 100644 --- a/Test/dafny0/Datatypes.dfy +++ b/Test/dafny0/Datatypes.dfy @@ -246,7 +246,7 @@ function FwdBugFunction(f: Fwd): bool // There was once a bug in Dafny, where this had caused an ill-defined Boogie program.
}
-datatype Fwd = FwdNil | FwdCons(int, w: Fwd);
+datatype Fwd = FwdNil | FwdCons(k: int, w: Fwd);
method TestAllCases(f: Fwd)
{
@@ -267,3 +267,8 @@ class ContainsFwd { assert fwd.FwdNil? || fwd.FwdCons?;
}
}
+
+function foo(f: Fwd): int
+{
+ if f.FwdNil? then 0 else f.k
+}
|