Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: overlapping match patterns in grind #6733

Merged
merged 6 commits into from
Jan 21, 2025
Merged

Conversation

leodemoura
Copy link
Member

This PR adds better support for overlapping match patterns in grind. grind can now solve examples such as

inductive S where
  | mk1 (n : Nat)
  | mk2 (n : Nat) (s : S)
  | mk3 (n : Bool)
  | mk4 (s1 s2 : S)

def f (x y : S) :=
  match x, y with
  | .mk1 _, _ => 2
  | _, .mk2 1 (.mk4 _ _) => 3
  | .mk3 _, _ => 4
  | _, _ => 5

example : b = .mk2 y1 y2 → y1 = 2 → a = .mk4 y3 y4 → f a b = 5 := by
  unfold f
  grind (splits := 0)

@leodemoura leodemoura added the changelog-language Language features, tactics, and metaprograms label Jan 21, 2025
@leodemoura leodemoura enabled auto-merge January 21, 2025 21:07
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 21, 2025 21:19 Inactive
@leodemoura leodemoura added this pull request to the merge queue Jan 21, 2025
@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 Jan 21, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase c54287fb0d2bd580bf3a9035581f89cf25d609c8 --onto f9e904af5022a57adb6105cda65d1569449346c2. (2025-01-21 21:32:04)

@leodemoura leodemoura removed this pull request from the merge queue due to a manual request Jan 21, 2025
@leodemoura leodemoura enabled auto-merge January 21, 2025 21:50
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 21, 2025 21:53 Inactive
@leodemoura leodemoura added this pull request to the merge queue Jan 21, 2025
Merged via the queue into master with commit c9a03c7 Jan 21, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-language Language features, tactics, 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