free.spad line 383 [edit on github]
The free group on a set S is the group of finite products of the form reduce(*, [ where the si ^ ni])si's are in S, and the ni's are integers. The multiplication is not commutative.
x * s returns the product of x by s on the right.
s * x returns the product of x by s on the left.
s ^ n returns the product of s by itself n times.
factors(a1^e1, ..., an^en) returns [[a1, e1], ..., [an, en]].
mapExpon(f, a1^e1 ... an^en) returns a1^f(e1) ... an^f(en).
mapGen(f, a1^e1 ... an^en) returns f(a1)^e1 ... f(an)^en.
nthExpon(x, n) returns the exponent of the n^th monomial of x.
nthFactor(x, n) returns the factor of the n^th monomial of x.
size(x) returns the number of monomials in x.