diff options
author | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-03-05 20:25:47 +0100 |
---|---|---|
committer | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-03-05 20:25:47 +0100 |
commit | d584ab2b4240b58cd4ef59e53b970a05d8d13f79 (patch) | |
tree | 126f65115762afdf1f7469c32dd71a391038d616 /Test/dafny0/Calculations.dfy | |
parent | cd750d09580f78b709b118efa5ac585b90a37bfe (diff) |
New well-formedness checks for calculations (no cascading).
Diffstat (limited to 'Test/dafny0/Calculations.dfy')
-rw-r--r-- | Test/dafny0/Calculations.dfy | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Test/dafny0/Calculations.dfy b/Test/dafny0/Calculations.dfy index aa447d9f..8ef36139 100644 --- a/Test/dafny0/Calculations.dfy +++ b/Test/dafny0/Calculations.dfy @@ -17,10 +17,12 @@ method CalcTest0(s: seq<int>) { } } assume forall x :: x in s ==> x >= 0; - calc ==> { + calc { 0 < |s|; - { assert s[0] >= 0; } // OK: well-formed after previous line - s[0] >= 0; // OK: well-formed after previous line + ==> { assert s[0] >= 0; } // OK: well-formed after previous line + s[0] >= 0; // OK: well-formed after previous line + <==> { assert s[0] >= 0; } // OK: well-formed when the previous line is well-formed + s[0] > 0 || s[0] == 0; // OK: well-formed when the previous line is well-formed } } @@ -43,7 +45,7 @@ method CalcTest2(x: int, y: int) { } // calc expression: -function CalcTest(s: seq<int>): int { +function CalcTest3(s: seq<int>): int { calc < { 0; { assume |s| == 5; } |