lean4-htt/library/init/meta/rewrite_tactic.lean
Leonardo de Moura 9f6e71b374 feat(library/tactic): add "approximate" parameter to apply_core and rewrite_core
If this parameter is set to true, then approximate unification is
used.

closes #1208
2016-12-10 10:24:05 -08:00

24 lines
903 B
Text

/-
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import init.meta.relation_tactics init.meta.occurrences
namespace tactic
/- (rewrite_core m approx use_instances occs symm H) -/
meta constant rewrite_core : transparency → bool → bool → occurrences → bool → expr → tactic unit
meta constant rewrite_at_core : transparency → bool → bool → occurrences → bool → expr → expr → tactic unit
meta def rewrite (th_name : name) : tactic unit :=
do th ← mk_const th_name,
rewrite_core reducible tt tt occurrences.all ff th,
try (reflexivity_core reducible)
meta def rewrite_at (th_name : name) (H_name : name) : tactic unit :=
do th ← mk_const th_name,
H ← get_local H_name,
rewrite_at_core reducible tt tt occurrences.all ff th H
end tactic