Skip to content

Commit 2a64384

Browse files
Fix ToddCoxeter doc issues
Co-authored-by: Codex <codex@openai.com>
1 parent 4147d43 commit 2a64384

File tree

5 files changed

+23
-29
lines changed

5 files changed

+23
-29
lines changed

docs/source/main-algorithms/todd-coxeter/class/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Constructors + initializers
1111
===========================
1212

13-
This page documents the constructors and initialisers for the :any:`ToddCoxeter`
13+
This page documents the constructors and initializers for the :any:`ToddCoxeter`
1414
class.
1515

1616
Every constructor has a matching init function with the same signature that can

docs/source/main-algorithms/todd-coxeter/class/word_to_index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Word to class index
1111
===================
1212

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

1616
.. automethod:: ToddCoxeter.current_index_of
1717

docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This function converts the :any:`FroidurePin` object *fpb* into a
5656
either the :any:`FroidurePin.left_cayley_graph` or the
5757
:any:`FroidurePin.right_cayley_graph` of *fpb*).
5858

59-
This returned :any:`ToddCoxeter` object represents the trivial congruence over
59+
The returned :any:`ToddCoxeter` object represents the trivial congruence over
6060
the semigroup defined by *fpb*.
6161

6262
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
111111
:any:`ToddCoxeter` object using the right Cayley graph of the semigroup
112112
represented by *kb*.
113113

114-
This returned :any:`ToddCoxeter` object represents the trivial congruence over
114+
The returned :any:`ToddCoxeter` object represents the trivial congruence over
115115
the semigroup defined by *kb*.
116116

117117
This will throw a :any:`LibsemigroupsError` if either:

