Skip to content
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

Feat code actions forall calc #6044

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MikaelMayer
Copy link
Member

@MikaelMayer MikaelMayer commented Jan 11, 2025

What was changed?

First, for implicit assertions, if they are surrounded by a declaration that supports by clause (like AssertStmt or CallStmt), the by clause is preferred to inserting the assertion before.
InsertVarByStatement
And that works also for well-formedness, since well-formedness is now proved by by-blocks (thanks @keyboardDrummer for that, and @alex-chew for creating Dafny expressions for well-formedness)
InsertAssertByPreconditionStatement
Moreover, if a by clause already exist, the code action will insert into it.
InsertAssertExistingByPreconditionStatement

Second, assertion of foralls now support a proof sketch by inserting forall statement
InsertForallStatement

Third, assertions of equalities or equivalence now support a proof sketch by inserting a calc statement.
InsertCalcStatement
InsertCalcEquivStatement

The code for inserting such proof sketches has been refactored so that it will be even more easy to extend in the future.

How has this been tested?

  • Tests were updated for the insertion point (var....by) when possible and insert there if it already exist.
  • Tests were added for foralls, equalities and equivalences, and also new insertion points

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@MikaelMayer MikaelMayer enabled auto-merge (squash) January 15, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant