Skip to content

fix: let try? continue after maxRecDepth#13838

Closed
raphael-solace wants to merge 1 commit into
leanprover:masterfrom
raphael-solace:rc/try-catch-max-rec-depth
Closed

fix: let try? continue after maxRecDepth#13838
raphael-solace wants to merge 1 commit into
leanprover:masterfrom
raphael-solace:rc/try-catch-max-rec-depth

Conversation

@raphael-solace
Copy link
Copy Markdown

@raphael-solace raphael-solace commented May 25, 2026

This PR lets try? continue evaluating other candidate branches when one branch hits Lean's recursion-depth resource limit.

try? already converts heartbeat exhaustion into an ordinary branch failure. This applies the same treatment to maxRecDepth, so an expensive simp/simp_all candidate does not suppress a useful grind suggestion.

Closes #13216.

@raphael-solace raphael-solace requested a review from kim-em as a code owner May 25, 2026 12:17
@raphael-solace
Copy link
Copy Markdown
Author

changelog-tactics

@github-actions github-actions Bot added the changelog-tactics User facing tactics label May 25, 2026
-/
#guard_msgs (substring := true) in
example (f : Nat → Nat) (x : Nat) (h : x = f x) : x = f (f x) := by
try?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this test more reliable by using try? => and a tactic that definitely triggers or explicitly throws maxrecdepth

@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 May 25, 2026
@mathlib-lean-pr-testing
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 7f13a8988f0018f404d4bb0954f95122b8855084 --onto 2cd98639c40d2d2a026dd599093b70f55f55ffaf. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-25 13:08:18)

@leanprover-bot
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 7f13a8988f0018f404d4bb0954f95122b8855084 --onto 803553a556fd82fa1060efb0c43eda542130cb16. You can force reference manual CI using the force-manual-ci label. (2026-05-25 13:08:19)

@Kha Kha closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics 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.

try? errors because simp errors

4 participants