fix: make sure refine preserves pre-existing natural mvars#2435
Merged
leodemoura merged 8 commits intoleanprover:masterfrom Aug 26, 2023
Merged
fix: make sure refine preserves pre-existing natural mvars#2435leodemoura merged 8 commits intoleanprover:masterfrom
refine preserves pre-existing natural mvars#2435leodemoura merged 8 commits intoleanprover:masterfrom
Conversation
* don't exclude pre-existing natural mvars
Contributor
|
Thanks for your contribution! Please make sure to follow our Commit Convention. |
1 task
* also deleted superfluous `add_synthetic_goal`
kim-em
reviewed
Aug 23, 2023
kim-em
reviewed
Aug 23, 2023
Co-authored-by: Scott Morrison <scott@tqft.net>
kim-em
approved these changes
Aug 24, 2023
This was referenced Aug 30, 2023
Merged
thorimur
added a commit
to thorimur/lean4
that referenced
this pull request
Aug 31, 2023
…leanprover#2435)" This reverts commit a7efe5b.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2434.
refinecurrently fails to include pre-existing natural metavariables from the refined term in the resulting goal list. For example,constructorcreates natural metavariables, and we can close the goals withrefinealone:The source of this issue is a bug in
withCollectingNewGoalsFrominelabTermWithHoleswhenallowNaturalHolesisfalse. Metavariables are separated into natural and non-natural, and then any new unassigned natural mvars (as determined by theirindex) cause the tactic to be aborted. If the tactic isn't aborted here, the non-natural mvars are passed through to constitute the new goal list. However, this orphans any pre-existing "old" natural mvars.This PR fixes this by changing the process of logging and aborting upon encountering new natural mvars into an
unless allowedNaturalHoles do ...-style guard. If we pass that guard, then we don't need to filter the original list of mvars at all; it's guaranteed to be free of new natural mvars, as required.