-
Notifications
You must be signed in to change notification settings - Fork 350
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
fix: make sure refine
preserves pre-existing natural mvars
#2435
Merged
Conversation
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
* don't exclude pre-existing natural mvars
Thanks for your contribution! Please make sure to follow our Commit Convention. |
1 task
* also deleted superfluous `add_synthetic_goal`
semorrison
reviewed
Aug 23, 2023
semorrison
reviewed
Aug 23, 2023
Co-authored-by: Scott Morrison <scott@tqft.net>
semorrison
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.
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.
refine
currently fails to include pre-existing natural metavariables from the refined term in the resulting goal list. For example,constructor
creates natural metavariables, and we can close the goals withrefine
alone:The source of this issue is a bug in
withCollectingNewGoalsFrom
inelabTermWithHoles
whenallowNaturalHoles
isfalse
. 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.