diff options
author | rustanleino <unknown> | 2010-05-13 19:02:06 +0000 |
---|---|---|
committer | rustanleino <unknown> | 2010-05-13 19:02:06 +0000 |
commit | a660fb79bf527b42e3238b1810143f4fc3f3b827 (patch) | |
tree | 49ab2f1cdd38b97aaf8af0504fd32a986bbdd20f /Test/dafny0/Modules0.dfy | |
parent | f34f3551a17f9971231cd5c8fec8f27b6f9337b7 (diff) |
Dafny:
* Effectively make all in- and out-parameters of ghost methods ghosts.
* Added DafnyRuntime.cs back in, which is needed to run Dafny programs, but which, unfortunately, is currently not being used in the test suite (something we should address)
Diffstat (limited to 'Test/dafny0/Modules0.dfy')
-rw-r--r-- | Test/dafny0/Modules0.dfy | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Test/dafny0/Modules0.dfy b/Test/dafny0/Modules0.dfy index 0e0d3ab3..3e8d1e25 100644 --- a/Test/dafny0/Modules0.dfy +++ b/Test/dafny0/Modules0.dfy @@ -104,3 +104,19 @@ method ProcG(g: ClassG) { call g.T(); // allowed: intra-module call
var t := g.TFunc(); // allowed: intra-module call
}
+
+// ---------------------- some ghost stuff ------------------------
+
+class Ghosty {
+ method Caller() {
+ var x := 3;
+ ghost var y := 3;
+ call Callee(x, y); // fine
+ call Callee(x, x); // fine
+ call Callee(y, x); // error: cannot pass in ghost to a physical formal
+ call Theorem(x); // fine
+ call Theorem(y); // fine, because it's a ghost method
+ }
+ method Callee(a: int, ghost b: int) { }
+ ghost method Theorem(a: int) { }
+}
|