lean4-htt/tests/lean/run/algebra_attr.lean
Leonardo de Moura 55fee26b36 feat(library/class): add attribute for tracking symbols occurring in instances of type classes
For more information see:
https://github.com/leanprover/lean/wiki/Refactoring-structures
The new attribute [algebra] implements the [algebraic_class] described
in the page above.
2017-05-01 18:02:30 -07:00

15 lines
266 B
Text

def f (a b : nat) := 0
def g (a b : nat) := 1
instance : is_commutative nat f :=
⟨λ a b, rfl⟩
instance : is_commutative nat g :=
⟨λ a b, rfl⟩
open tactic
run_cmd do
env ← get_env,
s ← return $ env.get_class_attribute_symbols `algebra,
trace s