contains¶
-
bool
libsemigroups::congruence::KnuthBendix
::
contains
(word_type const&, word_type const&) override¶ Check if a pair of words belongs to the congruence.
- Return
true
if the wordsu
andv
belong to the same congruence class, andfalse
otherwise.- Complexity
See warning.
- Warning
The problem of determining the return value of this function is undecidable in general, and this function may never terminate.
- Parameters
u
: a word (vector of integers) over the generators of the semigroup.v
: a word (vector of integers) over the generators of the semigroup.
- Exceptions
LibsemigroupsException
: ifu
orv
contains a letter that is out of bounds.std::bad_alloc
: if the (possibly infinite) computation uses all the available memory.