summaryrefslogtreecommitdiff
path: root/Test/dafny0/RefinementErrors.dfy
diff options
context:
space:
mode:
authorGravatar kyessenov <unknown>2010-07-14 00:46:13 +0000
committerGravatar kyessenov <unknown>2010-07-14 00:46:13 +0000
commit9e006c6605ace15f25e9bff390b0421e9d6faec7 (patch)
tree2e741ecdc6d3179f2f558080d44cbd05e2a613d2 /Test/dafny0/RefinementErrors.dfy
parent51eeaab85a7c42cfa5c98052481ad4e037f4e8b6 (diff)
Dafny: better error reporting on resolution of refinements. Replace assertions with "if"s to handle errors gently and add cycle detection check.
Diffstat (limited to 'Test/dafny0/RefinementErrors.dfy')
-rw-r--r--Test/dafny0/RefinementErrors.dfy57
1 files changed, 57 insertions, 0 deletions
diff --git a/Test/dafny0/RefinementErrors.dfy b/Test/dafny0/RefinementErrors.dfy
new file mode 100644
index 00000000..de8694b3
--- /dev/null
+++ b/Test/dafny0/RefinementErrors.dfy
@@ -0,0 +1,57 @@
+class A refines C {
+}
+
+class B refines A {
+}
+
+class C refines B {
+}
+
+
+class D {
+ refines M()
+ {
+ }
+}
+
+class E {
+ var x: int;
+
+ method M()
+ {
+ x := 0;
+ }
+}
+
+class F {
+ replaces M by x == y;
+}
+
+class G refines E {
+ var y: int;
+ replaces x by x == y;
+
+ refines M() returns (i: int)
+ {
+ }
+}
+
+class H refines E {
+ var x: int;
+
+ method M()
+ {
+ }
+}
+
+class J refines E {
+ var y: int;
+ replaces x by x == y;
+
+ refines M()
+ {
+ y := 1;
+ }
+}
+
+