Skip to content

[#14844] fix: collapse empty DiscrTree tries - #24

Merged
downstream-lean4[bot] merged 12 commits into
masterfrom
adaptation-14844
Aug 22, 2026
Merged

[#14844] fix: collapse empty DiscrTree tries#24
downstream-lean4[bot] merged 12 commits into
masterfrom
adaptation-14844

Conversation

@downstream-lean4

Copy link
Copy Markdown
Contributor

This is the adaptation PR for leanprover/lean4#14844.

@downstream-lean4 downstream-lean4 Bot added the adaptation This is an adaptation PR for a PR in the lean4 repository. label Aug 19, 2026
@downstream-lean4

downstream-lean4 Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Build report for downstream: undo overrides

Turned red:

Repo Critical Build Test Lint
aesop 🟥 in 1s ⏭️ ⏭️
mathlib4 ⏭️ ⏭️ ⏭️
cslib ⏭️ ⏭️ ⏭️
repl ✅ in 1s 🟥 in 29s ⏭️
Stayed green
Repo Critical Build Test Lint
batteries ✅ in 5s ✅ in 4s ✅ in 2s
import-graph ✅ in 2s ✅ in 4s ⏭️
lean4-cli ✅ in 1s ✅ in 0s ⏭️
plausible ✅ in 1s ✅ in 2s ⏭️
ProofWidgets4 ✅ in 3s ✅ in 1s ⏭️
quote4 ✅ in 2s ✅ in 1s ⏭️
reference-manual ✅ in 16s ⏭️ ⏭️
BibtexQuery ✅ in 1s ⏭️ ⏭️
comparator ✅ in 2s ⏭️ ⏭️
doc-gen4 ✅ in 3s ⏭️ ⏭️
illuminate ✅ in 4s ✅ in 11s ⏭️
lean4-unicode-basic ✅ in 2s ⏭️ ⏭️
lean4export ✅ in 0s ✅ in 7s ⏭️
LeanSearchClient ✅ in 1s ✅ in 0s ⏭️
leansqlite ✅ in 4s ✅ in 18s ⏭️
verso ✅ in 26s ✅ in 93s ⏭️
verso-slides ✅ in 30s ✅ in 7s ⏭️
verso-web-components ✅ in 10s ⏭️ ⏭️

View run

downstream-lean4 Bot and others added 9 commits August 20, 2026 23:54
downstream-repo: batteries
downstream-url: https://github.com/leanprover-community/batteries
downstream-rev: nightly-testing
downstream-sha: 6f9327fde05a7b7f8475971a11d8dae0d38d7eb5
downstream-repo: mathlib4
downstream-url: https://github.com/leanprover-community/mathlib4-nightly-testing
downstream-rev: nightly-testing
downstream-sha: b878dd3f7ab9bf9046ef1c1dac56d94b8b29c9c4
downstream-repo: verso
downstream-url: https://github.com/leanprover/verso
downstream-rev: nightly-testing
downstream-sha: ad4748a221f2ad0491b1045e7ca1dc25dcfa6eb0
FawadHa1der pushed a commit to FawadHa1der/lean4 that referenced this pull request Aug 21, 2026
This PR ensures that `DiscrTree` operations collapse any trie nodes that
end up empty.

This change allows `mapArraysM` to properly implement Aesop's
filterDiscrTreeM in the [downstream adaptation
PR](leanprover/downstream-lean4#24), which also
deprecates `Trie.isEmptyTrie` in favor of the now-upstreamed
`Trie.isEmptyNode`. Following Aesop's lead, this PR also adds
@[specialize] annotations to the recursive portion of for mapArraysM and
to the similarly-patterned foldM and foldValuesM.

Three new test files provide coverage of these and other DiscrTree
operations. This PR (and the tests) are intended to lay groundwork for
leanprover#14805.
@downstream-lean4
downstream-lean4 Bot merged commit 5ab7d3c into master Aug 22, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adaptation This is an adaptation PR for a PR in the lean4 repository. cache-available toolchain-available

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant