This PR optimizes congruence proof construction in `Sym.simp` by avoiding `inferType` calls on expressions that are less likely to be cached. Instead of inferring types of expressions like `@HAdd.hAdd Nat Nat Nat instAdd 5`, we infer the type of the function prefix `@HAdd.hAdd Nat Nat Nat instAdd` and traverse the forall telescope. The key insight is that function prefixes are more likely shared across many call sites (e.g., all `Nat` additions use the same `@HAdd.hAdd Nat Nat Nat instAdd`), so they benefit from `inferType` caching. Benchmark results show improvements on workloads with shared function prefixes: - `many_rewrites_5000`: 48.8ms → 43.1ms (-12%) - `term_tree_5000`: 53.4ms → 30.5ms (-43%) |
||
|---|---|---|
| .. | ||
| meta_simp_1.lean | ||
| meta_simp_2.lean | ||
| meta_simp_4.lean | ||
| simp_1.lean | ||
| simp_2.lean | ||
| simp_3.lean | ||
| simp_4.lean | ||