lean4-htt/tests/lean/run/2042.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

33 lines
543 B
Text

@[simp] def foo (a : Nat) : Nat :=
2 * a
/--
trace: case h
x : Nat
⊢ 2 * x = x + x
-/
#guard_msgs in
example : foo = fun a => a + a :=
by
fail_if_success simp -- should not unfold `foo` into a lambda
funext x
simp -- unfolds `foo`
trace_state
simp +arith
@[simp] def boo : Nat → Nat
| a => 2 * a
/--
trace: case h
x : Nat
⊢ 2 * x = x + x
-/
#guard_msgs in
example : boo = fun a => a + a :=
by
fail_if_success simp -- should not unfold `boo` into a lambda
funext x
simp -- unfolds `boo`
trace_state
simp +arith