# 12.9 Attributes¶

Most axioms are not computationally useful. Those that are can be explicitly expressed by what FriCAS calls an attribute. The attribute commutative(“*”), for example, is used to assert that a domain has commutative multiplication. Its definition is given by its documentation:

A domain R has commutative(“*”) if it has an operation “*”: (R,R)->R such that x*y=y*x.

Just as you can test whether a domain has the category Ring, you can test that a domain has a given attribute.

Do polynomials over the integers have commutative multiplication?

Polynomial Integer has commutative("*")


Do matrices over the integers have commutative multiplication?

Matrix Integer has commutative("*")


Attributes are used to conditionally export and define operations for a domain (see ugDomainsAssertions ). Attributes can also be asserted in a category definition.

After mentioning category Ring many times in this book, it is high time that we show you its definition: Ring

Ring(): Category ==
Join(Rng,Monoid,LeftModule($: Rng)) with characteristic: -> NonNegativeInteger coerce: Integer ->$
unitsKnown
coerce(n) == n * 1$$ There are only two new things here. First, look at the$$ on the last line. This is not a typographic error! The first $says that the 1 is to come from some domain. The second$ says that the domain is this domain. If $is Fraction(Integer), this line reads coerce(n) == n * 1$Fraction(Integer).