AUTHORS:
Elements of free monoids are represented internally as lists of pairs of integers.
Bases: sage.structure.element.MonoidElement
Element of a free monoid.
EXAMPLES:
sage: a = FreeMonoid(5, 'a').gens()
sage: x = a[0]*a[1]*a[4]**3
sage: x**3
a0*a1*a4^3*a0*a1*a4^3*a0*a1*a4^3
sage: x**0
1
sage: x**(-1)
Traceback (most recent call last):
...
TypeError: bad operand type for unary ~: 'FreeMonoid_class_with_category.element_class'
Return self as a word.
INPUT:
EXAMPLES:
sage: M.<x,y,z> = FreeMonoid(3)
sage: a = x * x * y * x
sage: w = a.to_word(); w
word: xxyx
sage: w.to_monoid_element() == a
True
x.__init__(...) initializes x; see help(type(x)) for signature