Monoid Elements

AUTHORS:

  • David Kohel (2005-09-29)

Elements of free monoids are represented internally as lists of pairs of integers.

class sage.monoids.free_monoid_element.FreeMonoidElement(F, x, check=True)

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)
...
TypeError: bad operand type for unary ~: 'FreeMonoidElement'
sage.monoids.free_monoid_element.is_FreeMonoidElement(x)

Previous topic

Free Monoids

Next topic

Free abelian monoids

This Page