exact? and apply? throw "maximum recursion depth has been reached" when large Nat constants are involved
Open
Nobody has claimed this yet.
bug
P-medium
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Description
Consider the MWE (link to playground)
/-
[reduction] unfolded declarations (max: 283, num: 7): ▼
[] LE.le ↦ 283
[] Nat.rec ↦ 131
[] Nat.pred ↦ 125
[] Nat.sub ↦ 125
[] Not ↦ 78
[] LT.lt ↦ 78
[] Nat.lt ↦ 78
-/
set_option diagnostics true
def help (x : Nat) : x ≤ 125 := by
apply? -- maximum recursion depth exceeded.
exact?
It's not clear what the right behaviour ought to be, I suppose that Lean is trying to unfold the definition of Nat.le.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the linked playground MWE with diagnostics enabled, focusing on apply? and exact? for the large Nat constant. Read the reported unfolding trace for Nat.le, Nat.rec, Nat.pred, and Nat.sub; the issue is done only when the expected recursion behavior is agreed and the maximum-depth failure is addressed or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100