lean4-htt/tests/lean/caching_user_attribute.lean
2017-03-09 18:41:19 -08:00

31 lines
789 B
Text

meta def foo_attr : caching_user_attribute string :=
{ name := `foo, descr := "bar",
mk_cache := λ ns, return $ list.join ∘ list.map (list.append "\n" ∘ to_string) $ ns,
dependencies := [] }
run_cmd attribute.register `foo_attr
attribute [foo] eq.refl eq.mp
set_option trace.user_attributes_cache true
run_cmd do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
run_cmd do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
attribute [foo] eq.mpr
local attribute [-foo] eq.mp
run_cmd do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
attribute [reducible] eq.mp -- should not affect [foo] cache
run_cmd do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s