Word to class index
This page contains documentation for the member functions of ToddCoxeter
that can be used to convert a word into the index of congruence class.
- ToddCoxeter.current_index_of(self: ToddCoxeter, w: list[int] | str) int | Undefined
- Returns the current index of the class containing a word. - This function returns the current index of the class containing the word w No enumeration is triggered by calls to this function. Unless - Runner.finishedreturns- True, the index returned by this function is essentially arbitrary, and can only really be used to check whether or not two words are currently known to belong to the congruence. The returned index is obtained by following the path in- current_word_graphfrom node- 0labelled by the word w. If there is no such path, then- UNDEFINEDis returned.- Parameters:
- Returns:
- The current index of the class containing the word. 
- Return type:
- Raises:
- LibsemigroupsError – if any of the values in w is out of range, i.e. they do not belong to - presentation().alphabet()and- Presentation.throw_if_letter_not_in_alphabetraises.
 
- ToddCoxeter.index_of(self: ToddCoxeter, w: list[int] | str) int
- Returns the index of the class containing a word. - This function returns the index of the class containing the word w A full enumeration is triggered by calls to this function. If the - current_word_graphhas not already been standardized, then this function first standardizes it with respect to- Order.shortlex; otherwise the existing standardization order is used. The returned index is obtained by following the path in- current_word_graphfrom node- 0labelled 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- UNDEFINED.- Parameters:
- Returns:
- The index of the class containing the word. 
- Return type:
- Raises:
- LibsemigroupsError – if any of the values in w, i.e. they do not belong to - presentation().alphabet()and- Presentation.throw_if_letter_not_in_alphabetraises.