Lean4
/-- Common entry point to the implementation of `pull`. -/
def pullCore (head : Head) (tgt : Expr) (disch? : Option Simp.Discharge) : MetaM Simp.Result := do
let ctx : Simp.Context ← Simp.mkContext pushSimpConfig (simpTheorems := #[]) (congrTheorems := ← getSimpCongrTheorems)
let methods :=
match disch? with
| none => { post := pullStep head }
| some disch => { post := pullStep head, discharge? := disch, wellBehavedDischarge := false }
(·.1) <$> Simp.main tgt ctx (methods := methods)