Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ def minimum_libsemigroups_version():
"""Returns the minimum required version of libsemigroups required to build
libsemigroups_pybind11.
"""
# TODO update to 3.7
return "3.6.1"
56 changes: 38 additions & 18 deletions docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ possible:

.. _todd-coxeter-to-knuth-bendix-default:

Converting a :any:`ToddCoxeter` to a :any:`KnuthBendix` (default rewriter)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Converting a :any:`ToddCoxeter` to a :any:`KnuthBendix` (default rewriting system and order)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To construct a :any:`KnuthBendix` from a :any:`ToddCoxeter` using the default
rewriter, specify all of the following values for *args*:
Expand Down Expand Up @@ -97,12 +97,19 @@ following values for *args*:
- **tc** (:any:`ToddCoxeter`) -- the :any:`ToddCoxeter` object being
converted.

Additionally, specify one of the following for *rtype*:
Additionally, specify *rtype* to be a tuple with first item :any:`KnuthBendix`, second item one of

- ``'Trie'`` for constructing a :any:`KnuthBendix`
with a trie based rewriting system.
- ``'Set'`` for constructing a :any:`KnuthBendix`
with a set based rewriting system.

and the third item one of:

- ``(KnuthBendix, 'RewriteTrie')`` for constructing a :any:`KnuthBendix`
with the ``RewriteTrie`` rewriter.
- ``(KnuthBendix, 'RewriteFromLeft')`` for constructing a :any:`KnuthBendix`
with the ``RewriteFromLeft`` rewriter.
- :any:`Order.shortlex` for constructing a :any:`KnuthBendix`
with short-lex reduction ordering.
- :any:`Order.recursive` for constructing a :any:`KnuthBendix`
with recursive path reduction ordering.

This function converts a :any:`ToddCoxeter` object *tc* to a :any:`KnuthBendix`
object with the rewriter as specified above, using
Expand All @@ -117,6 +124,7 @@ the semigroup defined by *tc*.
... congruence_kind,
... to,
... KnuthBendix,
... Order,
... Presentation,
... presentation,
... ToddCoxeter,
Expand All @@ -132,7 +140,7 @@ the semigroup defined by *tc*.
>>> kb = to(
... congruence_kind.twosided, # knd
... tc, # tc
... rtype=(KnuthBendix, 'RewriteFromLeft')
... rtype=(KnuthBendix, 'Set', Order.shortlex)
... )
>>> kb.run()

Expand All @@ -154,18 +162,30 @@ following values for *args*:

Additionally, specify one of the following for *rtype*:

- ``(KnuthBendix, str, 'RewriteTrie')`` for constructing a
:any:`KnuthBendix` on words with type ``str`` using the ``RewriteTrie``
rewriter.
- ``(KnuthBendix, list[int], 'RewriteTrie')`` for constructing a
- ``(KnuthBendix, str, 'Trie', Order.shortlex)`` for constructing a
:any:`KnuthBendix` on words with type ``str`` using the
trie based rewriting system and short-lex reduction ordering.
- ``(KnuthBendix, list[int], 'Trie', Order.shortlex)`` for constructing a
:any:`KnuthBendix` on words with type ``list[int]`` using the
``RewriteTrie`` rewriter.
- ``(KnuthBendix, str, 'RewriteFromLeft')`` for constructing a
trie based rewriting system and short-lex reduction ordering.
- ``(KnuthBendix, str, 'Set', Order.shortlex)`` for constructing a
:any:`KnuthBendix` on words with type ``str`` using a set based rewriting
system and short-lex reduction ordering.
- ``(KnuthBendix, list[int], 'Set', Order.shortlex)`` for constructing a
:any:`KnuthBendix` on words with type ``list[int]`` using a set based
rewriting system and short-lex reduction ordering.
- ``(KnuthBendix, str, 'Trie', Order.recursive)`` for constructing a
:any:`KnuthBendix` on words with type ``str`` using the
``RewriteFromLeft`` rewriter.
- ``(KnuthBendix, list[int], 'RewriteFromLeft')`` for constructing a
trie based rewriting system and recursive path reduction ordering.
- ``(KnuthBendix, list[int], 'Trie', Order.recursive)`` for constructing a
:any:`KnuthBendix` on words with type ``list[int]`` using the
``RewriteFromLeft`` rewriter.
trie based rewriting system and recursive path reduction ordering.
- ``(KnuthBendix, str, 'Set', Order.recursive)`` for constructing a
:any:`KnuthBendix` on words with type ``str`` using a set based rewriting
system and recursive path reduction ordering.
- ``(KnuthBendix, list[int], 'Set', Order.recursive)`` for constructing a
:any:`KnuthBendix` on words with type ``list[int]`` using a set based
rewriting system and short-lex reduction ordering.

This function converts a :any:`FroidurePin` object *fpb* to a :any:`KnuthBendix`
object with the word type and rewriter as specified above. This is done using
Expand Down Expand Up @@ -196,7 +216,7 @@ the semigroup defined by *fpb*.
>>> kb = to(
... congruence_kind.twosided, # knd
... S, # tc
... rtype=(KnuthBendix, list[int], 'RewriteFromLeft')
... rtype=(KnuthBendix, list[int], 'Set', Order.recursive)
... )
>>> kb.run()

Expand Down
Loading
Loading