This PR introduces a fast pattern matching and unification module for the symbolic simulation framework (`Sym`). The design prioritizes performance by using a two-phase approach: **Phase 1 (Syntactic Matching)** - Patterns use de Bruijn indices for expression variables and renamed level params (`_uvar.0`, `_uvar.1`, ...) for universe variables - Matching is purely structural after reducible definitions are unfolded during preprocessing - Universe levels treat `max` and `imax` as uninterpreted functions (no AC reasoning) - Binders and term metavariables are deferred to Phase 2 **Phase 2 (Pending Constraints)** [WIP] - Handles binders (Miller patterns) and metavariable unification - Converts remaining de Bruijn variables to metavariables - Falls back to `isDefEq` when necessary **Key design decisions:** - Preprocessing unfolds reducible definitions and performs beta/zeta reduction - Kernel projections are expected to be folded as projection applications before matching - Assignment conflicts are deferred to pending rather than invoking `isDefEq` inline - `instantiateRevS` ensures maximal sharing of result expressions **TODO:** - Skip instance arguments during matching, synthesize later - Skip proof arguments (proof irrelevance) - Implement `processPending` for Phase 2 constraints |
||
|---|---|---|
| .. | ||
| bench | ||
| bench-radar | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lake | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lakefile.toml | ||
| lean-toolchain | ||