ufmg-smite / lean-smt

Tactics for discharging Lean goals into SMT solvers.
Apache License 2.0
94 stars 19 forks source link

Define-fun from local declarations #23

Closed Vtec234 closed 2 years ago

Vtec234 commented 2 years ago

During monomorphisation, we have to introduce auxiliary let-declarations for the monomorphised functions. It would be great if smt was able to define-fun these rather than just declare-fun. Here is a simpler example with no types involved:

example (x y z : Int) : x + y + z = x + (y + z) := by
  let add3 (x y z : Int) := x + y + z
  have : x + y + z = add3 x y z := rfl
  rw [this]
  smt -- (declare-fun add3 (Int Int Int) Int)
  smt [add3] -- failed to unfold definition add3
  sorry