fix(init/meta/interactive): simp: accept local refs as simp names

This commit is contained in:
Sebastian Ullrich 2017-05-11 15:58:47 +02:00 committed by Leonardo de Moura
parent 14425bd2d3
commit 27c1d2f4fb
2 changed files with 20 additions and 1 deletions

View file

@ -576,7 +576,9 @@ fail ("invalid simplification lemma '" ++ to_string n ++ "' (use command 'set_op
private meta def simp_lemmas.resolve_and_add (s : simp_lemmas) (n : name) (ref : expr) : tactic simp_lemmas :=
do
p ← resolve_name n,
match p.to_raw_expr with
-- unpack local refs
let e := p.to_raw_expr.erase_annotations.get_app_fn.erase_annotations,
match e with
| const n _ :=
(do b ← is_valid_simp_lemma_cnst reducible n, guard b, save_const_type_info n ref, s.add_simp n)
<|>

17
tests/lean/run/1577.lean Normal file
View file

@ -0,0 +1,17 @@
section
parameter T : Type
def eqT : T -> T -> Prop
| t1 t2 := t1 = t2
lemma sm : forall t1 t2,
eqT t1 t2 ->
t1 = t2 :=
begin
intros,
simp [eqT] at a,
assumption
end
end