diff options
author | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-07-31 15:01:02 +0200 |
---|---|---|
committer | Nadia Polikarpova <nadia.polikarpova@gmail.com> | 2013-07-31 15:01:02 +0200 |
commit | 6c7d4a409f3ced78bd1d15c9743bb357c46320fa (patch) | |
tree | c0abb4b38761faac61d43ecd31e43c277edc38ad /Test/dafny0/Calculations.dfy | |
parent | 97404d89e5c945d41899ed74e5aa234a61b91c65 (diff) |
Allowing dangling hints in calculations.
Diffstat (limited to 'Test/dafny0/Calculations.dfy')
-rw-r--r-- | Test/dafny0/Calculations.dfy | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Test/dafny0/Calculations.dfy b/Test/dafny0/Calculations.dfy index 54a9a3d4..59191ac3 100644 --- a/Test/dafny0/Calculations.dfy +++ b/Test/dafny0/Calculations.dfy @@ -60,4 +60,23 @@ function CalcTest3(s: seq<int>): int { |s|; } s[0] -}
\ No newline at end of file +} + +// dangling hints: +method CalcTest4(s: seq<int>) + requires forall n | n in s :: n > 0; +{ + calc { + 1 + 1; + { assert 1 + 1 == 2; } + } + calc { + 2; + { assert s[0] > 0; } // error: ill-formed hint + } + calc { + |s| > 0; + ==> { assert s[0] > 0; } // okay + } + +} |