fix: collapse empty DiscrTree tries - #14844
Merged
Merged
Conversation
|
The adaptation PR for this PR is leanprover/downstream-lean4#24. |
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
robsimmons
force-pushed
the
trie-map-collapse
branch
2 times, most recently
from
August 19, 2026 18:25
e7c48a9 to
7f1f72b
Compare
Contributor
Author
|
!bench |
|
Benchmark results for 7b84a7f against 7976735 are in. No significant results found. @robsimmons
Small changes (2✅, 1🟥)
|
robsimmons
force-pushed
the
trie-map-collapse
branch
2 times, most recently
from
August 19, 2026 19:33
f1ca8f9 to
c84b5e1
Compare
Contributor
Author
|
!bench |
|
Benchmark results for c84b5e1 against 7976735 are in. No significant results found. @robsimmons
Small changes (3✅)
|
robsimmons
force-pushed
the
trie-map-collapse
branch
from
August 20, 2026 12:45
a2d16ea to
020ac29
Compare
robsimmons
marked this pull request as ready for review
August 20, 2026 12:53
Contributor
Author
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@6926656 against leanprover-community/mathlib4-nightly-testing@5a95bed are in. No significant results found. @robsimmons
Small changes (1✅, 2🟥)
|
nomeata
approved these changes
Aug 20, 2026
robsimmons
force-pushed
the
trie-map-collapse
branch
from
August 21, 2026 00:35
020ac29 to
9bd1c68
Compare
robsimmons
force-pushed
the
trie-map-collapse
branch
from
August 21, 2026 02:46
9bd1c68 to
1be6c1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR ensures that
DiscrTreeoperations collapse any trie nodes that end up empty.This change allows
mapArraysMto properly implement Aesop's filterDiscrTreeM in the downstream adaptation PR, which also deprecatesTrie.isEmptyTriein favor of the now-upstreamedTrie.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 #14805.