contains

bool libsemigroups::CongruenceByPairsHelper::contains(word_type const &u, word_type const &v)

Check if a pair of words belongs to the congruence.

Return

true if the words u and v belong to the same congruence class, and false 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: if u or v contains a letter that is out of bounds.

  • std::bad_alloc: if the (possibly infinite) computation uses all the available memory.