Todd-Coxeter¶
This class contains the main implementation of the Todd-Coxeter algorithm for computing left, right, and 2-sided congruences on semigroups and monoids.
This page contains a summary of the main methods of the class ToddCoxeter
.
In this documentation we use the term "coset enumeration" to mean the execution of (any version of) the Todd-Coxeter algorithm.
See also
congruence_kind
and tril
.
>>> from libsemigroups_pybind11 import congruence_kind, ToddCoxeter
>>> tc = ToddCoxeter(congruence_kind.left) # construct a left congruence
>>> tc.set_number_of_generators(2) # 2 generators
>>> tc.add_pair([0, 0], [0]) # generator 0 squared is itself
>>> tc.add_pair([0], [1]) # generator 0 equals 1
>>> tc.strategy(ToddCoxeter.strategy_options.felsch) # set the strategy
<ToddCoxeter object with 2 generators and 2 pairs>
>>> tc.number_of_classes() # calculate number of classes
1
>>> tc.contains([0, 0, 0, 0], [0, 0]) # check if 2 words are equal
True
>>> tc.word_to_class_index([0, 0, 0, 0]) # get the index of a class
0
>>> tc.standardize(ToddCoxeter.order.lex) # standardize to lex order
True
>>> from libsemigroups_pybind11 import congruence_kind, ToddCoxeter
>>> tc = ToddCoxeter(congruence_kind.twosided)
>>> tc.set_number_of_generators(4)
>>> tc.add_pair([0, 0], [0])
>>> tc.add_pair([1, 0], [1])
>>> tc.add_pair([0, 1], [1])
>>> tc.add_pair([2, 0], [2])
>>> tc.add_pair([0, 2], [2])
>>> tc.add_pair([3, 0], [3])
>>> tc.add_pair([0, 3], [3])
>>> tc.add_pair([1, 1], [0])
>>> tc.add_pair([2, 3], [0])
>>> tc.add_pair([2, 2, 2], [0])
>>> tc.add_pair([1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], [0])
>>> tc.add_pair([1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3,
... 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3], [0])
>>> tc.strategy(ToddCoxeter.strategy_options.hlt).standardize(False)
<ToddCoxeter object with 4 generators and 12 pairs>
>>> tc.lookahead(ToddCoxeter.lookahead_options.partial).save(False)
<ToddCoxeter object with 4 generators and 12 pairs>
>>> tc.number_of_classes()
10752
>>> tc.complete()
True
>>> tc.compatible()
True
>>> S = tc.quotient_froidure_pin() # quotient semigroup
>>> S.size()
10752
>>> S.number_of_idempotents()
1
>>> tc.standardize(ToddCoxeter.order.recursive)
True
>>> it = tc.normal_forms()
>>> [next(it) for _ in range(10)]
[[0], [1], [2], [2, 1], [1, 2], [1, 2, 1], [2, 2], [2, 2, 1], [2, 1, 2], [2, 1, 2, 1]]
>>> tc.standardize(ToddCoxeter.order.lex)
True
>>> it = tc.normal_forms()
>>> [next(it) for _ in range(10)]
[[0], [0, 1], [0, 1, 2], [0, 1, 2, 1], [0, 1, 2, 1, 2], [0, 1, 2, 1, 2, 1], [0, 1, 2, 1, 2, 1, 2], [0, 1, 2, 1, 2, 1, 2, 1], [0, 1, 2, 1, 2, 1, 2, 1, 2], [0, 1, 2, 1, 2, 1, 2, 1, 2, 1]]
|
Overloaded function. |
|
Add a generating pair to the congruence. |
|
If the congruence is defined over a semigroup with generators \(A\), then this function defines a injective function from \(\{0, 1, \ldots, n - 1\}\), where \(n\) is the number of classes, or to the non-negative integers \(\{0, 1, \ldots\}\) if this has infinitely many classes, to a fixed set of words over \(A\) representing distinct congruences classes. |
|
Returns |
|
Returns |
|
Check if a pair of words is known to belong to the congruence. |
|
Check if a pair of words belongs to the congruence. |
|
Check if the runner is dead. |
|
Returns |
|
Check if the main algorithm, implemented in this class, has been run to completion or not. |
|
Values for specifying whether to use relations or Cayley graph. |
|
Overloaded function. |
Returns an iterator pointing to the first generating pair of the congruence (if any). |
|
Returns |
|
Returns |
|
Return |
|
Return |
|
Returns |
|
|
Stop running the main algorithm(s) (thread-safe). |
|
Return if the congruence was created as a left, right, or two-sided congruence. |
|
This function returns |
|
Sets the type of lookahead to be used when using the HLT strategy. |
|
Values for specifying the type of lookahead to perform. |
|
Sets a lower bound for the number of classes of the congruence represented by a ToddCoxeter instance. |
|
If the number of cosets active exceeds the value set by this function, then a lookahead, of the type set by lookahead, is triggered. |
Returns the words belonging to non-trivial class with given index. |
|
|
Returns an iterator to the normal forms of the congruence represented by an instance of |
Returns the number of classes in the congruence. |
|
Returns the number of generating pairs added by |
|
Returns the number of generators specified by |
|
Returns the number of non-trivial classes (size > 1) of the congruence. |
|
|
The possible arguments for |
Returns the |
|
Returns a semigroup represented as |
|
|
Sets the duration in nanoseconds that a given randomly selected strategy will run for, when using the random strategy ( |
Randomly shuffle all existing generating pairs. |
|
|
Check if it is time to report. |
|
Set the minimum elapsed time between reports. |
Report why we stopped. |
|
|
Reserves the capacity specified by the argument in the data structures for cosets used in a ToddCoxeter instance. |
|
Run the algorithm until it finishes. |
|
Run for a specified amount of time. |
|
Run until a nullary predicate returns |
|
If the argument of this function is |
|
Set the number of generators of the congruence. |
Release all memory used to store free cosets, and any other unnecessary data if the enumeration is finished. |
|
|
Sorts all existing generating pairs according to the binary function func. |
|
Overloaded function. |
Check if the main algorithm was, or should be, stopped by the nullary predicate passed as first argument to |
|
|
Overloaded function. |
|
Values for defining the strategy. |
|
Check if the main algorithm has or should timed out. |
|
If the congruence, that an object of this type represents, is defined over a semigroup with generators \(A\), then this function defines a surjective function from the set of all words over \(A\) to either \(\{0, 1, \ldots, n - 1\}\), where \(n\) is the number of classes, or to the non-negative integers \(\{0, 1, \ldots\}\) if this has infinitely many classes. |
Returns a string containing a GAP definition of the finitely presented semigroup represented by a |
- class ToddCoxeter(*args, **kwargs)¶
Overloaded function.
__init__(self: _libsemigroups_pybind11.ToddCoxeter, kind: _libsemigroups_pybind11.congruence_kind) -> None
Construct from kind (left/right/2-sided) and options.
Constructs an empty instance of an interface to a congruence of type specified by the argument.
- Parameters
kind (congruence_kind) the handedness of the congruence.
- Complexity
Constant.
See also
__init__(self: _libsemigroups_pybind11.ToddCoxeter, knd: _libsemigroups_pybind11.congruence_kind, tc: _libsemigroups_pybind11.ToddCoxeter) -> None
Construct from kind (left/right/2-sided) and
ToddCoxeter
.This constructor creates a new
ToddCoxeter
instance representing a left, right, or two-sided congruence over the quotient semigroup represented by aToddCoxeter
instance.- Parameters
knd (congruence_kind) the handedness of the congruence.
tc (ToddCoxeter) the
ToddCoxeter
representing the underlying semigroup
- Raises
RuntimeError - if
tc
is a left, or right, congruence, andknd
is not left, or not right, respectively.
__init__(self: _libsemigroups_pybind11.ToddCoxeter, knd: _libsemigroups_pybind11.congruence_kind, kb: _libsemigroups_pybind11.KnuthBendix) -> None
Construct from kind (left/right/2-sided) and
KnuthBendix
.A constructor that creates a new
ToddCoxeter
instance representing a left, right, or two-sided congruence over the semigroup represented by aKnuthBendix
instance.- Parameters
knd (congruence_kind) the handedness of the congruence.
kb (KnuthBendix) the
KnuthBendix
representing the underlying semigroup.
__init__(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.ToddCoxeter) -> None
Copy constructor.
Constructs a complete copy of
that
, including all of the settings, table, defining relations, and generating pairs.- Parameters
that (ToddCoxeter) the ToddCoxeter instance to copy.
__init__(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.congruence_kind, arg1: libsemigroups::FroidurePinBase) -> None
Construct from kind (left/right/2-sided) and FroidurePin.
This constructor creates a
ToddCoxeter
instance representing a left, right, or two-sided congruence over the semigroup represented by aFroidurePin
object.- Parameters
knd (congruence_kind) the kind of the congruence being constructed
fp (FroidurePin) the semigroup over which the congruence is to be defined.
- add_pair(self: _libsemigroups_pybind11.ToddCoxeter, u: List[int], v: List[int]) None ¶
Add a generating pair to the congruence.
- class_index_to_word(self: _libsemigroups_pybind11.ToddCoxeter, i: int) List[int] ¶
If the congruence is defined over a semigroup with generators \(A\), then this function defines a injective function from \(\{0, 1, \ldots, n - 1\}\), where \(n\) is the number of classes, or to the non-negative integers \(\{0, 1, \ldots\}\) if this has infinitely many classes, to a fixed set of words over \(A\) representing distinct congruences classes.
- Parameters
i (int) -- the index of the class whose representative we want to find
- Returns
The word representing the
i
-th class of the congruence
- compatible(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Returns
True
if the coset table is compatible with the relations and generating pairs used to create this, andFalse
if it is not.
- complete(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Returns
True
if the coset table is complete, andFalse
if it is not.
- const_contains(self: _libsemigroups_pybind11.ToddCoxeter, u: List[int], v: List[int]) _libsemigroups_pybind11.tril ¶
Check if a pair of words is known to belong to the congruence.
- Parameters
- Returns
tril.TRUE
if the wordsu
andv
are known to belong to the same congruence classtril.FALSE
if the words are known to not belong to the same congruence classtril.unknown
otherwise.
- contains(self: _libsemigroups_pybind11.ToddCoxeter, u: List[int], v: List[int]) bool ¶
Check if a pair of words belongs to the congruence.
- dead(self: libsemigroups::Runner) bool ¶
Check if the runner is dead.
- Parameters
None
- Returns
A
bool
.
- empty(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Returns
True
if there are no relations or generating pairs in the ToddCoxeter instance, and the number of active cosets is 1 (the minimum possible).
- finished(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Check if the main algorithm, implemented in this class, has been run to completion or not.
- Parameters
None
- Returns
A
bool
.
- class froidure_pin_options(self: _libsemigroups_pybind11.ToddCoxeter.froidure_pin_options, value: int)¶
Values for specifying whether to use relations or Cayley graph.
The values in this enum can be used as the argument for
froidure_pin_policy()
to specify whether the defining relations, or the left/right Cayley graph, of aFroidurePin
instance, should be used in the coset enumeration.If the number of classes in the congruence represented by a
ToddCoxeter
instance is relatively small, by some definition, compared to the size of the semigroup represented by theFroidurePin
instance, then theuse_relations
option is often faster. If the number of classes is relatively large, thenuse_cayley_graph
is often faster.It is guaranteed that run will terminate in an amount of time proportionate to the size of the input if the policy
use_cayley_graph
is used, whereas the run time when using the policyuse_relations
can be arbitrarily high regardless of the size of the input.Members:
- none :
No policy has been specified.
- use_relations :
Use the relations of a
FroidurePin
instance.- use_cayley_graph :
Use the left or right Cayley graph of a
FroidurePin
instance.
- property name¶
- froidure_pin_policy(*args, **kwargs)¶
Overloaded function.
froidure_pin_policy(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.ToddCoxeter.froidure_pin_options) -> _libsemigroups_pybind11.ToddCoxeter
Sets the value of the Froidure-Pin policy specified by the argument
ToddCoxeter.froidure_pin_options
.froidure_pin_policy(self: _libsemigroups_pybind11.ToddCoxeter) -> _libsemigroups_pybind11.ToddCoxeter.froidure_pin_options
Gets the value of the Froidure-Pin policy.
- generating_pairs(self: _libsemigroups_pybind11.ToddCoxeter) Iterator ¶
Returns an iterator pointing to the first generating pair of the congruence (if any).
- Parameters
None
- Returns
An iterator.
- has_parent_froidure_pin(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Returns
True
if the congruence was created from aFroidurePin
instance.- Parameters
None
- Returns
A
bool
.
- has_quotient_froidure_pin(self: libsemigroups::CongruenceInterface) bool ¶
Returns
True
if the congruence knows an isomorphic quotient semigroup represented by an instance ofFroidurePin
.- Parameters
None
- Returns
A
bool
.
- is_quotient_obviously_finite(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Return
True
if the number of classes in the congruence is obviously finite, andFalse
if it is not obviously finite.- Parameters
None
- Returns
A
bool
.
- is_quotient_obviously_infinite(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Return
True
if the number of classes in the congruence is obviously infinite, andFalse
if it is not obviously infinite.- Parameters
None
- Returns
A
bool
.
- is_standardized(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Returns
True
if theToddCoxeter
instance is standardized.
- kill(self: libsemigroups::Runner) None ¶
Stop running the main algorithm(s) (thread-safe).
- Parameters
None
- Returns
(None).
- kind(self: _libsemigroups_pybind11.ToddCoxeter) _libsemigroups_pybind11.congruence_kind ¶
Return if the congruence was created as a left, right, or two-sided congruence.
- Parameters
None
- Returns
- less(self: _libsemigroups_pybind11.ToddCoxeter, u: List[int], v: List[int]) bool ¶
This function returns
True
if the congruence class ofv
is less than the class ofv
in a total ordering of congruence classes.
- lookahead(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.ToddCoxeter.lookahead_options) _libsemigroups_pybind11.ToddCoxeter ¶
Sets the type of lookahead to be used when using the HLT strategy.
- class lookahead_options(self: _libsemigroups_pybind11.ToddCoxeter.lookahead_options, value: int)¶
Values for specifying the type of lookahead to perform.
The values in this enum can be used as the argument for
lookahead()
to specify the type of lookahead that should be performed when using the HLT strategy.Members:
- full :
A full lookahead is one starting from the initial coset. Full lookaheads are therefore sometimes slower but may detect more coincidences than a partial lookahead.
- partial :
A partial lookahead is one starting from the current coset. Partial lookaheads are therefore sometimes faster but may not detect as many coincidences as a full lookahead.
- property name¶
- lower_bound(self: _libsemigroups_pybind11.ToddCoxeter, arg0: int) _libsemigroups_pybind11.ToddCoxeter ¶
Sets a lower bound for the number of classes of the congruence represented by a ToddCoxeter instance.
- next_lookahead(self: _libsemigroups_pybind11.ToddCoxeter, arg0: int) _libsemigroups_pybind11.ToddCoxeter ¶
If the number of cosets active exceeds the value set by this function, then a lookahead, of the type set by lookahead, is triggered.
- non_trivial_classes(self: _libsemigroups_pybind11.ToddCoxeter) Iterator ¶
Returns the words belonging to non-trivial class with given index.
- Parameters
i (int) -- the index of the non-trivial class.
- Returns
A
List[List[int]]
.
- normal_forms(self: _libsemigroups_pybind11.ToddCoxeter) Iterator ¶
Returns an iterator to the normal forms of the congruence represented by an instance of
ToddCoxeter
.
- number_of_classes(self: _libsemigroups_pybind11.ToddCoxeter) int ¶
Returns the number of classes in the congruence.
- Parameters
None
- Returns
The number of congruences classes of this if this number is finite, or
POSITIVE_INFINITY
in some cases if this number is not finite.
- number_of_generating_pairs(self: _libsemigroups_pybind11.ToddCoxeter) int ¶
Returns the number of generating pairs added by
add_pair()
.- Returns
The number of generating pairs of the congruence that an object of this type represents.
- number_of_generators(self: _libsemigroups_pybind11.ToddCoxeter) int ¶
Returns the number of generators specified by
set_number_of_generators()
.- Parameters
None
- Returns
The number of generators of the semigroup of the congruence, or
UNDEFINED
.
- number_of_non_trivial_classes(self: _libsemigroups_pybind11.ToddCoxeter) int ¶
Returns the number of non-trivial classes (size > 1) of the congruence.
- Parameters
None
- Returns
The number of non-trivial classes of the congruence.
- class order(self: _libsemigroups_pybind11.ToddCoxeter.order, value: int)¶
The possible arguments for
standardize()
.The values in this enum can be used as the argument for
standardize()
to specify which ordering should be used. The normal forms for congruence classes are given with respect to one of the orders specified by the values in this enum.Members:
- none :
No standardization has been done.
- shortlex :
Normal forms are the short-lex least word belonging to a given congruence class.
- lex :
Normal forms are the lexicographical least word belonging to a given congruence class.
- recursive :
Normal forms are the recursive-path least word belonging to a given congruence class.
- property name¶
- parent_froidure_pin(self: _libsemigroups_pybind11.ToddCoxeter) libsemigroups::FroidurePinBase ¶
Returns the
FroidurePin
over which the congruence was defined, if it exists.- Parameters
None
- Returns
A
FroidurePin
.
- quotient_froidure_pin(self: _libsemigroups_pybind11.ToddCoxeter) libsemigroups::FroidurePinBase ¶
Returns a semigroup represented as
FroidurePin
that is isomorphic to the quotient of the parent semigroup by the 2-sided congruence that this represents.- Parameters
None
- Returns
A
FroidurePin
.
- random_interval(self: _libsemigroups_pybind11.ToddCoxeter, arg0: datetime.timedelta) _libsemigroups_pybind11.ToddCoxeter ¶
Sets the duration in nanoseconds that a given randomly selected strategy will run for, when using the random strategy (
ToddCoxeter.strategy_options.random
).
- random_shuffle_generating_pairs(self: _libsemigroups_pybind11.ToddCoxeter) _libsemigroups_pybind11.ToddCoxeter ¶
Randomly shuffle all existing generating pairs.
- report(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Check if it is time to report.
- Parameters
None
- Returns
A
bool
.
- report_every(self: _libsemigroups_pybind11.ToddCoxeter, t: datetime.timedelta) None ¶
Set the minimum elapsed time between reports.
- Parameters
t (datetime.timedelta) -- the amount of time between reports.
- Returns
(None)
- report_why_we_stopped(self: _libsemigroups_pybind11.ToddCoxeter) None ¶
Report why we stopped.
- Parameters
None
- Returns
(None)
- reserve(self: _libsemigroups_pybind11.ToddCoxeter, arg0: int) None ¶
Reserves the capacity specified by the argument in the data structures for cosets used in a ToddCoxeter instance.
- run(self: _libsemigroups_pybind11.ToddCoxeter) None ¶
Run the algorithm until it finishes. :Parameters: None
- Returns
(None)
- run_for(self: _libsemigroups_pybind11.ToddCoxeter, t: datetime.timedelta) None ¶
Run for a specified amount of time.
- Parameters
t (datetime.timedelta) -- the time to run for.
- Returns
(None)
>>> from datetime import timedelta >>> from libsemigroups_pybind11 import ToddCoxeter, congruence_kind >>> tc = ToddCoxeter(congruence_kind.twosided) >>> tc.set_number_of_generators(1) >>> tc.add_pair([0] * 1000, [0] * 999) >>> tc.run_for(timedelta(microseconds=10))
- run_until(self: _libsemigroups_pybind11.ToddCoxeter, func: Callable[[], bool]) None ¶
Run until a nullary predicate returns
True
orfinished()
.- Parameters
func (Callable[], bool) -- a function.
- Returns
(None)
- save(self: _libsemigroups_pybind11.ToddCoxeter, arg0: bool) _libsemigroups_pybind11.ToddCoxeter ¶
If the argument of this function is
True
and the HLT strategy is being used, then deductions are processed during the enumeration.
- set_number_of_generators(self: _libsemigroups_pybind11.ToddCoxeter, n: int) None ¶
Set the number of generators of the congruence.
- Parameters
n (int) -- the number of generators.
- Returns
(None)
- shrink_to_fit(self: _libsemigroups_pybind11.ToddCoxeter) None ¶
Release all memory used to store free cosets, and any other unnecessary data if the enumeration is finished.
- sort_generating_pairs(self: _libsemigroups_pybind11.ToddCoxeter, func: Callable[[List[int], List[int]], bool]) _libsemigroups_pybind11.ToddCoxeter ¶
Sorts all existing generating pairs according to the binary function func.
- Parameters
func (Callable[], bool) -- a binary predicate that defines a linear order on the relations in a
ToddCoxeter
instance.
- standardize(*args, **kwargs)¶
Overloaded function.
standardize(self: _libsemigroups_pybind11.ToddCoxeter, arg0: bool) -> _libsemigroups_pybind11.ToddCoxeter
If the argument of this function is
True
, then the coset table is standardized (according to the short-lex order) during the coset enumeration.standardize(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.ToddCoxeter.order) -> bool
If the argument of this function is
True
, then the coset table is standardized (according to the short-lex order) during the coset enumeration.
- stopped_by_predicate(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Check if the main algorithm was, or should be, stopped by the nullary predicate passed as first argument to
run_until()
.- Parameters
None
- Returns
A
bool
.
- strategy(*args, **kwargs)¶
Overloaded function.
strategy(self: _libsemigroups_pybind11.ToddCoxeter) -> _libsemigroups_pybind11.ToddCoxeter.strategy_options
Returns the value of the strategy used during the coset enumeration.
strategy(self: _libsemigroups_pybind11.ToddCoxeter, arg0: _libsemigroups_pybind11.ToddCoxeter.strategy_options) -> _libsemigroups_pybind11.ToddCoxeter
Set the strategy used during the coset enumeration can be specified using this function.
- class strategy_options(self: _libsemigroups_pybind11.ToddCoxeter.strategy_options, value: int)¶
Values for defining the strategy.
The values in this enum can be used as the argument for the method
strategy()
to specify which strategy should be used when performing a coset enumeration.Members:
- hlt :
This value indicates that the HLT (Hazelgrove-Leech-Trotter) strategy should be used. This is analogous to ACE's R-style.
- felsch :
This value indicates that the Felsch strategy should be used. This is analogous to ACE's C-style.
- random :
This value indicates that a random combination of the HLT and Felsch strategies should be used. A random strategy (and associated options) are selected from one of the 10 options:
HLT + full lookahead + no deduction processing + standardization
HLT + full lookahead + deduction processing + standardization
HLT + full lookahead + no deduction processing + no standardization
HLT + full lookahead + deduction processing + no standardization
HLT + partial lookahead + no deduction processing + standardization
HLT + partial lookahead + deduction processing + standardization
HLT + partial lookahead + no deduction processing + no standardization
HLT + partial lookahead + deduction processing + no standardization
Felsch + standardization
Felsch + no standardization
and this strategy is then run for approximately the amount of time specified by the setting
random_interval()
.
- property name¶
- timed_out(self: _libsemigroups_pybind11.ToddCoxeter) bool ¶
Check if the main algorithm has or should timed out.
- Parameters
None
- Returns
A
bool
.
- to_gap_string(self: _libsemigroups_pybind11.ToddCoxeter) str ¶
Returns a string containing a GAP definition of the finitely presented semigroup represented by a
ToddCoxeter
instance.- Parameters
None
- Returns
A string
- word_to_class_index(self: _libsemigroups_pybind11.ToddCoxeter, w: List[int]) int ¶
If the congruence, that an object of this type represents, is defined over a semigroup with generators \(A\), then this function defines a surjective function from the set of all words over \(A\) to either \(\{0, 1, \ldots, n - 1\}\), where \(n\) is the number of classes, or to the non-negative integers \(\{0, 1, \ldots\}\) if this has infinitely many classes.
- Parameters
w (List[int]) -- the word whose class index we want to find.
- Returns
The index of the congruence class corresponding to the word.