diff options
author | 2011-07-05 15:43:20 -0700 | |
---|---|---|
committer | 2011-07-05 15:43:20 -0700 | |
commit | 99d84bd265479e480e75f82de9917e9a4dc96b9b (patch) | |
tree | 7220e69c69968f38e682326e253129e4348dff37 /Chalice/tests/refinements/SpecStmt.chalice | |
parent | 086898e7a2df0fbac8807058abfa82ae145e434a (diff) | |
parent | d786b753f39294f4e2d5f57d16c69bb450abc799 (diff) |
Merge
Diffstat (limited to 'Chalice/tests/refinements/SpecStmt.chalice')
-rw-r--r-- | Chalice/tests/refinements/SpecStmt.chalice | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Chalice/tests/refinements/SpecStmt.chalice b/Chalice/tests/refinements/SpecStmt.chalice new file mode 100644 index 00000000..15072d41 --- /dev/null +++ b/Chalice/tests/refinements/SpecStmt.chalice @@ -0,0 +1,35 @@ +class Test { + var x: int; + method m(a:int) returns (b:int) + { + var c := 0; + ghost const d,c [d == c]; + var b [b == 0]; + var e [e == a]; + assert d == c; + assert e == a; + assert b == 0; + assert c == 0; // error + } + + method n() + requires acc(x); + { + x := 0; + const y [acc(x), rd(x) && x == old(x) + 1 && y == x]; + assert y == 1; + const v [rd(x), rd(x) && v == old(x) + 1]; + assert v == 2; + const z [z == 1]; + ghost var t [z == 1, true]; + assert false; // reachable + } + + method o() + { + var z [acc(x) && z == 0]; // unimplementable + x := z; + assert x == 0; + assert false; // reachable + } +} |