-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad inference of default calc operator causes crash #3962
Labels
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Comments
RustanLeino
added
the
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
label
May 5, 2023
RustanLeino
added a commit
to RustanLeino/dafny
that referenced
this issue
May 5, 2023
RustanLeino
added a commit
to RustanLeino/dafny
that referenced
this issue
May 5, 2023
RustanLeino
added a commit
that referenced
this issue
May 9, 2023
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dafny version
4.0.0
Code to produce this issue
Command to run and resulting output
What happened?
When a
calc
statement does not explicitly give a default operator, Dafny picks one. It usually picks==
, but in the 8 cases shown above (which start or end with the literalfalse
,true
, or{}
), Dafny considers the candidate==>
for the first two,<==
for the next two,<=
for the next two, and>=
for the final two.Dafny 4.0 then picks that candidate operator as the
calc
statement's default operator. In the examples above, the candidate operator is in conflict with the given step operators (for example,==>
is not allowed to be chained with<==
), which causes a crash.The right thing to do is to discard the candidate operator if it would lead to such conflicts (and instead pick
==
as usual in those cases).What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: