Open Seasawher opened 6 months ago
良いコード例が思いつかないので,紹介は保留
最も単純な simproc の実装例 必ず Lean.Expr を扱わなければならないので,説明するためには Expr のことを説明する必要がある
import Lean.Meta.Tactic.Simp
open Lean Meta
def foo : Nat := 10
simproc reduceFoo (foo) := fun e => do
dbg_trace "hello, simproc!"
return .done { expr := Lean.mkNatLit 10 }
example (x : Nat) : x + foo = 10 + x := by
simp
ac_rfl
v4.6.0 から導入された機能
https://github.com/leanprover/lean4/releases/tag/v4.6.0