Skip to content

fix: E-matching patterns containing ground universe polymorphic patterns in grind - #9857

Merged
leodemoura merged 1 commit into
masterfrom
grind_poly_ground_pattern
Aug 11, 2025
Merged

fix: E-matching patterns containing ground universe polymorphic patterns in grind#9857
leodemoura merged 1 commit into
masterfrom
grind_poly_ground_pattern

Conversation

@leodemoura

Copy link
Copy Markdown
Member

This PR ensures grind can E-match patterns containing universe polymorphic ground sub-patterns. For example, given

set_option pp.universes true in
attribute [grind?] Id.run_pure

the pattern

Id.run_pure.{u_1}: [@Id.run.{u_1} #1 (@pure.{u_1, u_1} `[Id.{u_1}] `[Applicative.toPure.{u_1, u_1}] _ #0)]

contains two nested universe polymorphic ground patterns

  • Id.{u_1}
  • Applicative.toPure.{u_1, u_1}

This kind of pattern is not common, but it occurs in core.

…rns in `grind`

This PR ensures `grind` can E-match patterns containing universe
polymorphic ground sub-patterns. For example, given
```
set_option pp.universes true in
attribute [grind?] Id.run_pure
```
the pattern
```
Id.run_pure.{u_1}: [@Id.run.{u_1} #1 (@pure.{u_1, u_1} `[Id.{u_1}] `[Applicative.toPure.{u_1, u_1}] _ #0)]
```
contains two nested universe polymorphic ground patterns
- `Id.{u_1}`
- `Applicative.toPure.{u_1, u_1}`

This kind of pattern is not common, but it occurs in core.
@leodemoura leodemoura added the changelog-language Language features and metaprograms label Aug 11, 2025
@leodemoura
leodemoura enabled auto-merge August 11, 2025 20:59
@leodemoura
leodemoura added this pull request to the merge queue Aug 11, 2025
Merged via the queue into master with commit a157abb Aug 11, 2025
19 of 20 checks passed
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Aug 11, 2025
@ghost

ghost commented Aug 11, 2025

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 5abf4bb651329452deb16496845f8937b1bbc270 --onto e0fcaf5e7ddab2fcab51be8c403446d84a8a0d45. You can force Mathlib CI using the force-mathlib-ci label. (2025-08-11 21:45:43)

@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 5abf4bb651329452deb16496845f8937b1bbc270 --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-08-11 21:45:45)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants