KnuthBendixCongruenceByPairs

class KnuthBendixCongruenceByPairs : public libsemigroups::CongruenceByPairs<FroidurePin<detail::KBE, FroidurePinTraits<detail::KBE, fpsemigroup::KnuthBendix>>>

Defined in cong-pair.hpp.

On this page, we describe the functionality relating to the brute force enumeration of pairs of elements belonging to a congruence (of any type) that is implemented in the class KnuthBendixCongruenceByPairs. This class is derived from CongruenceByPairs and implements the same algorithm. The only difference is that KnuthBendixCongruenceByPairs runs the Knuth-Bendix algorithm (see fpsemigroup::KnuthBendix) to completion, and then runs the brute force enumeration of pairs on the semigroup represented by the output of fpsemigroup::KnuthBendix. If the semigroup represented by the output of fpsemigroup::KnuthBendix is infinite, but the number of pairs belonging to the congruence represented by a KnuthBendixCongruenceByPairs instance is finite, then KnuthBendixCongruenceByPairs will terminate eventually, where as CongruenceByPairs would not (since it would attempt to enumerate the infinite semigroup represented by the output of fpsemigroup::KnuthBendix first).

Example
fpsemigroup::KnuthBendix kb;
kb.set_alphabet(3);
kb.add_rule({0, 1}, {1, 0});
kb.add_rule({0, 2}, {2, 0});
kb.add_rule({0, 0}, {0});
kb.add_rule({0, 2}, {0});
kb.add_rule({2, 0}, {0});
kb.add_rule({1, 2}, {2, 1});
kb.add_rule({1, 1, 1}, {1});
kb.add_rule({1, 2}, {1});
kb.add_rule({2, 1}, {1});

KnuthBendixCongruenceByPairs kbp(twosided, kb);
kbp.add_pair({0}, {1});

kbp.number_of_non_trivial_classes();  // == 1
kbp.cbegin_ntc()->size();      // == 5

Member types

class_index_type

Type for indices of congruence class indices.

const_iterator

non_trivial_class_iterator

non_trivial_classes_type

Constructors

KnuthBendixCongruenceByPairs(congruence_kind,KnuthBendix const &) noexcept

KnuthBendixCongruenceByPairs(congruence_kind,std::shared_ptr<KnuthBendix>) noexcept

Construct a KnuthBendixCongruenceByPairs over the fpsemigroup::KnuthBendix instance kb representing a left/right/2-sided congruence according to type.

Deleted constructors

KnuthBendixCongruenceByPairs() = delete

Deleted.

KnuthBendixCongruenceByPairs(KnuthBendixCongruenceByPairs &&) = delete

Deleted.

KnuthBendixCongruenceByPairs(KnuthBendixCongruenceByPairs const &) = delete

Deleted.

operator=(KnuthBendixCongruenceByPairs &&) = delete

Deleted.

operator=(KnuthBendixCongruenceByPairs const &) = delete

Deleted.

Member functions inherited from CongruenceInterface

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

add_pair(word_type const&, word_type const&)

cbegin_generating_pairs() const noexcept

cbegin_ntc()

cend_generating_pairs() const noexcept

cend_ntc()

class_index_to_word(class_index_type)

const_contains(word_type const&, word_type const&) const

contains(word_type const&, word_type const&)

has_parent_fpsemigroup() const noexcept

has_parent_froidure_pin() const noexcept

has_quotient_froidure_pin() const noexcept

is_quotient_obviously_finite()

is_quotient_obviously_infinite()

kind() const noexcept

less(word_type const&, word_type const&)

non_trivial_classes()

number_of_classes()

number_of_generating_pairs() const noexcept

number_of_generators() const noexcept

number_of_non_trivial_classes()

parent_fpsemigroup() const

parent_froidure_pin() const

quotient_froidure_pin()

set_number_of_generators(size_t)

word_to_class_index(word_type const&)

Member functions inherited from Runner

dead() const noexcept

finished() const

kill() noexcept

report() const

report_every() const noexcept

report_every(TIntType)

report_every(std::chrono::nanoseconds)

report_why_we_stopped() const

run()

run_for(TIntType)

run_for(std::chrono::nanoseconds)

run_until(T&&)

run_until(bool(*)())

running() const noexcept

running_for() const noexcept

running_until() const noexcept

started() const

stopped() const

stopped_by_predicate() const

timed_out() const