AUTHOR: David Kohel, 2005-09
SAGE supports free monoids on any prescribed finite number
of generators. Use the
FreeMonoid
function to create a free
monoid, and the gen
and gens
functions to obtain the
corresponding generators. You can print the generators as arbitrary
strings using the optional names
argument to the
FreeMonoid
function.
The module monoids.free_monoid defines the following methods:
n, [names=None]) |
Returns a free monoid on
generators.
INPUT: n -- integer names -- (optional) names of generators OUTPUT: free abelian monoid
sage: FreeMonoid(0) Free monoid on 0 generators () sage: F = FreeMonoid(5, names = list("abcde")) sage: F Free monoid on 5 generators (a, b, c, d, e) sage: F(1) 1 sage: (a, b, c, d, e) = F.gens() sage: mul([ a, b, a, c, b, d, c, d ]) a*b*a*c*b*d*c*d
x) |
Return True if
is a free monoid.
sage: is_FreeMonoid(5) False sage: is_FreeMonoid(FreeMonoid(7)) True sage: is_FreeMonoid(FreeAbelianMonoid(7)) False sage: is_FreeMonoid(FreeAbelianMonoid(0)) False
The module monoids.free_monoid defines the following classes: