The matches returned by the lazy discriminator tree are partially constrained by a priority, but ties are broken by the order in which keys are traversed and the order of declarations. This PR changes the match key traversal to use an explicit stack rather than recursion and implicitly changes the order in which results are returned to favor left-matches first e.g., given the term `f a b` with constants `f a b`, and a tree with patterns `f a x -> 1` `f x b -> 2` that have the same priority, this will return `#[1, 2]` since the early matches for the key `a` are returned before the match for `x` which has a star. This appears to address the [lower quality results mentioned on zulip](https://leanprover.zulipchat.com/#narrow/stream/428973-nightly-testing/topic/Mathlib.20status.20updates/near/429955747). |
||
|---|---|---|
| .. | ||
| bench | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lean-toolchain | ||