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

18 lines
630 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean.Meta.Tactic.Grind
def g {α : Sort u} (a : α) := a
open Lean Meta Grind in
def fallback : Fallback := do
let nodes ← filterENodes fun e => return e.self.isApp && e.self.isAppOf ``g
trace[Meta.debug] "{nodes.toList.map (·.self)}"
(← get).mvarId.admit
-- `grind` final state must contain only two `g`-applications
set_option trace.Meta.debug true in
/--
trace: [Meta.debug] [g (a, b), g (g (a, b))]
-/
#guard_msgs (trace) in
example {β : Type v} {α : Type u} (a c : α) (b d : β) : g.{max u v + 1} (a, b) = (c, d) → g (g.{max (u+1) (v+1)} (a, b)) = (c, d) → False := by
grind on_failure fallback