@@ -54,6 +54,10 @@ Contents
5454 - Greedily reduce the length of the presentation using
5555 :py:func: `longest_common_subword `.
5656
57+ * - :py:func: `is_strongly_compressible `
58+ - Returns ``True `` if a :math: `1 `-relation presentation can be strongly
59+ compressed.
60+
5761 * - :py:func: `length `
5862 - Return the sum of the lengths of the rules.
5963
@@ -85,6 +89,10 @@ Contents
8589 \rvert < \lvert v \rvert `, then replace :math: `u = v` with :math: `u =
8690 w`.
8791
92+ * - :py:func: `reduce_to_2_generators `
93+ - Reduce the number of generators in a :math: `1 `-relation presentation to
94+ ``2 ``.
95+
8896 * - :py:func: `redundant_rule `
8997 - Returns the index of the left hand side of a redundant rule.
9098
@@ -120,6 +128,9 @@ Contents
120128 - Sort the rules :math: `u_1 = v_1 , \ldots , u_n = v_n` so that :math: `u_1
121129 v_1 < \cdots < u_n v_n`, where :math: `<` is the shortlex order.
122130
131+ * - :py:func: `strongly_compress `
132+ - Strongly compress a :math: `1 `-relation presentation.
133+
123134Full API
124135--------
125136
@@ -367,6 +378,28 @@ Full API
367378 if :py:func:`longest_common_subword` or :py:func:`replace_word` does.
368379
369380
381+ .. py:function:: is_strongly_compressible(p: Presentation) -> bool
382+
383+ Returns `` True `` if the :math:`1 ` - relation presentation can be strongly
384+ compressed.
385+
386+ A :math:`1 ` - relation presentation is * strongly compressible* if both
387+ relation words start with the same letter and end with the same letter.
388+ In other words, if the alphabet of the presentation `` p`` is :math:`A` and
389+ the relation words are of the form :math:`aub = avb` where :math:`a, b\in A`
390+ (possibly :math:`a = b` ) and :math:` u, v\in A^*`, then ``p`` is strongly
391+ compressible. See `Section 3.2 ` _ for details.
392+
393+ .. _Section 3.2 : https:// doi.org/ 10.1007 / s00233- 021 - 10216 - 8
394+
395+ :param p: the presentation
396+ :type p: Presentation
397+
398+ :returns: A value of type `` bool `` .
399+
400+ .. seealso:: :py:func:`strongly_compress`
401+
402+
370403.. py:function:: length(p: Presentation) -> int
371404
372405 Return the sum of the lengths of the rules.
@@ -534,6 +567,35 @@ Full API
534567 [' a' , ' aaa' , ' a' , ' aaaaa' ]
535568
536569
570+ .. py:function:: reduce_to_2_generators(p: Presentation) -> None
571+
572+ Reduce the number of generators in a :math:`1 ` - relation presentation to
573+ `` 2 `` .
574+
575+ Returns `` True `` if the :math:`1 ` - relation presentation `` p`` has been
576+ modified and `` False `` if not .
577+
578+ A :math:`1 ` - relation presentation is * left cycle- free* if the relation
579+ words start with distinct letters. In other words, if the alphabet of the
580+ presentation `` p`` is :math:`A` and the relation words are of the form
581+ :math:`au = bv` where :math:`a, b\in A` with :math:`a \neq b` and
582+ :math:` u, v \in A^*`, then ``p`` is left cycle-free. The word problem for
583+ a left cycle- free :math:`1 ` - relation monoid is solvable if the word
584+ problem for the modified version obtained from this function is solvable.
585+
586+ :param p: the presentation
587+ :type p: Presentation
588+ :param x:
589+ determines the choice of letter to use, `` 0 `` uses
590+ `` p.rules[0 ].front()`` and `` 1 `` uses `` p.rules[1 ].front()`` (defaults to:
591+ `` 0 `` ).
592+ :type x: int
593+
594+ :returns: A value of type `` bool `` .
595+
596+ :raises RuntimeError : if `` index`` is not `` 0 `` or `` 1 `` .
597+
598+
537599.. py:function:: redundant_rule(p: Presentation, t: datetime.timedelta) -> int
538600
539601 Return the index of the the left hand side of a redundant rule.
@@ -573,9 +635,9 @@ Full API
573635 >> > presentation.add_rule(p, " ab" , " ba" )
574636 >> > presentation.add_rule(p, " bab" , " abb" )
575637 >> > t = timedelta(seconds = 1 )
576- >> > p.rules
638+ >> > p.rules
577639 [' ab' , ' ba' , ' bab' , ' abb' ]
578- >> > presentation.redundant_rule(p, t)
640+ >> > presentation.redundant_rule(p, t)
579641 2
580642
581643
@@ -770,3 +832,19 @@ Full API
770832 :type p: Presentation
771833
772834 :returns: None
835+
836+
837+ .. py:function:: strongly_compress(p: Presentation) -> None
838+
839+ Strongly compress a :math:`1 ` - relation presentation.
840+
841+ Returns `` True `` if the :math:`1 ` - relation presentation `` p`` has been
842+ modified and `` False `` if not . The word problem is solvable for the input
843+ presentation if it is solvable for the modified version.
844+
845+ :param p: the presentation
846+ :type p: Presentation
847+
848+ :returns: A value of type `` bool `` .
849+
850+ .. seealso:: :py:func:`is_strongly_compressible`
0 commit comments