lean4-htt/tests/lean/run/binderNameHintSimp.lean
Joachim Breitner 0e49576fe4
feat: guard_msgs to treat trace messages separate (#8267)
This PR makes `#guard_msgs` to treat `trace` messages separate from
`info`, `warning` and `error`. It also introduce the ability to say
`#guard_msgs (pass info`, like `(drop info)` so far, and also adds
`(check info)` as the explicit form of `(info)`, for completeness.

Fixes #8266
2025-05-09 05:44:34 +00:00

35 lines
818 B
Text

/-!
Checks that `simp` removes the `binderNameHint` in the pre-phase, and does not spend time looking
at its arguments.
The following traces should show no rewriting of `x` or `y`, only `z`.
-/
def x : Nat := 0
def y : Nat := 0
def z : Nat := 0
set_option trace.Meta.Tactic.simp.rewrite true
/--
trace: [Meta.Tactic.simp.rewrite] ↓ binderNameHint.eq_1:1000:
binderNameHint x y z
==>
z
[Meta.Tactic.simp.rewrite] unfold z, z ==> 0
[Meta.Tactic.simp.rewrite] eq_self:1000: 0 = 0 ==> True
-/
#guard_msgs in
example : binderNameHint x y z = 0 := by
simp [x, y, z]
/--
trace: [Meta.Tactic.simp.rewrite] ↓ binderNameHint.eq_1:1000:
binderNameHint x y z
==>
z
[Meta.Tactic.simp.rewrite] unfold z, z ==> 0
-/
#guard_msgs in
example : binderNameHint x y z = 0 := by
dsimp [x, y, z]