getStarLemmas lists the current module's star-indexed lemmas once more after each library search
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
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend-api-design
Direzione di ricerca
Read createModuleTreeRef in src/Lean/Meta/LazyDiscrTree.lean and libSearchFindDecls in src/Lean/Meta/Tactic/LibrarySearch.lean, then run the supplied Star.lean reproduction. Trace how current-module dropped entries are added to starLemmasExt across repeated searches; done when my_star_lemma appears once after three searches and the regression is covered.
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. I tested 4.34.1 and 4.35.0. The code involved is unchanged on
master(createModuleTreeRefinsrc/Lean/Meta/LazyDiscrTree.lean, andlibSearchFindDeclsinsrc/Lean/Meta/Tactic/LibrarySearch.lean). - When reporting a perceived soundness bug: not a soundness bug.
Description
getStarLemmas lists each of the current module's star-indexed lemmas once more after every library search in the same process. After three searches, a lemma of the current module is listed three times, so the last-resort pass of exact? and apply? tries it three times.
libSearchFindDecls passes the process-wide starLemmasExt to findMatches as droppedEntriesRef. findMatches builds a new tree of the current module on every call (createModuleTreeRef). Each time, createModuleTreeRef appends that module's dropped entries to the ref, after what's already there. The imported part is appended only once, when the imported tree is first made, so only the current module's part repeats.
Context
Found while comparing a program's own use of LazyDiscrTree with libSearchFindDecls and getStarLemmas, on goals in one file.
Steps to Reproduce
- Save this as
Star.lean:
import Lean
open Lean Meta LibrarySearch
theorem my_star_lemma {α : Prop} (h : α) : α := h
#eval show MetaM Unit from do
let _ ← libSearchFindDecls (mkConst ``True)
let a ← getStarLemmas
let _ ← libSearchFindDecls (mkConst ``True)
let _ ← libSearchFindDecls (mkConst ``True)
let b ← getStarLemmas
let count (xs : Array (Name × DeclMod)) := (xs.filter (·.1 == ``my_star_lemma)).size
IO.println s!"after 1 search: {a.size} star lemmas, my_star_lemma {count a} times"
IO.println s!"after 3 searches: {b.size} star lemmas, my_star_lemma {count b} times"
- Run
lean Star.lean.
Expected behavior: my_star_lemma is listed once, however many searches ran before.
Actual behavior:
after 1 search: 1660 star lemmas, my_star_lemma 1 times
after 3 searches: 1662 star lemmas, my_star_lemma 3 times
On 4.35.0, the counts are 1673 and 1675, again with my_star_lemma listed 1 and 3 times.
Versions
- Lean (version 4.34.1, aarch64-unknown-linux-gnu, commit 5045d0056413266e57c625dcd7c365b10e377c52, Release)
- Lean (version 4.35.0, aarch64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release)
- Linux, aarch64
Additional Information
starLemmasExt lives as long as the process, so the list grows with every search the process makes: each exact? or apply? in one file adds that file's star-indexed lemmas again.
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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Upgrade Django to 5.2.18Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
blacklanternsecurity/bbot#3678 ·
I maintainer di solito rispondono entro 2 giorni
-
A failed hydrate call can be dropped when the row's wait is ready tooForse già presa @turbot-agent-fleet l’ha presa oggi. Apertaagent:ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
turbot/steampipe-plugin-sdk#1018 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
router-for-me/CLIProxyAPI#7976 ·
I maintainer di solito rispondono entro 1 giorno