Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/source/changelog-v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ version 3 of libsemigroups_. The extent of the changes made in this release
means that it is likely that any code written with earlier versions of
``libsemigroups_pybin11`` will no longer work.

The structure of ``libsemigroups_pybind11`` is very tightly linked to the the
The structure of ``libsemigroups_pybind11`` is very tightly linked to the
structure of libsemigroups_. Therefore, some of the differences between
v0.10.1 and v1.0.0 of ``libsemigroups_pyind11`` will be related to the
differences between v2 and v3 of libsemigroups_, such as changes to class names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ the type of words specified in *rtype*:
objects of type :any:`InversePresentation` must be converted from one
type to another sometimes, but not other times.

If the alphabet of of *ip* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
If the alphabet of *ip* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
letter is of type ``str``, then the conversion from one type to another is
:math:`a_i \mapsto` ``human_readable_index(a_i)``. Conversely, if each letter is
of type ``list[int]``, then the conversion from one type to another is
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-structures/presentations/to-present.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ the type of words specified in *rtype*:
presentations must be converted from one type to another sometimes, but
not other times.

If the alphabet of of *p* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
If the alphabet of *p* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
letter is of type ``str``, then the conversion from one type to another is
:math:`a_i \mapsto` ``human_readable_index(a_i)``. Conversely, if each letter is
of type ``list[int]``, then the conversion from one type to another is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This function throws a :any:`LibsemigroupsError` if the
.. warning::

The returned :any:`FroidurePin` instance is always infinite, and so any
calls to any member functions that that trigger a full enumeration will
calls to any member functions that trigger a full enumeration will
never terminate (or they will when your computer kills the process because
it has run out of memory).

Expand Down
4 changes: 2 additions & 2 deletions docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ following values for *args*:
Additionally, specify one of the following for *rtype*:

- ``(KnuthBendix, 'RewriteTrie')`` for constructing a :any:`KnuthBendix`
with the the ``RewriteTrie'`` rewriter.
with the ``RewriteTrie'`` rewriter.
- ``(KnuthBendix, 'RewriteFromLeft')`` for constructing a :any:`KnuthBendix`
with the the ``RewriteFromLeft'`` rewriter.
with the ``RewriteFromLeft'`` rewriter.

This function converts a :any:`ToddCoxeter` object *tc* to a :any:`KnuthBendix`
object with the rewriter as specified above, using
Expand Down
2 changes: 1 addition & 1 deletion docs/source/main-algorithms/todd-coxeter/class/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Constructors + initializers
===========================

This page documents the constructors and initialisers for the :any:`ToddCoxeter`
This page documents the constructors and initializers for the :any:`ToddCoxeter`
class.

Every constructor has a matching init function with the same signature that can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Word to class index
===================

This page contains documentation for the member functions of :any:`ToddCoxeter`
that can be used to convert a word into the index of congruence class.
that can be used to convert a word into the index of a congruence class.

.. automethod:: ToddCoxeter.current_index_of

Expand Down
4 changes: 2 additions & 2 deletions docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This function converts the :any:`FroidurePin` object *fpb* into a
either the :any:`FroidurePin.left_cayley_graph` or the
:any:`FroidurePin.right_cayley_graph` of *fpb*).

This returned :any:`ToddCoxeter` object represents the trivial congruence over
The returned :any:`ToddCoxeter` object represents the trivial congruence over
the semigroup defined by *fpb*.

This will throw a :any:`LibsemigroupsError` if *wg* is not the
Expand Down Expand Up @@ -111,7 +111,7 @@ This function converts the :any:`KnuthBendix` object *kb* into a
:any:`ToddCoxeter` object using the right Cayley graph of the semigroup
represented by *kb*.

This returned :any:`ToddCoxeter` object represents the trivial congruence over
The returned :any:`ToddCoxeter` object represents the trivial congruence over
the semigroup defined by *kb*.

This will throw a :any:`LibsemigroupsError` if either:
Expand Down
32 changes: 14 additions & 18 deletions src/todd-coxeter-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The valid values are :
.. py:attribute:: strategy.R_over_C
:value: <strategy.R_over_C: 3>

