less

bool libsemigroups::congruence::ToddCoxeter::less(word_type const &u, word_type const &v)

This function returns true if the congruence class of v is less than the class of v in a total ordering of congruence classes.

Return

true if the class of u is less than that of .

Complexity

See warning.

Warning

The problem of determining the return value of this function is undecidable in general, and this function may never terminate.

Possible Implementation

bool less(word_type const& u, word_type const& v) {
  return word_to_class_index(u) < word_to_class_index(v);
}

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.