leanprover / leanprover/lean4

`#grind_lint` does not recognize grind sets

Open
#13,733 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites
Description

If I have a custom grind set:

module

public import Lean.Meta.Tactic.Grind.RegisterCommand

register_grind_attr foo

it is not recognized by #grind_lint

module

public import Foo.Basic

@[foo =]
public theorem bar : 1 = 1 := rfl

/--error: `bar` is not marked with the `@[grind]` attribute for theorem instantiation -/
#guard_msgs in
#grind_lint skip bar
Context

Discussed with Kim in office hours, this thread contains Mathlib PRs proposing their usage.

Steps to Reproduce

Create the modules listed above.

Expected behavior:

Allow #grind_lint reporting of theorems from custom grind sets, possibly with some options to control what sets are reported.

Actual behavior:

The error shown above.

Versions

Lean 4.29.1 Target: x86_64-unknown-linux-gnu

Additional Information

N/A

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with Lean.Meta.Tactic.Grind.RegisterCommand, Foo.Basic, and #grind_lint, then inspect the implementation and registration path used by #grind_lint. Done means a theorem marked with a custom grind set is recognized without the reported error, while the existing guard-message reproduction passes.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.