-
Notifications
You must be signed in to change notification settings - Fork 444
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: push/pop tactic API #5720
Merged
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
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Oct 15, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 15, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 15, 2024
leanprover-community-bot
added
the
builds-mathlib
CI has verified that Mathlib builds against this PR
label
Oct 15, 2024
Mathlib CI status (docs):
|
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 15, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 15, 2024
leanprover-community-bot
added
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
builds-mathlib
CI has verified that Mathlib builds against this PR
and removed
builds-mathlib
CI has verified that Mathlib builds against this PR
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
labels
Oct 15, 2024
kim-em
reviewed
Oct 15, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 16, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 16, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Oct 16, 2024
Adds `pushGoal`/`pushGoals` and `popGoal` for manipulating the goal state. These are an alternative to `replaceMainGoal` and `getMainGoal`, but without needing to reason about goal lists that still contain unassigned metavariables. Modifies `closeMainGoalUsing`. Now the callback is run in a context where the main goal is not present in the goal list. Furthermore, the `checkUnassigned` argument has been replaced with `checkNewUnassigned`, which checks whether the value assigned to the goal has any *new* metavariables, relative to the start of execution of the callback. This is sufficient for the `exact` tactic.
Co-authored-by: Kim Morrison <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
builds-mathlib
CI has verified that Mathlib builds against this PR
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
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.
Adds
pushGoal
/pushGoals
andpopGoal
for manipulating the goal state. These are an alternative toreplaceMainGoal
andgetMainGoal
, and with them you don't need to worry about making sure nothing clears assigned metavariables from the goal list between assigning the main goal and usingreplaceMainGoal
.Modifies
closeMainGoalUsing
, which is like aTacticM
version ofliftMetaTactic
. Now the callback is run in a context where the main goal is removed from the goal list, and the callback is free to modify the goal list. Furthermore, thecheckUnassigned
argument has been replaced withcheckNewUnassigned
, which checks whether the value assigned to the goal has any new metavariables, relative to the start of execution of the callback. This API is sufficient for theexact
tactic for example.Modifies
withCollectingNewGoalsFrom
to take theparentTag
argument explicitly rather than indirectly viagetMainTag
. This is needed when used undercloseMainGoalUsing
.Modifies
elabTermWithHoles
to optionally takeparentTag?
. It defaults togetMainTag
if it isnone
.Renames
Tactic.tryCatch
toTactic.tryCatchRestore
, and adds aTactic.tryCatch
that doesn't do backtracking.