FpSemigroupInterface

class FpSemigroupInterface : public libsemigroups::Runner

Defined in fpsemi-intf.hpp.

Every class for representing a finitely presented semigroup or monoid in libsemigroups is derived from FpSemigroupInterface, which holds the member functions that are common to all its derived classes. FpSemigroupInterface is an abstract class.

Subclassed by libsemigroups::CongruenceWrapper< T >, libsemigroups::FpSemigroup, libsemigroups::fpsemigroup::Kambites< T >, libsemigroups::fpsemigroup::KnuthBendix

Member types

char_type

Type for characters.

const_iterator

Type for const iterators to the defining rules.

rule_type

Type for rules.

string_type

Type for strings.

Constructors

FpSemigroupInterface()

Construct an empty finitely presented semigroup object.

FpSemigroupInterface(FpSemigroupInterface const&) = default

Default copy constructor.

FpSemigroupInterface(FpSemigroupInterface&&) = default

Deleted.

Deleted constructors

operator=(FpSemigroupInterface const&) = delete

Deleted.

operator=(FpSemigroupInterface&&) = delete

Deleted.

Pure virtual member functions

equal_to(std::string const&, std::string const&) = 0

Check if two strings represent the same element.

normal_form(std::string const&) = 0

Returns a normal form for a string.

size() = 0

Returns the size of the finitely presented semigroup.

Validation

validate_letter(char) const

Validates a letter specified by a char.

validate_letter(letter_type) const

Validates a letter specified by an integer.

validate_word(std::string const&) const

Validates a word given by a std::string.

validate_word(word_type const&) const

Validates a word given by a word_type .

Initialization

add_rule(relation_type)

Add a rule using a relation_type .

add_rule(rule_type)

Add a rule using a rule_type .

add_rule(std::initializer_list<size_t>, std::initializer_list<size_t>)

Add a rule using two word_type const references.

add_rule(std::string const&, std::string const&)

Add a rule using two std::string const references.

add_rule(word_type const&, word_type const&)

Add a rule using two word_type const references.

add_rules(FroidurePinBase&)

Add rules from a FroidurePin instance.

add_rules(std::vector<rule_type> const&)

Add rules in a vector.

alphabet() const noexcept

Returns a const reference to the alphabet.

alphabet(size_t) const

Returns the i th letter of the alphabet.

has_identity() const noexcept

Check if an identity has been set.

identity() const

Returns the identity (if any).

inverses() const

Returns the inverses (if any).

number_of_rules() const noexcept

Returns the number of rules.

set_alphabet(size_t)

Set the size of the alphabet.

set_alphabet(std::string const&)

Set the alphabet of the finitely presented semigroup.

set_identity(letter_type)

Set a character in alphabet() to be the identity using its index.

set_identity(std::string const&)

Set a character in alphabet() to be the identity.

set_inverses(std::string const&)

Set the inverses of letters in alphabet() .

Normal forms and equality testing

equal_to(std::initializer_list<letter_type>, std::initializer_list<letter_type>)

Check if two words represent the same element.

equal_to(word_type const&, word_type const&)

Check if two words represent the same element.

normal_form(std::initializer_list<letter_type>)

Returns a normal form for a word_type .

normal_form(word_type const&)

Returns a normal form for a word_type .

Words to strings and vice versa

char_to_uint(char) const

Convert a char to a letter_type .

string_to_word(std::string const&) const

Convert a string to a word_type .

uint_to_char(letter_type) const

Convert a letter_type to a char.

word_to_string(word_type const&) const

Convert a word_type to a std::string.

Size

is_obviously_finite()

Check if the finitely presented semigroup is obviously finite.

is_obviously_infinite()

Check if the finitely presented semigroup is obviously infinite.

Iterators

cbegin_rules() const noexcept

Returns an iterator pointing to the first rule.

cend_rules() const noexcept

Returns an iterator pointing one past the last rule.

Miscellanea

to_gap_string()

Returns a string containing GAP commands for defining a finitely presented semigroup.

Member functions inherited from Runner

dead() const noexcept

Check if the runner is dead.

finished() const

Check if run has been run to completion or not.

kill() noexcept

Stop run from running (thread-safe).

report() const

Check if it is time to report.

report_every() const noexcept

Get the minimum elapsed time between reports.

report_every(TIntType)

Set the minimum elapsed time between reports.

report_every(std::chrono::nanoseconds)

Set the minimum elapsed time between reports.

report_why_we_stopped() const

Report why run stopped.

run()

Run until finished .

run_for(TIntType)

Run for a specified amount of time.

run_for(std::chrono::nanoseconds)

Run for a specified amount of time.

run_until(T&&)

Run until a nullary predicate returns true or finished .

run_until(bool(*)())

Run until a nullary predicate returns true or finished .

running() const noexcept

Check if currently running.

running_for() const noexcept

Check if the runner is currently running for a particular length of time.

running_until() const noexcept

Check if the runner is currently running until a nullary predicate returns true.

started() const

Check if run has been called at least once before.

stopped() const

Check if the runner is stopped.

stopped_by_predicate() const

Check if the runner was, or should, stop because of the argument for run_until .

timed_out() const

Check if the amount of time passed to run_for has elapsed.