Skip to content

Commit 6643e97

Browse files
committed
chore(Tactic): document the says tactic combinator (leanprover-community#38290)
This PR rewrites the docstrings for the `says` tactic combinator, to consistently match the [official style guide](https://github.com/leanprover/lean4/blob/master/doc/style.md#tactics), to make sure they are complete while not getting too long. The structure is now: * explain what `says` does, * explain why you would want to use it, * explain how to update/apply a `says`. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
1 parent b4de15a commit 6643e97

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

Mathlib/Tactic/Says.lean

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,15 @@ def evalTacticCapturingTryThis (tac : TSyntax `tactic) : TacticM (TSyntax ``tact
7575
| .error err => throwError m!"Failed to parse 'Try this:' suggestion: {s}\n{err}"
7676

7777
/--
78-
If you write `X says`, where `X` is a tactic that produces a "Try this: Y" message,
79-
then you will get a message "Try this: X says Y".
80-
Once you've clicked to replace `X says` with `X says Y`,
81-
afterwards `X says Y` will only run `Y`.
78+
`tac₁ says tac₂` runs `tac₂`. In CI it also runs `tac₁` and validates that `tac₁` produces
79+
a "Try this: `tac₂`" message. Use `set_option says.verify true` to enable the validation step on
80+
your own machine.
8281
83-
The typical usage case is:
84-
```
85-
simp? [X] says simp only [X, Y, Z]
86-
```
82+
The `says` combinator is intended to be used when `tac₁` is meaningful but slow and `tac₂` is faster
83+
but hard to read: for example, `simp? [X] says simp only [X, Y, Z]`.
8784
88-
If you use `set_option says.verify true` (set automatically during CI) then `X says Y`
89-
runs `X` and verifies that it still prints "Try this: Y".
85+
To generate or update the correct value of `tac₂`, write `tac₁ says`. You will get a message
86+
"Try this: `tac₁ says tac₂`.
9087
-/
9188
syntax (name := says) tactic " says" (colGt tacticSeq)? : tactic
9289

0 commit comments

Comments
 (0)