diff options
author | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-02-15 17:07:57 -0800 |
---|---|---|
committer | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-02-15 17:07:57 -0800 |
commit | 5c5d0318c70d53eb8b287b07edfce96b6888a540 (patch) | |
tree | 8f8673d8201258232ee5074e3411dc8a1f642570 /Test/dafny0/Calculations.dfy | |
parent | 79d90df7412bf52276280bf82b478dc11cd8b0ed (diff) |
Added tests: parallel calc, better well-formedness checks, calc expression.
Diffstat (limited to 'Test/dafny0/Calculations.dfy')
-rw-r--r-- | Test/dafny0/Calculations.dfy | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Test/dafny0/Calculations.dfy b/Test/dafny0/Calculations.dfy index 80775896..aa447d9f 100644 --- a/Test/dafny0/Calculations.dfy +++ b/Test/dafny0/Calculations.dfy @@ -16,6 +16,12 @@ method CalcTest0(s: seq<int>) { s[0]; } } + assume forall x :: x in s ==> x >= 0; + calc ==> { + 0 < |s|; + { assert s[0] >= 0; } // OK: well-formed after previous line + s[0] >= 0; // OK: well-formed after previous line + } } method CalcTest1(x: int, y: int) { @@ -34,4 +40,14 @@ method CalcTest2(x: int, y: int) { y + x; } assert x == 0; // error: even though assumed above, is not exported by the calculation +} + +// calc expression: +function CalcTest(s: seq<int>): int { + calc < { + 0; + { assume |s| == 5; } + |s|; + } + s[0] }
\ No newline at end of file |