The function Ops.free()
passes binary arithmetic operators
(“+
”, “-
”, “*
”,
“^
”, and “==
”) to the appropriate
specialist function.
There are two non-trivial operations: juxtaposition, denoted
“a+b
”, and inversion, denoted “-a
”. Note
that juxtaposition is noncommutative and a+b
will not, in
general, be equal to b+a
.
All operations return a reduced word.
The caret, as in a^b
, denotes group-theoretic exponentiation
(-b+a+b
); the notation is motivated by the identities
x^(yz)=(x^y)^z
and (xy)^z=x^z*y^z
, as in the
permutations
package.
Multiplication between a free object a
and an integer n
is defined as juxtaposing n
copies of a
and reducing.
Zero and negative values of n
work as expected.