Zulip Chat Archive

Stream: general

Topic: add_theorem_by


Jakob von Raumer (Mar 24 2018 at 13:30):

Why does this fail?

meta  def  foo : tactic unit :=
do tactic.add_theorem_by `bar [] (expr.const `unit []) (do tactic.constructor, return ()),
tactic.add_theorem_by `baz [] (expr.const `unit []) (do
bar ← tactic.get_local `bar,
tactic.exact bar,
return ()),
return ()

Simon Hudon (Mar 24 2018 at 13:32):

What error do you get?

Jakob von Raumer (Mar 24 2018 at 13:34):

"get_local tactic failed, unknown 'bar'"

Simon Hudon (Mar 24 2018 at 13:36):

Ah I see! You need resolve_name

Simon Hudon (Mar 24 2018 at 13:37):

get_local is only for local constants

Jakob von Raumer (Mar 24 2018 at 13:44):

Is there a resource for more beautiful fresh local names than mk_fresh_name?

Mario Carneiro (Mar 24 2018 at 13:47):

yes, I think it is called get_unused_name


Last updated: Dec 20 2023 at 11:08 UTC