size

virtual uint64_t libsemigroups::fpsemigroup::KnuthBendix::size() override

Returns the size of the finitely presented semigroup.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

See warning.

Parameters

(None)

Note

If this has been run until finished, then this function can determine the size of the semigroup represented by this even if it is infinite. Moreover, the complexity of this function is at worst \(O(mn)\) where \(m\) is the number of letters in the alphabet, and \(n\) is the number of nodes in the KnuthBendix::gilman_digraph.

Warning

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

Returns

A uint64_t, the value of which equals the size of this if this number is finite, or libsemigroups::POSITIVE_INFINITY in some cases if this number is not finite.