This strategy is meant to mimic the ACE strategy R/C. The HLT strategy is run until the first lookahead is triggered (when :the number of nodes active is at least :any:`lookahead_next`). A full lookahead is then performed, and then the CR strategy is used.
This strategy is meant to mimic the ACE strategy R/C. The HLT strategy is run until the first lookahead is triggered (when the number of nodes active is at least :any:`lookahead_next`). A full lookahead is then performed, and then the CR strategy is used.

.. py:attribute:: strategy.Cr
:value: <strategy.Cr: 4>
Expand Down Expand Up @@ -152,7 +152,7 @@ The valid values are :
The lookahead will be done in HLT style by following the paths labelled by every relation from every node in the range specified by :any:`lookahead_extent.full` or :any:`lookahead_extent.partial`.

.. py:attribute:: lookahead_style.felsch
:value: <lookahead_style.hlt: 0>
:value: <lookahead_style.felsch: 1>

The lookahead will be done in Felsch style where every edge is considered in every path labelled by a relation in which it occurs.

Expand Down Expand Up @@ -196,12 +196,12 @@ The valid values are:
.. py:attribute:: def_policy.purge_from_top
:value: <def_policy.purge_from_top: 1>

If the definition stack has size :any:`def_max` and a new definition is generated, then definitions with dead source node are are popped from the top of the stack (if any).
If the definition stack has size :any:`def_max` and a new definition is generated, then definitions with dead source node are popped from the top of the stack (if any).

.. py:attribute:: def_policy.purge_all
:value: <def_policy.purge_all: 2>

If the definition stack has size :any:`def_max` and a new definition is generated, then definitions with dead source node are are popped from the entire of the stack (if any).
If the definition stack has size :any:`def_max` and a new definition is generated, then definitions with dead source node are popped from the entire of the stack (if any).

.. py:attribute:: def_policy.discard_all_if_no_space
:value: <def_policy.discard_all_if_no_space: 3>
Expand Down Expand Up @@ -475,7 +475,7 @@ This function can be used to specify how to handle definitions. For details see
R"pbdoc(
:sig=(self: ToddCoxeter) -> ToddCoxeter.options.def_version:

The current value of the definition policy setting.
The current value of the definition version setting.

:returns:
The current value of the setting.
Expand Down Expand Up @@ -657,7 +657,7 @@ The default value of this setting is ``10 ** 5``.
Set the size of a large collapse.

This function can be used to set what should be considered a "large"
collapse.By default when processing coincidences nodes are merged in the word
collapse. By default when processing coincidences nodes are merged in the word
graph one pair at a time, and the in-neighbours of the surviving node are
updated at the same time. If the number of coincidences is large, then it might
be that a pair of nodes are merged at one step, then the surviving node is
Expand Down Expand Up @@ -969,7 +969,7 @@ lookaheads to be stopped early if the number of nodes being killed is too small
want to stop the lookahead early, since lookaheads take some time but may not
result in many nodes being killed).

The default value is `0.01`
The default value is ``0.01``.

:param val: the proportion of active nodes.
:type val: float
Expand Down Expand Up @@ -1165,7 +1165,7 @@ Set whether or not to perform an HLT-style push of the defining relations at the
If a :any:`ToddCoxeter` instance is defined over a finitely presented semigroup
or monoid and the Felsch strategy is being used, it can be useful to follow all
the paths from the identity labelled by the underlying relations. This setting
specifies whether or not to do this.The default value of this setting is
specifies whether or not to do this. The default value of this setting is
``False``.

:param val: the boolean value.
Expand Down Expand Up @@ -1323,25 +1323,22 @@ The return value of this function indicates the following:
- :any:`Order.none` implies that no standardization has been performed
and:

- the return value of :any:`reduce` will essentially arbitrary;
- the return values of :any:`todd_coxeter.normal_forms` or
:any:`todd_coxeter.normal_forms` will be essentially arbitrary;
- the return value of :any:`reduce` will be essentially arbitrary;
- the return values of :any:`todd_coxeter.normal_forms` will be essentially arbitrary;
- the classes of the congruence will be indexed in an arbitrary order;

- :any:`Order.shortlex` implies that:

- the return value of :any:`reduce` will be the short-lex least word
belonging to a given congruence class;
- the return values of :any:`todd_coxeter.normal_forms` and
:any:`todd_coxeter.normal_forms` will be in
- the return values of :any:`todd_coxeter.normal_forms` will be in
short-lex order;
- the classes of the congruence will be indexed in short-lex order on
the short-lex least word;

- :any:`Order.lex` implies that:

- the return values of :any:`todd_coxeter.normal_forms` and
:any:`todd_coxeter.normal_forms` will be ordered lexicographically.
- the return values of :any:`todd_coxeter.normal_forms` will be ordered lexicographically.
- the return values of :any:`reduce` and the indexes of class are
essentially arbitrary because there is not necessarily a
lexicographically least word in every class;
Expand All @@ -1350,8 +1347,7 @@ The return value of this function indicates the following:

- the return value of :any:`reduce` will be the recursive path least
word belonging to a given congruence class;
- the return values of :any:`todd_coxeter.normal_forms` and
:any:`todd_coxeter.normal_forms` will be ordered by the
- the return values of :any:`todd_coxeter.normal_forms` will be ordered by the
recursive path order;
- the classes of the congruence will be indexed in recursive path order
on the recursive path least word.
Expand All @@ -1375,7 +1371,7 @@ Get the word graph after performing a full congruence enumeration.
In some sense, the purpose of the Todd-Coxeter algorithm is to produce a
:any:`WordGraph` of the action of a set of generators on the classes of a
congruence. This function can be used to obtain that
:any:`WordGraph` instance. This function triggers a full enumeration.The
:any:`WordGraph` instance. This function triggers a full enumeration. The
:any:`WordGraph` returned by this function may be in a rather complicated
state. The active nodes (and nodes) will be :math:`\{0, \ldots, n - 1\}` where
:math:`n` is the number of classes in the congruence if :any:`presentation`
Expand Down
12 changes: 5 additions & 7 deletions src/todd-coxeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ there is no such path, then :any:`UNDEFINED` is returned.

Returns the index of the class containing a word.

This function returns the index of the class containing the word *w* A
This function returns the index of the class containing the word *w*. A
full enumeration is triggered by calls to this function. If the
:any:`current_word_graph` has not already been standardized, then this
function first standardizes it with respect to :any:`Order.shortlex`;
otherwise the existing standardization order is used. The returned index
is obtained by following the path in :any:`current_word_graph` from node
``0`` labelled by the word *w* Since a full enumeration is triggered by
``0`` labelled by the word *w*. Since a full enumeration is triggered by
calls to this function, the word graph is complete, and so the return
value is never :any:`UNDEFINED`.

Expand Down Expand Up @@ -533,7 +533,7 @@ Pro).
Perform a lookbehind using a function to decide whether or not
to collapse nodes.

This function perform a lookbehind using the function *collapser* to decide
This function performs a lookbehind using the function *collapser* to decide
whether or not to collapse nodes. For example, it might be the case that
*collapser* uses a :any:`KnuthBendix` instance to determine whether or
not nodes in the graph represent the same class of the congruence. More
Expand All @@ -549,7 +549,7 @@ function :any:`ToddCoxeter.reduce_no_run`.
a function taking a ``str`` or ``list[int]`` (depending on the type used by
*self* for words) and which returns a word equivalent to the input word in
the congruence represented by *self*.
:type collapser: collections.abc.Callable[[Word], Word])
:type collapser: collections.abc.Callable[[Word], Word]

:returns: *self*
:rtype: ToddCoxeter
Expand Down Expand Up @@ -644,9 +644,7 @@ happens first. See :any:`perform_lookbehind_no_checks` for more details.
a function taking a ``str`` or ``list[int]`` (depending on the type used by
*self* for words) and which returns a word equivalent to the input word in
the congruence represented by *self*.
:type collapser: collections.abc.Callable[[Word], Word])

:returns: A reference to ``*this``.
:type collapser: collections.abc.Callable[[Word], Word]

:returns: *self*
:rtype: ToddCoxeter
Expand Down
Loading