Skip to content

fix: eta-reduce expressions in sym discrimination tree lookup#12920

Merged
leodemoura merged 1 commit intomasterfrom
sym_bugs
Mar 14, 2026
Merged

fix: eta-reduce expressions in sym discrimination tree lookup#12920
leodemoura merged 1 commit intomasterfrom
sym_bugs

Conversation

@leodemoura
Copy link
Copy Markdown
Member

This PR adds eta reduction to the sym discrimination tree lookup functions (getMatch, getMatchWithExtra, getMatchLoop). Without this, expressions like StateM Nat that unfold to eta-expanded forms (fun α => StateT Nat Id α) fail to match discrimination tree entries for the eta-reduced form (StateT Nat Id).

Also optimizes etaReduce with an early exit for non-lambda expressions and removes a redundant n == 0 check.
Includes a test verifying that P (StateM Nat) matches a disc tree entry for P (StateT Nat Id).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leodemoura leodemoura added the changelog-tactics User facing tactics label Mar 14, 2026
@leodemoura leodemoura enabled auto-merge March 14, 2026 16:48
@leodemoura leodemoura added this pull request to the merge queue Mar 14, 2026
Merged via the queue into master with commit 7120d9a Mar 14, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant