congruence::ToddCoxeter¶
-
class ToddCoxeter : public libsemigroups::CongruenceInterface, public libsemigroups::detail::CosetManager¶
Defined in
todd-coxeter.hpp.This class contains the main implementation of the Todd-Coxeter algorithm for computing left, right, and 2-sided congruences on semigroups and monoids.
This page contains a summary of the main member functions of the class congruence::ToddCoxeter, and related things in libsemigroups.
In this documentation we use the term “coset enumeration” to mean the execution of (any version of) the Todd-Coxeter algorithm.
Some of the features of this class were inspired by similar features in ACE by George Havas and Colin Ramsay.
See also
congruence_kind and tril.
- Example 1
ToddCoxeter tc(congruence_kind::left); // construct a left congruence tc.set_number_of_generators(2); // 2 generators tc.add_pair({0, 0}, {0}); // generator 0 squared is itself tc.add_pair({0}, {1}); // generator 0 equals 1 tc.strategy(options::strategy::felsch); // set the strategy tc.number_of_classes(); tc.contains({0, 0, 0, 0}, {0, 0}); equal tc.word_to_class_index({0, 0, 0, 0}); tc.standardize(order::lex);
- Example 2
ToddCoxeter tc(congruence_kind::twosided); tc.set_number_of_generators(4); tc.add_pair({0, 0}, {0}); tc.add_pair({1, 0}, {1}); tc.add_pair({0, 1}, {1}); tc.add_pair({2, 0}, {2}); tc.add_pair({0, 2}, {2}); tc.add_pair({3, 0}, {3}); tc.add_pair({0, 3}, {3}); tc.add_pair({1, 1}, {0}); tc.add_pair({2, 3}, {0}); tc.add_pair({2, 2, 2}, {0}); tc.add_pair({1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2}, {0}); tc.add_pair({1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3}, {0}); tc.strategy(options::strategy::hlt) .standardize(false) .lookahead(options::lookahead::partial) .save(false) tc.number_of_classes() // 10752 tc.complete(); // true tc.compatible(); // true auto& S = tc.quotient_semigroup(); // FroidurePin<TCE> S.size() // 10752 S.number_of_idempotents() // 1 tc.standardize(order::recursive); std::vector<word_type>(tc.cbegin_normal_forms(), tc.cbegin_normal_forms() + 10); // {{0}, // {1}, // {2}, // {2, 1}, // {1, 2}, // {1, 2, 1}, // {2, 2}, // {2, 2, 1}, // {2, 1, 2}, // {2, 1, 2, 1}}; tc.standardize(order::lex); std::vector<word_type>(tc.cbegin_normal_forms(), tc.cbegin_normal_forms() + 10); // {{0}, // {0, 1}, // {0, 1, 2}, // {0, 1, 2, 1}, // {0, 1, 2, 1, 2}, // {0, 1, 2, 1, 2, 1}, // {0, 1, 2, 1, 2, 1, 2}, // {0, 1, 2, 1, 2, 1, 2, 1}, // {0, 1, 2, 1, 2, 1, 2, 1, 2}, // {0, 1, 2, 1, 2, 1, 2, 1, 2, 1}};
Member types¶
Type of cosets stored in the table. |
|
Constructors¶
|
Deleted constructors¶
Deleted. |
|
Deleted. |
|
Deleted. |
|
Deleted. |
Initialization¶
Settings¶
Statistics¶
Container-like¶
Standardization¶
Iterators¶
Properties¶
Member functions inherited from CosetManager¶
Member functions inherited from CongruenceInterface¶
|
|
Type for indices of congruence class indices. |
|