Closed Seasawher closed 3 months ago
set_option trace.Elab.step true
example : ∃ x : Nat, x = 1 := by
/-
[Elab.step] exists 1 ▼
[] exists 1 ▼
[] exists 1 ▼
[] (refine ⟨1, ?_⟩; try trivial) ▼
[] refine ⟨1, ?_⟩; try trivial ▼
[] refine ⟨1, ?_⟩; try trivial ▶
-/
exists 1
なんと答えを得てしまった!
import Lean
open Lean
elab "#tactic_expand " t:tactic : command => do
let some t ← Elab.liftMacroM <| Lean.Macro.expandMacro? t | logInfo m!"Not a macro"
logInfo m!"{t}"
/-- info: (refine ⟨1, ?_⟩; try trivial) -/
#guard_msgs in #tactic_expand exists 1
exists の項でこのように書いたが、これを確かめるコード例がない。タクティクに展開されるマクロがあったとして、その展開結果を確かめるにはどうしたらよいだろう?