-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Select alternative default calc operator more carefully (#3963)
Fixes #3962 <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --------- Co-authored-by: Remy Willems <[email protected]>
- Loading branch information
1 parent
e803796
commit bd2d4ec
Showing
5 changed files
with
96 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: %exits-with 4 %dafny /printTooltips "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method Issues(a: bool, s: set) { | ||
// Each one of the following 8 calc statements used to cause a crash | ||
|
||
if | ||
case true => | ||
calc { a; <== false; } | ||
case true => | ||
calc { true; <== a; } | ||
case true => | ||
calc { a; ==> true; } | ||
case true => | ||
calc { false; ==> a; } | ||
|
||
case true => | ||
calc { s; >= ({}); } | ||
case true => | ||
calc { s; > ({}); } // error: cannot prove calc step | ||
case true => | ||
calc { {}; <= s; } | ||
case true => | ||
calc { {}; < s; } // error: cannot prove calc step | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
git-issue-3962.dfy(9,4): Info: == | ||
git-issue-3962.dfy(11,4): Info: == | ||
git-issue-3962.dfy(13,4): Info: == | ||
git-issue-3962.dfy(15,4): Info: == | ||
git-issue-3962.dfy(18,4): Info: == | ||
git-issue-3962.dfy(20,4): Info: == | ||
git-issue-3962.dfy(22,4): Info: == | ||
git-issue-3962.dfy(24,4): Info: == | ||
git-issue-3962.dfy(20,16): Error: the calculation step between the previous line and this line might not hold | ||
git-issue-3962.dfy(24,17): Error: the calculation step between the previous line and this line might not hold | ||
|
||
Dafny program verifier finished with 0 verified, 2 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Select alternative default calc operator only if it doesn't clash with given step operators |