Presentation

template<typename W>
class Presentation : public libsemigroups::PresentationBase

Defined in present.hpp.

This class template can be used to construction presentations for semigroups or monoids and is intended to be used as the input to other algorithms in libsemigroups. The idea is to provide a shallow wrapper around a vector of words of type W. We refer to this vector of words as the rules of the presentation. The Presentation class template also provide some checks that the rules really defines a presentation, (i.e. it’s consistent with its alphabet), and some related functionality is available in the namespace libsemigroups::presentation.

Template Parameters

W – the type of the underlying words.

Member types

const_iterator

Type of a const iterator to either side of a rule.

iterator

Type of an iterator to either side of a rule.

letter_type

The type of the letters in the words that constitute the rules of a Presentation object.

size_type

Size type for rules.

word_type

The type of the words in the rules of a Presentation object.

Constructors

Presentation()

Default constructor.

Presentation(Presentation &&) = default

Default move constructor.

Presentation(Presentation const &) = default

Default copy constructor.

clear()

Remove the alphabet and all rules.

operator=(Presentation &&) = default

Default move assignment operator.

operator=(Presentation const &) = default

Default copy assignment operator.

Alphabet + letters

alphabet() const noexcept

Returns the alphabet of the presentation.

alphabet(size_type)

Set the alphabet by size.

alphabet(word_type const&)

Set the alphabet const reference.

alphabet(word_type&&)

Set the alphabet from rvalue reference.

alphabet_from_rules()

Set the alphabet to be the letters in the rules.

contains_empty_word() const noexcept

Check if the presentation should contain the empty word.

contains_empty_word(bool) noexcept

Specify that the presentation should (not) contain the empty word.

in_alphabet(letter_type) const

Check if a letter belongs to the alphabet or not.

index(letter_type) const

Get the index of a letter in the alphabet.

letter(size_type) const

Get a letter in the alphabet by index.

Rules

add_rule(S,S,T,T)

Add a rule to the presentation.

add_rule_and_check(S,S,T,T)

Add a rule to the presentation and check it is valid.

rules

Data member holding the rules of the presentation.

Validation

validate() const

Check if the alphabet and rules are valid.

validate_alphabet() const

Check if the alphabet is valid.

validate_letter(letter_type) const

Check if a letter belongs to the alphabet or not.

validate_rules() const

Check if every rule consists of letters belonging to the alphabet.

validate_word(T, T) const

Check if every letter in a range belongs to the alphabet.