class_index_to_word¶
-
word_type libsemigroups::congruence::KnuthBendix::class_index_to_word(class_index_type i)¶
If the congruence, that an object of this type represents, 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.- Complexity
See warning.
Note
CongruenceInterface::word_to_class_index and CongruenceInterface::class_index_to_word are mutually inverse functions.
Warning
The function for finding the structure of a congruence may be non-deterministic, or undecidable, and this function may never return a result.
- Parameters
i – the index of the class whose representative we want to find, a value of type libsemigroups::word_type.
- Throws
LibsemigroupsException – if the specified class index
i
exceeds the total number of classes.std::bad_alloc – if the (possibly infinite) computation uses all the available memory.
- Returns
The word representing the
i-th
class of the congruence