Skip to content

Add contextual rewrite-pattern selection#955

Open
strub wants to merge 1 commit intomainfrom
rw-pattern-ctxt
Open

Add contextual rewrite-pattern selection#955
strub wants to merge 1 commit intomainfrom
rw-pattern-ctxt

Conversation

@strub
Copy link
Copy Markdown
Member

@strub strub commented Mar 26, 2026

Allow rewrite patterns to designate a subterm inside a
larger context with the [x in pattern] syntax.

This lets rewrite target exactly the occurrence named by
the surrounding context, and adds regression coverage for
that form.

The context variable must appear exactly once in the pattern
(linearity check). Delta expansion and conversion are disabled
during contextual pattern matching to ensure position computation
remains sound.

@strub strub self-assigned this Mar 26, 2026
@strub strub force-pushed the rw-pattern-ctxt branch 4 times, most recently from 565921e to f8233fc Compare April 9, 2026 07:37
Allow rewrite patterns to designate a subterm inside a
larger context with the [x in pattern] syntax.

This lets rewrite target exactly the occurrence named by
the surrounding context, and adds regression coverage for
that form.

The context variable must appear exactly once in the pattern
(linearity check). Delta expansion and conversion are disabled
during contextual pattern matching to ensure position computation
remains sound.
@strub strub force-pushed the rw-pattern-ctxt branch from f8233fc to c4fd44b Compare April 9, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant