Skip to content

Conversation

@kim-em
Copy link
Contributor

@kim-em kim-em commented Dec 10, 2025

This PR modifies grindReplacementWith to accept an extractArgs function that can extract term arguments from the original tactic syntax. When arguments are found, they are converted to grindParam syntax and included in the replacement grind call. Further, if an argument is a global identifier, we wrap it in id to ensure grind interprets it as a term (rather than trying to find a trigger pattern).

This makes the regression linter more useful - instead of just trying grind, it now tries grind [X, Y] when the original was linarith [X, Y].

Example output before:

fail_if_success grind
linarith [Finset.mem_antidiagonal.mp hij, Real.pi_pos]

Example output after:

fail_if_success grind [Finset.mem_antidiagonal.mp hij, id Real.pi_pos]
linarith [Finset.mem_antidiagonal.mp hij, Real.pi_pos]

🤖 Prepared with Claude Code

@github-actions github-actions bot added the t-meta Tactics, attributes or user commands label Dec 10, 2025
@github-actions
Copy link

github-actions bot commented Dec 10, 2025

PR summary 3d9f34a5bb

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@kim-em kim-em force-pushed the feat/grind-replacement-copy-args branch 2 times, most recently from 91de4c4 to 0bb840e Compare December 10, 2025 03:23
This modifies `grindReplacementWith` to optionally extract term arguments
from the original tactic and pass them to grind. For example,
`linarith [X, Y]` can now be replaced with `grind [X, Y]`.

Key behaviors:
- Local hypotheses are filtered out since grind uses them automatically
- Simple identifiers (like `pi_pos`) are wrapped as `id pi_pos` to force
  grind to treat them as terms rather than e-matching theorem candidates

The `extractArgs` parameter is a function that extracts the term array
from the original tactic syntax. Used by `linarithToGrindRegressions`.

🤖 Prepared with Claude Code
@kim-em kim-em force-pushed the feat/grind-replacement-copy-args branch from 0bb840e to cbb9299 Compare December 10, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants