-
Notifications
You must be signed in to change notification settings - Fork 262
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
Implement a proof-by-contradiction attribute #5001
Conversation
Allows a particular assertion to be marked as an intentional proof by contradiction, preventing `--warn-contradictory-assumptions` from flagging it. Fixes dafny-lang#4778
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting and useful. Could you perhaps do two things:
- When you report "proved by contradictory assumptions", could you also mention this
{:contradiction}
attribute so that it's easy to discover? - Add one more line in docs/dev/news about that new attribute
- Add a line about the documentation of this new attributes in docs/DafnyRef/Attributes.md
Could you document the attribute in the help of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! This is a good answer to the problem of being able to assert intermediate steps when the hypotheses already contradict.
I note that it won't help for preconditions in lemmas though, correct?
Are you thinking of the use case of trying to show that
If that's what you mean, then no, this PR doesn't support that use case. Perhaps it would be possible to allow the same attribute on an |
Description
Allows a particular assertion to be marked as an intentional proof by contradiction, preventing
--warn-contradictory-assumptions
from flagging it.Fixes #4778
How has this been tested?
Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-4778.dfy
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.