Monoids - Monoids

Skip to content
Back to top
View this page
Edit this page

# Monoids

class sage.monoids.monoid.Monoid_class(names, category=None)

  Bases: `Parent`

  EXAMPLES:

  Sage

      sage: from sage.monoids.monoid import Monoid_class
      sage: Monoid_class(('a','b'))
      <sage.monoids.monoid.Monoid_class_with_category object at ...>

  Python

      >>> from sage.all import *
      >>> from sage.monoids.monoid import Monoid_class
      >>> Monoid_class(('a','b'))
      <sage.monoids.monoid.Monoid_class_with_category object at ...>

  gens()

    Return the generators for `self`.

    EXAMPLES:

    Sage

        sage: F.<a,b,c,d,e> = FreeMonoid(5)
        sage: F.gens()
        (a, b, c, d, e)

    Python

        >>> from sage.all import *
        >>> F = FreeMonoid(Integer(5), names=('a', 'b', 'c', 'd', 'e',)); (a, b, c, d, e,) = F._first_ngens(5)
        >>> F.gens()
        (a, b, c, d, e)

  monoid_generators()

    Return the generators for `self`.

    EXAMPLES:

    Sage

        sage: F.<a,b,c,d,e> = FreeMonoid(5)
        sage: F.monoid_generators()
        Family (a, b, c, d, e)

    Python

        >>> from sage.all import *
        >>> F = FreeMonoid(Integer(5), names=('a', 'b', 'c', 'd', 'e',)); (a, b, c, d, e,) = F._first_ngens(5)
        >>> F.monoid_generators()
        Family (a, b, c, d, e)