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: case splitting in grind #6717

Merged
merged 1 commit into from
Jan 20, 2025
Merged

feat: case splitting in grind #6717

merged 1 commit into from
Jan 20, 2025

Conversation

leodemoura
Copy link
Member

This PR introduces a new feature that allows users to specify which inductive datatypes the grind tactic should perform case splits on. The configuration option splitIndPred is now set to false by default. The attribute [grind cases] is used to mark inductive datatypes and predicates that grind may case split on during the search. Additionally, the attribute [grind cases eager] can be used to mark datatypes and predicates for case splitting both during pre-processing and the search.

Users can also write grind [HasType] or grind [cases HasType] to instruct grind to perform case splitting on the inductive predicate HasType in a specific instance. Similarly, grind [-Or] can be used to instruct grind not to case split on disjunctions.

This PR introduces a new feature that allows users to specify which inductive datatypes the `grind` tactic should perform case splits on. The configuration option `splitIndPred` is now set to `false` by default. The attribute `[grind cases]` is used to mark inductive datatypes and predicates that `grind` may case split on during the search. Additionally, the attribute `[grind cases eager]` can be used to mark datatypes and predicates for case splitting both during pre-processing and the search.

Users can also write `grind [HasType]` or `grind [cases HasType]` to instruct `grind` to perform case splitting on the inductive predicate `HasType` in a specific instance. Similarly, `grind [-Or]` can be used to instruct `grind` not to case split on disjunctions.
@leodemoura leodemoura added the changelog-language Language features, tactics, and metaprograms label Jan 20, 2025
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 20, 2025 21:46 Inactive
@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 20, 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 c07f64a6212247ef789d4cef39e237b4a4b61696 --onto ac6a29ee834ba7fd30e9372e51493d7741e9c657. (2025-01-20 22:00:08)

@leodemoura leodemoura added this pull request to the merge queue Jan 20, 2025
Merged via the queue into master with commit 189f5d4 Jan 20, 2025
17 of 18 checks passed
luisacicolini pushed a commit to opencompl/lean4 that referenced this pull request Jan 21, 2025
This PR introduces a new feature that allows users to specify which
inductive datatypes the `grind` tactic should perform case splits on.
The configuration option `splitIndPred` is now set to `false` by
default. The attribute `[grind cases]` is used to mark inductive
datatypes and predicates that `grind` may case split on during the
search. Additionally, the attribute `[grind cases eager]` can be used to
mark datatypes and predicates for case splitting both during
pre-processing and the search.

Users can also write `grind [HasType]` or `grind [cases HasType]` to
instruct `grind` to perform case splitting on the inductive predicate
`HasType` in a specific instance. Similarly, `grind [-Or]` can be used
to instruct `grind` not to case split on disjunctions.

Co-authored-by: Leonardo de Moura <[email protected]>
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