Kernel deep recursion on `Eq.refl` for a projection of a nested structure literal with a `BitVec` subtraction
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- compilers
Direzione di ricerca
Start by checking the provided standalone Lean reproducer in the current kernel, then compare the failing bad theorem with okOneLayer, okLiteral, and okAxiom to isolate which reduction path triggers deep recursion. The issue names no implementation files or test paths, so locate the kernel code and regression test for projection reduction. Done when the kernel accepts bad while preserving the expected results for the other examples.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”) - When reporting a perceived soundness bug: Does it affect
lake check --paranoid?
If in doubt, please reach out on [email protected] for responsible disclosure.
Description
The kernel reports deep recursion when it checks Eq.refl for a projection out of a nested structure literal whose BitVec 16 field is the subtraction 2#16 - 1#16. The projected field does not depend on that subtraction.
Context
vcgen produces such Eq.refl proofs when it reduces a projection of a state record whose register field holds a - 1#64 with a := 2#64.
Steps to Reproduce
- Check this file, which needs no imports:
structure R where
x : BitVec 16
y : Nat
structure S where
r : R
n : Nat
theorem bad (t : S) : (S.mk (R.mk (2#16 - 1#16) t.r.y) t.n).r.y = t.r.y := Eq.refl t.r.y
theorem okOneLayer (t : R) : (R.mk (2#16 - 1#16) t.y).y = t.y := Eq.refl t.y
theorem okLiteral (t : S) : (S.mk (R.mk 1#16 t.r.y) t.n).r.y = t.r.y := Eq.refl t.r.y
axiom tAx : S
theorem okAxiom : (S.mk (R.mk (2#16 - 1#16) tAx.r.y) tAx.n).r.y = tAx.r.y := Eq.refl tAx.r.y
Expected behavior: The kernel accepts all four theorems.
Actual behavior: The kernel rejects bad:
error: (kernel) deep recursion detected, use `set_option maxRecDepth <num>` to increase the limit
It accepts okOneLayer (one structure layer), okLiteral (1#16 in place of 2#16 - 1#16) and okAxiom (an axiom in place of the variable t).
Versions
Lean (version 4.37.0-nightly-2026-11-06, x86_64-unknown-linux-gnu, commit d4cada4c0c02734da4a3a00dac27faa8ca2b912b, Release)
Linux 7.3.1
Additional Information
bad passes on v4.32.2 and fails on v4.34.1.
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
- Lingua principale
- Lean
- Stelle
- 10.3k
- Fork
- 1.1k
- Merge medio
- 19h 8m
- PR unite (30g)
- 421
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di leanprover/lean4
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16681 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
leanprover/lean4#16305 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
leanprover/lean4#16299 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16257 ·
I maintainer di solito rispondono entro 1 giorno
-
`IO.FS.realPath` reports every failure as `noFileOrDirectory` instead of classifying by `errno`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
leanprover/lean4#15683 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di leanprover/lean4
Issue simili
-
bug fixed form parser medium priority tokenizer
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
swc-project/swc-next-issues#817 ·
-
Magma mode: div:=, mod:= and the other keyword assignments (join:=, meet:=, diff:=, sdiff:=, and:=, or:=, xor:=) are refusedForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sagemathinc/sagebrush#1683 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
microts: a model local that every branch assigns raises unused_assignments in the generated RustApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
pocket-stack/pocketjs#756 ·