src/todd-coxeter-impl.cpp

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The valid values are :
8383
.. py:attribute:: strategy.R_over_C
8484
:value: <strategy.R_over_C: 3>
8585
86-
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.
86+
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.
8787
8888
.. py:attribute:: strategy.Cr
8989
:value: <strategy.Cr: 4>
@@ -152,7 +152,7 @@ The valid values are :
152152
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`.
153153
154154
.. py:attribute:: lookahead_style.felsch
155-
:value: <lookahead_style.hlt: 0>
155+
:value: <lookahead_style.felsch: 1>
156156
157157
The lookahead will be done in Felsch style where every edge is considered in every path labelled by a relation in which it occurs.
158158
@@ -196,12 +196,12 @@ The valid values are:
196196
.. py:attribute:: def_policy.purge_from_top
197197
:value: <def_policy.purge_from_top: 1>
198198
199-
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).
199+
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).
200200
201201
.. py:attribute:: def_policy.purge_all
202202
:value: <def_policy.purge_all: 2>
203203
204-
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).
204+
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).
205205
206206
.. py:attribute:: def_policy.discard_all_if_no_space
207207
:value: <def_policy.discard_all_if_no_space: 3>
@@ -475,7 +475,7 @@ This function can be used to specify how to handle definitions. For details see
475475
R"pbdoc(
476476
:sig=(self: ToddCoxeter) -> ToddCoxeter.options.def_version:
477477
478-
The current value of the definition policy setting.
478+
The current value of the definition version setting.
479479
480480
:returns:
481481
The current value of the setting.
@@ -657,7 +657,7 @@ The default value of this setting is ``10 ** 5``.
657657
Set the size of a large collapse.
658658
659659
This function can be used to set what should be considered a "large"
660-
collapse.By default when processing coincidences nodes are merged in the word
660+
collapse. By default when processing coincidences nodes are merged in the word
661661
graph one pair at a time, and the in-neighbours of the surviving node are
662662
updated at the same time. If the number of coincidences is large, then it might
663663
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
969969
want to stop the lookahead early, since lookaheads take some time but may not
970970
result in many nodes being killed).
971971
972-
The default value is `0.01`
972+
The default value is ``0.01``.
973973
974974
:param val: the proportion of active nodes.
975975
:type val: float
@@ -1165,7 +1165,7 @@ Set whether or not to perform an HLT-style push of the defining relations at the
11651165
If a :any:`ToddCoxeter` instance is defined over a finitely presented semigroup
11661166
or monoid and the Felsch strategy is being used, it can be useful to follow all
11671167
the paths from the identity labelled by the underlying relations. This setting
1168-
specifies whether or not to do this.The default value of this setting is
1168+
specifies whether or not to do this. The default value of this setting is
11691169
``False``.
11701170
11711171
:param val: the boolean value.
@@ -1323,25 +1323,22 @@ The return value of this function indicates the following:
13231323
- :any:`Order.none` implies that no standardization has been performed
13241324
and:
13251325
1326-
- the return value of :any:`reduce` will essentially arbitrary;
1327-
- the return values of :any:`todd_coxeter.normal_forms` or
1328-
:any:`todd_coxeter.normal_forms` will be essentially arbitrary;
1326+
- the return value of :any:`reduce` will be essentially arbitrary;
1327+
- the return values of :any:`todd_coxeter.normal_forms` will be essentially arbitrary;
13291328
- the classes of the congruence will be indexed in an arbitrary order;
13301329
13311330
- :any:`Order.shortlex` implies that:
13321331
13331332
- the return value of :any:`reduce` will be the short-lex least word
13341333
belonging to a given congruence class;
1335-
- the return values of :any:`todd_coxeter.normal_forms` and
1336-
:any:`todd_coxeter.normal_forms` will be in
1334+
- the return values of :any:`todd_coxeter.normal_forms` will be in
13371335
short-lex order;
13381336
- the classes of the congruence will be indexed in short-lex order on
13391337
the short-lex least word;
13401338
13411339
- :any:`Order.lex` implies that:
13421340
1343-
- the return values of :any:`todd_coxeter.normal_forms` and
1344-
:any:`todd_coxeter.normal_forms` will be ordered lexicographically.
1341+
- the return values of :any:`todd_coxeter.normal_forms` will be ordered lexicographically.
13451342
- the return values of :any:`reduce` and the indexes of class are
13461343
essentially arbitrary because there is not necessarily a
13471344
lexicographically least word in every class;
@@ -1350,8 +1347,7 @@ The return value of this function indicates the following:
13501347
13511348
- the return value of :any:`reduce` will be the recursive path least
13521349
word belonging to a given congruence class;
1353-
- the return values of :any:`todd_coxeter.normal_forms` and
1354-
:any:`todd_coxeter.normal_forms` will be ordered by the
1350+
- the return values of :any:`todd_coxeter.normal_forms` will be ordered by the
13551351
recursive path order;
13561352
- the classes of the congruence will be indexed in recursive path order
13571353
on the recursive path least word.
@@ -1375,7 +1371,7 @@ Get the word graph after performing a full congruence enumeration.
13751371
In some sense, the purpose of the Todd-Coxeter algorithm is to produce a
13761372
:any:`WordGraph` of the action of a set of generators on the classes of a
13771373
congruence. This function can be used to obtain that
1378-
:any:`WordGraph` instance. This function triggers a full enumeration.The
1374+
:any:`WordGraph` instance. This function triggers a full enumeration. The
13791375
:any:`WordGraph` returned by this function may be in a rather complicated
13801376
state. The active nodes (and nodes) will be :math:`\{0, \ldots, n - 1\}` where
13811377
:math:`n` is the number of classes in the congruence if :any:`presentation`

src/todd-coxeter.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ there is no such path, then :any:`UNDEFINED` is returned.
306306
307307
Returns the index of the class containing a word.
308308
309-
This function returns the index of the class containing the word *w* A
309+
This function returns the index of the class containing the word *w*. A
310310
full enumeration is triggered by calls to this function. If the
311311
:any:`current_word_graph` has not already been standardized, then this
312312
function first standardizes it with respect to :any:`Order.shortlex`;
313313
otherwise the existing standardization order is used. The returned index
314314
is obtained by following the path in :any:`current_word_graph` from node
315-
``0`` labelled by the word *w* Since a full enumeration is triggered by
315+
``0`` labelled by the word *w*. Since a full enumeration is triggered by
316316
calls to this function, the word graph is complete, and so the return
317317
value is never :any:`UNDEFINED`.
318318
@@ -533,7 +533,7 @@ Pro).
533533
Perform a lookbehind using a function to decide whether or not
534534
to collapse nodes.
535535
536-
This function perform a lookbehind using the function *collapser* to decide
536+
This function performs a lookbehind using the function *collapser* to decide
537537
whether or not to collapse nodes. For example, it might be the case that
538538
*collapser* uses a :any:`KnuthBendix` instance to determine whether or
539539
not nodes in the graph represent the same class of the congruence. More
@@ -549,7 +549,7 @@ function :any:`ToddCoxeter.reduce_no_run`.
549549
a function taking a ``str`` or ``list[int]`` (depending on the type used by
550550
*self* for words) and which returns a word equivalent to the input word in
551551
the congruence represented by *self*.
552-
:type collapser: collections.abc.Callable[[Word], Word])
552+
:type collapser: collections.abc.Callable[[Word], Word]
553553
554554
:returns: *self*
555555
:rtype: ToddCoxeter
@@ -644,9 +644,7 @@ happens first. See :any:`perform_lookbehind_no_checks` for more details.
644644
a function taking a ``str`` or ``list[int]`` (depending on the type used by
645645
*self* for words) and which returns a word equivalent to the input word in
646646
the congruence represented by *self*.
647-
:type collapser: collections.abc.Callable[[Word], Word])
648-
649-
:returns: A reference to ``*this``.
647+
:type collapser: collections.abc.Callable[[Word], Word]
650648
651649
:returns: *self*
652650
:rtype: ToddCoxeter

0 commit comments

Comments
 (0)