Skip to content

feat: eta_reduce_fun% in cdot parser, v2#2267

Open
digama0 wants to merge 3 commits intoleanprover:masterfrom
digama0:eta2
Open

feat: eta_reduce_fun% in cdot parser, v2#2267
digama0 wants to merge 3 commits intoleanprover:masterfrom
digama0:eta2

Conversation

@digama0
Copy link
Copy Markdown
Collaborator

@digama0 digama0 commented Jun 10, 2023

Alternative version of #2263 .

This modifies the desugaring for the cdot parser to apply eta-reduction to the resulting term if possible. So (· + ·) elaborates to HAdd.hAdd instead of fun x y => HAdd.hAdd x y.

This is complicated by the fact that metavariables generally capture all variables in scope, meaning that (· + ·) of unknown type elaborates to something like fun x y => @HAdd.hAdd (?m1 x y) (?m2 x y) x y, which is not an eta redex. To reliably eta reduce the expression, we introduce a new SyntheticMVarKind, similar to how coercions are handled. This is simpler (less code) and a bit more robust than #2263, but there are relatively few SyntheticMVarKinds so this might be considered a more disruptive change than simply adding another auxiliary term elaborator.

@leodemoura leodemoura added the awaiting-author Waiting for PR author to address issues label Jun 21, 2023
@github-actions github-actions bot added the stale label Oct 20, 2023
@github-actions github-actions bot removed the stale label Nov 2, 2023
@Kha Kha requested review from Kha and leodemoura as code owners November 20, 2023 08:15
@github-actions github-actions bot added the stale label Dec 21, 2023
@github-actions github-actions bot removed the stale label Feb 10, 2024
@github-actions github-actions bot added the stale label May 6, 2024
@github-actions github-actions bot removed the stale label May 31, 2024
@github-actions github-actions bot added stale and removed stale labels Jun 30, 2024
@github-actions github-actions bot added the stale label Aug 21, 2024
@github-actions github-actions bot removed the stale label Sep 7, 2024
@github-actions github-actions bot added the stale label Dec 23, 2024
@github-actions github-actions bot removed the stale label Jun 7, 2025
@github-actions github-actions bot added the stale label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Waiting for PR author to address issues low priority stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants