lean4-htt/tests/lean/caching_user_attribute.lean

31 lines
809 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_command attribute.register `foo_attr
attribute [foo] eq.refl eq.mp
set_option trace.user_attributes_cache true
run_command do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
run_command do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
attribute [foo] eq.mpr
local attribute [-foo] eq.mp
run_command do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s
attribute [reducible] eq.mp -- should not affect [foo] cache
run_command do
s : string ← caching_user_attribute.get_cache foo_attr,
tactic.trace s