summaryrefslogtreecommitdiff
path: root/Test/dafny0/Calculations.dfy
diff options
context:
space:
mode:
authorGravatar Nadia Polikarpova <nadia.polikarpova@gmail.com>2013-03-15 10:49:10 +0100
committerGravatar Nadia Polikarpova <nadia.polikarpova@gmail.com>2013-03-15 10:49:10 +0100
commit3a8638d936454eebea874ff673b37999c8120906 (patch)
tree4029b3613cf672eb8c20b679fc6deb4a87499dda /Test/dafny0/Calculations.dfy
parent4a5e4856dced0a75c6e4bd47d861b7ed5eb8ee1a (diff)
Added explies support to calculations.
Diffstat (limited to 'Test/dafny0/Calculations.dfy')
-rw-r--r--Test/dafny0/Calculations.dfy8
1 files changed, 8 insertions, 0 deletions
diff --git a/Test/dafny0/Calculations.dfy b/Test/dafny0/Calculations.dfy
index 8ef36139..54a9a3d4 100644
--- a/Test/dafny0/Calculations.dfy
+++ b/Test/dafny0/Calculations.dfy
@@ -24,6 +24,14 @@ method CalcTest0(s: seq<int>) {
<==> { 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
}
+
+ calc { // same as the last one, but well-formedness is checked in reverse order
+ s[0] + 1 > 0;
+ <==>
+ s[0] >= 0;
+ <== { assert s[0] >= 0; }
+ 0 < |s|;
+ }
}
method CalcTest1(x: int, y: int) {