feat: elaboration with empty tactic sequences#9524
Draft
kmill wants to merge 3 commits intoleanprover:masterfrom
Draft
feat: elaboration with empty tactic sequences#9524kmill wants to merge 3 commits intoleanprover:masterfrom
kmill wants to merge 3 commits intoleanprover:masterfrom
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This was referenced Mar 31, 2026
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.
This PR changes the parsing of empty tactic sequences so that they report a parse error but still elaborate. For example, in
there are parse errors after each
=>for not having complete tactic sequences, but both show the tactic state for that particular case. The syntaxes for many tactics have also been changed to require that the tactic sequence be strictly indented. The motivation for this is that, without strict indentation, the above example would parse with the secondcasenested under the first one. Theinductionandcasestactics were modified in #7830 in anticipation of this change; one can writeinduction p with | _ x ywithout the=>if the succeeding tactics stay at the same indentation level.Implementation note: The orelse parser needed some additional logic to handle error recovery. Recall that in
p <|> q, ifpparses an antiquotation, thenqis tentatively parsed as well to see if it parses a longer antiquotation. Now, ifqdoes error recovery andpparses an antiquotation,pis preferred.Todo: add
else ifto theiftactic.This works toward issue #3555. This PR is an experiment to see if having parse errors is more useful than distracting, given that they do not keep the tactic proof from elaborating.