Skip to content

fix: erroneous "no goals" in empty tactic list in induction/cases and other tactic info improvements - #9553

Merged
kmill merged 9 commits into
leanprover:masterfrom
kmill:kmill_7830_regression
Jul 26, 2025
Merged

kmill merged 9 commits into
leanprover:masterfrom
kmill:kmill_7830_regression

Conversation

@kmill

@kmill kmill commented Jul 25, 2025 •

Copy link
Copy Markdown
Collaborator

This PR fixes a bug introduced in #7830 where if the cursor is at the indicated position

example (as bs : List Nat) : (as.append bs).length = as.length + bs.length := by
  induction as with
  | nil => -- cursor
  | cons b bs ih =>

then the Infoview would show "no goals" rather than the nil goal. The PR also fixes a separate bug where placing the cursor on the next line after the induction/cases tactics like in

  induction as with
  | nil => sorry
  | cons b bs ih => sorry
  I -- < cursor

would report the original goal in the goal list. Furthermore, there are numerous improvements to error recovery (including allGoals-type logic for pre-tactics) and the visible tactic states when there are errors. Adds Tactic.throwOrLogErrorAt/Tactic.throwOrLogError for throwing or logging errors depending on the recovery state.

This PR fixes a bug introduced in leanprover#7830 where if the cursor is at the indicated position
```lean
example (as bs : List Nat) : (as.append bs).length = as.length + bs.length := by
  induction as with
  | nil => -- cursor
  | cons b bs ih =>
```
then the Infoview would show "no goals".
@kmill
kmill requested a review from kim-em as a code owner July 25, 2025 19:13
@kmill kmill added the changelog-language Language features and metaprograms label Jul 25, 2025
@kmill
kmill enabled auto-merge July 25, 2025 19:23
@kmill
kmill disabled auto-merge July 25, 2025 19:33
@kmill
kmill enabled auto-merge July 25, 2025 19:45
@kmill
kmill marked this pull request as draft July 25, 2025 20:36
auto-merge was automatically disabled July 25, 2025 20:36

Pull request was converted to draft

@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 25, 2025
@ghost

ghost commented Jul 25, 2025 •

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 7f39e56a7943ac4cb02647c255a3d51cfcebaa0d --onto 73422d52fd61c3d5bce6f5edb53c6bd698b1b7ba. You can force Mathlib CI using the force-mathlib-ci label. (2025-07-25 21:19:40)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 8ce0e045a87ef1259a078eadfce2f81e53706da0 --onto 73422d52fd61c3d5bce6f5edb53c6bd698b1b7ba. You can force Mathlib CI using the force-mathlib-ci label. (2025-07-26 22:05:39)

@leanprover-bot

leanprover-bot commented Jul 25, 2025 •

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 7f39e56a7943ac4cb02647c255a3d51cfcebaa0d --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-07-25 21:19:41)
  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 8ce0e045a87ef1259a078eadfce2f81e53706da0 --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-07-26 22:05:41)

@kmill kmill changed the title fix: erroneous "no goals" in empty tactic list in induction fix: erroneous "no goals" in empty tactic list in induction/cases and other tactic info improvements Jul 26, 2025
@kmill
kmill marked this pull request as ready for review July 26, 2025 23:11
@kmill
kmill enabled auto-merge July 26, 2025 23:15
@kmill
kmill added this pull request to the merge queue Jul 26, 2025
Merged via the queue into leanprover:master with commit 5d54b0b Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants