diff --git a/docs/source/changelog-v1.rst b/docs/source/changelog-v1.rst index c537f1bb..d777a8d0 100644 --- a/docs/source/changelog-v1.rst +++ b/docs/source/changelog-v1.rst @@ -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 diff --git a/docs/source/data-structures/presentations/to-inverse-present.rst b/docs/source/data-structures/presentations/to-inverse-present.rst index 4d46b4ec..77bf5d85 100644 --- a/docs/source/data-structures/presentations/to-inverse-present.rst +++ b/docs/source/data-structures/presentations/to-inverse-present.rst @@ -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 diff --git a/docs/source/data-structures/presentations/to-present.rst b/docs/source/data-structures/presentations/to-present.rst index 733c6112..4401204b 100644 --- a/docs/source/data-structures/presentations/to-present.rst +++ b/docs/source/data-structures/presentations/to-present.rst @@ -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 diff --git a/docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst b/docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst index 10b94351..a4122eed 100644 --- a/docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst +++ b/docs/source/main-algorithms/froidure-pin/to-froidure-pin.rst @@ -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). diff --git a/docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst b/docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst index fb5117f9..3b2363db 100644 --- a/docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst +++ b/docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst @@ -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 diff --git a/docs/source/main-algorithms/todd-coxeter/class/init.rst b/docs/source/main-algorithms/todd-coxeter/class/init.rst index c6dec4c4..38334dc4 100644 --- a/docs/source/main-algorithms/todd-coxeter/class/init.rst +++ b/docs/source/main-algorithms/todd-coxeter/class/init.rst @@ -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 diff --git a/docs/source/main-algorithms/todd-coxeter/class/word_to_index.rst b/docs/source/main-algorithms/todd-coxeter/class/word_to_index.rst index b3a01e8d..ba89d597 100644 --- a/docs/source/main-algorithms/todd-coxeter/class/word_to_index.rst +++ b/docs/source/main-algorithms/todd-coxeter/class/word_to_index.rst @@ -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 diff --git a/docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst b/docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst index db91188d..e39cb1a6 100644 --- a/docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst +++ b/docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst @@ -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 @@ -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: diff --git a/src/todd-coxeter-impl.cpp b/src/todd-coxeter-impl.cpp index 0854a7a4..4ae851af 100644 --- a/src/todd-coxeter-impl.cpp +++ b/src/todd-coxeter-impl.cpp @@ -83,7 +83,7 @@ The valid values are : .. py:attribute:: strategy.R_over_C :value: - 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: @@ -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: + :value: The lookahead will be done in Felsch style where every edge is considered in every path labelled by a relation in which it occurs. @@ -196,12 +196,12 @@ The valid values are: .. py:attribute:: def_policy.purge_from_top :value: - 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: - 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: @@ -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. @@ -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 @@ -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 @@ -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. @@ -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; @@ -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. @@ -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` diff --git a/src/todd-coxeter.cpp b/src/todd-coxeter.cpp index d851c3e8..a88b0c19 100644 --- a/src/todd-coxeter.cpp +++ b/src/todd-coxeter.cpp @@ -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`. @@ -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 @@ -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 @@ -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