コード例 #1
0
    def __init__(self, category = None):
        r"""
        This quotient of the left zero semigroup of integers obtained by
        setting `x=42` for any `x\geq 42`.

        EXAMPLES::

            sage: S = Semigroups().Subquotients().example(); S
            An example of a (sub)quotient semigroup: a quotient of the left zero semigroup
            sage: S.ambient()
            An example of a semigroup: the left zero semigroup
            sage: S(100)
            42
            sage: S(100) == S(42)
            True
            sage: S(1)*S(2) == S(1)
            True

        TESTS::

            sage: TestSuite(S).run()
        """
        if category is None:
            category = Semigroups().Quotients()
        Parent.__init__(self, category = category)
コード例 #2
0
    def ambient(self):
        r"""
        Returns the ambient semigroup.

        EXAMPLES::

            sage: S = Semigroups().Subquotients().example()
            sage: S.ambient()
            An example of a semigroup: the left zero semigroup

        """
        return Semigroups().example()
コード例 #3
0
    def __init__(self, category=None):
        r"""
        An incompletely implemented subquotient semigroup, for testing purposes

        EXAMPLES::

            sage: S = sage.categories.examples.semigroups.IncompleteSubquotientSemigroup()
            sage: S
            A subquotient of An example of a semigroup: the left zero semigroup

        TESTS::

            sage: S._test_not_implemented_methods()
            Traceback (most recent call last):
              ...
            AssertionError: Not implemented method: lift

            sage: TestSuite(S).run(verbose = True)
            running ._test_an_element() . . . pass
            running ._test_associativity() . . . fail
            Traceback (most recent call last):
              ...
            NotImplementedError: <abstract method retract at ...>
            ------------------------------------------------------------
            running ._test_cardinality() . . . pass
            running ._test_category() . . . pass
            running ._test_construction() . . . pass
            running ._test_elements() . . .
              Running the test suite of self.an_element()
              running ._test_category() . . . pass
              running ._test_eq() . . . pass
              running ._test_new() . . . pass
              running ._test_not_implemented_methods() . . . pass
              running ._test_pickling() . . . pass
              pass
            running ._test_elements_eq_reflexive() . . . pass
            running ._test_elements_eq_symmetric() . . . pass
            running ._test_elements_eq_transitive() . . . pass
            running ._test_elements_neq() . . . pass
            running ._test_eq() . . . pass
            running ._test_new() . . . pass
            running ._test_not_implemented_methods() . . . fail
            Traceback (most recent call last):
              ...
            AssertionError: Not implemented method: lift
            ------------------------------------------------------------
            running ._test_pickling() . . . pass
            running ._test_some_elements() . . . pass
            The following tests failed: _test_associativity, _test_not_implemented_methods
        """
        Parent.__init__(
            self,
            category=Semigroups().Subquotients().or_subcategory(category))
コード例 #4
0
    def __init__(self):
        r"""
        The left zero semigroup

        EXAMPLES::

            sage: S = Semigroups().example(); S
            An example of a semigroup: the left zero semigroup

        TESTS::

            sage: TestSuite(S).run()

        """
        Parent.__init__(self, category = Semigroups())
コード例 #5
0
    def __init__(self, alphabet=('a','b','c','d')):
        r"""
        The free semigroup.

        INPUT::

        - ``alphabet`` -- a tuple of strings: the generators of the semigroup

        EXAMPLES::

            sage: from sage.categories.examples.semigroups import FreeSemigroup
            sage: F = FreeSemigroup(('a','b','c')); F
            An example of a semigroup: the free semigroup generated by ('a', 'b', 'c')

        TESTS::

            sage: F == loads(dumps(F))
            True

        """
        self.alphabet = alphabet
        Parent.__init__(self, category = Semigroups().FinitelyGenerated())