blob: 934530d4156821d2a47b06606e21691934dc4345 [file]
/-
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
module
prelude
public import Lean.Elab.Tactic.Rewrite
public import Lean.Elab.Tactic.Conv.Basic
public section
namespace Lean.Elab.Tactic.Conv
open Meta
@[builtin_tactic Lean.Parser.Tactic.Conv.rewrite] def evalRewrite : Tactic := fun stx => do
let config ← Tactic.elabRewriteConfig stx[1]
withRWRulesSeq stx[0] stx[2] fun symm term => withMainContext do
let r ← Term.withSynthesize do
elabRewrite (← getMainGoal) (← getLhs) term symm (config := config)
let r ← finishElabRewrite r
updateLhs r.eNew r.eqProof
replaceMainGoal ((← getMainGoal) :: r.mvarIds)
end Lean.Elab.Tactic.Conv