25#ifndef LIBSEMIGROUPS_PRESENTATION_HPP_
26#define LIBSEMIGROUPS_PRESENTATION_HPP_
31#include <initializer_list>
39#include <unordered_map>
40#include <unordered_set>
44#include "adapters.hpp"
45#include "constants.hpp"
47#include "is_specialization_of.hpp"
52#include "word-range.hpp"
54#include "detail/fmt.hpp"
55#include "detail/print.hpp"
56#include "detail/string.hpp"
57#include "detail/uf.hpp"
102 template <
typename Word>
124 bool _contains_empty_word;
259 template <
typename Return = Presentation&>
261 -> std::enable_if_t<std::is_same_v<std::string, word_type>, Return&> {
271 template <
typename Return = Presentation&>
273 -> std::enable_if_t<std::is_same_v<std::string, word_type>, Return> {
320 LIBSEMIGROUPS_ASSERT(i < _alphabet.size());
353 return _alphabet_map.find(val)->second;
382 return _alphabet_map.find(val) != _alphabet_map.cend();
420 template <
typename Iterator1,
typename Iterator2>
425 rules.emplace_back(lhs_begin, lhs_end);
426 rules.emplace_back(rhs_begin, rhs_end);
444 template <
typename Iterator1,
typename Iterator2>
540 return _contains_empty_word;
563 _contains_empty_word = val;
577 decltype(_alphabet_map) alphabet_map;
607 template <
typename Iterator1,
typename Iterator2>
645 void try_set_alphabet(
decltype(_alphabet_map)& alphabet_map,
648 decltype(_alphabet_map)& alphabet_map)
const;
659 template <
typename Word>
670 template <
typename Word>
697 template <
typename Iterator>
701 "expected even number of words in \"rules\", found {}",
717 template <
typename Word>
740 template <
typename Word>
742 std::string_view arg =
"1st");
757 template <
typename Word>
778 template <
typename Word,
typename Iterator>
783 for (
auto it = first; it != last; ++it) {
802 template <
typename Word>
823 template <
typename Word>
845 template <
typename Word>
870 template <
typename Word1,
typename Word2>
872 Word2
const& inverses) {
901 template <
typename Word1,
typename Word2>
903 Word2
const& letters,
904 Word2
const& inverses);
930 template <
typename Word>
949 template <
typename Word>
969 template <
typename Word>
971 p.
add_rule(lhop.begin(), lhop.end(), rhop.begin(), rhop.end());
1097 template <
typename Word,
typename Letter>
1117 template <
typename Word,
typename Letter>
1142 template <
typename Word,
typename Iterator>
1144 for (
auto it = first; it != last; it += 2) {
1166 template <
typename Word,
typename Iterator>
1170 for (
auto it = first; it != last; it += 2) {
1190 template <
typename Word>
1212 template <
typename Word>
1234 template <
typename Word>
1253 template <
typename Word>
1271 template <
typename Word>
1298 template <
typename Word>
1345 template <
typename Word>
1360 template <
typename Word>
1383 template <
typename Word>
1398 template <
typename Word>
1416 template <
typename Word,
typename Compare>
1433 template <
typename Word,
typename Compare>
1445 template <
typename Word>
1467 template <
typename Word,
typename Compare>
1484 template <
typename Word>
1506 template <
typename Word>
1524 template <
typename Word,
typename Iterator>
1547 template <
typename Word>
1584 template <
typename Word>
1586 Word
const& existing,
1587 Word
const& replacement);
1612 template <
typename Word,
typename Iterator1,
typename Iterator2>
1614 Iterator1 first_existing,
1615 Iterator1 last_existing,
1616 Iterator2 first_replacement,
1617 Iterator2 last_replacement);
1632 char const* existing,
1633 char const* replacement) {
1657 template <
typename Word>
1659 Word
const& existing,
1660 Word
const& replacement);
1678 template <
typename Iterator>
1679 size_t length(Iterator first, Iterator last);
1692 template <
typename Word>
1706 template <
typename Word>
1708 for (
auto& rule : p.
rules) {
1728 template <
typename Word>
1730 for (
auto& rule : p.rules) {
1750 template <
typename Word>
1766 template <
typename Word>
1781 char const* new_alphabet) {
1802 template <
typename Iterator>
1820 template <
typename Word>
1843 template <
typename Iterator>
1861 template <
typename Word>
1881 template <
typename Iterator>
1898 template <
typename Word>
1917 template <
typename Iterator>
1918 typename Iterator::value_type::size_type
1934 template <
typename Word>
1953 template <
typename Word>
1971 template <
typename Word>
1991 template <
typename Word>
2011 template <
typename Word>
2036 template <
typename Word>
2062 template <
typename Word>
2085 template <
typename Word>
2116 template <
typename Word>
2144 template <
typename Word>
2178 template <
typename Word>
2205 template <
typename Word>
2232 template <
typename Word>
2253 template <
typename Word>
2255 Word
const& letters) {
2256 for (
auto x : letters) {
2276 template <
typename Word>
2279 for (
auto x : letters) {
2300 template <
typename Word>
2302 Word
const& letters1,
2303 Word
const& letters2);
2320 template <
typename Word>
2322 Word
const& letters) {
2342 template <
typename Word>
2344 Word
const& letters,
2372 template <
typename Word>
2375 Word
const& alphabet,
2376 Word
const& inverses);
2398 template <
typename Word>
2402 Word
const& inverses) {
2423 template <
typename Word>
2453 template <
typename Word>
2456 Word
const& alphabet,
2457 Word
const& inverses);
2481 template <
typename Word>
2485 Word
const& inverses);
2507 template <
typename Word>
2537 template <
typename Word>
2542 Word
const& alphabet,
2543 Word
const& inverses,
2546 Word rhs = (
id ==
UNDEFINED ? Word({}) : Word({
id}));
2570 template <
typename Word>
2575 Word
const& inverses,
2598 template <
typename Word>
2635 template <
typename Word>
2639 Word
const& alphabet,
2640 Word
const& inverses,
2666 template <
typename Word>
2670 Word
const& inverses,
2696 template <
typename Word>
2730 template <
typename Word1,
typename Word2>
2732 Word2
const& letters,
2733 Word2
const& inverses);
2743 template <
typename Word>
2745 Word
const& letters,
2746 Word
const& inverses) {
2770 template <
typename Word>
2788 std::string_view letters,
2789 std::string_view inverses) {
2806 char const* letters,
2807 char const* inverses) {
2831 template <
typename Word1,
typename Word2>
2833 Word2
const& letters,
2834 Word2
const& inverses) {
2859 template <
typename Word>
2873 template <
typename Word>
2875 Word
const& letters,
2876 Word
const& inverses) {
2897 template <
typename Word>
2922 template <
typename Word1,
typename Word2>
2924 Word2
const& relator);
2933 template <
typename Word>
2935 Word
const& relator) {
2946 char const* relator) {
2948 p, std::string_view(relator));
2971 template <
typename Word1,
typename Word2>
2981 template <
typename Word>
2993 char const* relator) {
2995 p, std::string_view(relator));
3043 template <
typename Word>
3063 template <
typename Word>
3087 template <
typename Word>
3109 template <
typename Word>
3132 template <
typename Word>
3151 template <
typename Word>
3176 template <
typename Word>
3197 template <
typename Word>
3219 template <
typename Word>
3377 template <
typename Word>
3402 template <
typename Word>
3427 template <
typename Word>
3430 return !(lhop == rhop);
3451 template <
typename Word>
3454 return !(lhop == rhop);
3468 template <
typename Word>
3482 template <
typename Word>
3490 template <
typename Result,
typename Word,
typename Func>
3492 std::is_same_v<Presentation<typename Result::word_type>, Result>,
3499 template <
typename Result,
typename Word,
typename Func>
3501 std::is_same_v<InversePresentation<typename Result::word_type>, Result>,
3508 template <
typename Result,
typename Word>
3510 std::is_same_v<Presentation<typename Result::word_type>, Result>
3511 && !std::is_same_v<typename Result::word_type, Word>,
3516 template <
typename Result,
typename Word>
3518 -> std::enable_if_t<std::is_same_v<Presentation<Word>, Result>,
3527 template <
typename Result,
typename Word>
3528 auto to(InversePresentation<Word>
const& ip)
noexcept -> std::enable_if_t<
3529 std::is_same_v<InversePresentation<typename Result::word_type>, Result>
3530 && !std::is_same_v<Word, typename Result::word_type>,
3532 using WordOutput =
typename Result::word_type;
3533 return v4::to<InversePresentation<WordOutput>>(ip, [&ip](
auto val) {
3540 template <
typename Result,
typename Word>
3541 auto to(InversePresentation<Word>
const& ip)
noexcept
3542 -> std::enable_if_t<std::is_same_v<InversePresentation<Word>, Result>,
3551 template <
template <
typename...>
typename Thing,
typename Word>
3553 std::is_same_v<InversePresentation<Word>, Thing<Word>>,
3554 InversePresentation<Word>>;
3559 class GreedyReduceHelper {
3563 std::vector<size_t> _distance_from_root;
3564 std::vector<size_t> _num_leafs;
3565 std::vector<size_t> _scratch;
3566 std::vector<size_t> _suffix_index;
3571 explicit GreedyReduceHelper(Ukkonen
const& u);
3573 GreedyReduceHelper() =
delete;
3574 GreedyReduceHelper(GreedyReduceHelper
const&) =
delete;
3575 GreedyReduceHelper(GreedyReduceHelper&&) =
delete;
3576 GreedyReduceHelper& operator=(GreedyReduceHelper
const&) =
delete;
3577 GreedyReduceHelper& operator=(GreedyReduceHelper&&) =
delete;
3578 ~GreedyReduceHelper();
3580 void pre_order(Ukkonen
const& u,
size_t v);
3581 void post_order(Ukkonen
const& u,
size_t v);
3582 std::pair<const_iterator, const_iterator> yield(Ukkonen
const& u);
3600 template <
typename Thing>
3616 template <
typename Thing>
3622#include "presentation.tpp"
For an implementation of inverse presentations for semigroups or monoids.
Definition presentation.hpp:3220
typename Presentation< Word >::size_type size_type
Size type for rules.
Definition presentation.hpp:3237
typename Presentation< Word >::letter_type letter_type
Type of the letters in the words that constitute the rules of an InversePresentation object.
Definition presentation.hpp:3228
void throw_if_bad_alphabet_rules_or_inverses() const
Check if the InversePresentation is valid.
Definition presentation.hpp:3351
typename Presentation< Word >::iterator iterator
Type of an iterator to either side of a rule.
Definition presentation.hpp:3234
InversePresentation(Presentation< Word > const &p)
Construct an InversePresentation from a Presentation reference.
Definition presentation.hpp:3254
typename Presentation< Word >::word_type word_type
Type of the words in the rules of an InversePresentation object.
Definition presentation.hpp:3224
letter_type inverse(letter_type x) const
Return the inverse of a letter in the alphabet.
InversePresentation & inverses(word_type const &w)
Set the inverse of each letter in the alphabet.
Definition presentation.hpp:3306
InversePresentation(Presentation< Word > &&p)
Construct an InversePresentation from a Presentation rvalue reference.
Definition presentation.hpp:3265
word_type const & inverses() const noexcept
Return the inverse of each letter in the alphabet.
Definition presentation.hpp:3320
InversePresentation & inverses_no_checks(word_type const &w)
Set the inverse of each letter in the alphabet.
typename Presentation< Word >::const_iterator const_iterator
Type of a const iterator to either side of a rule.
Definition presentation.hpp:3231
For an implementation of presentations for semigroups or monoids.
Definition presentation.hpp:103
letter_type add_generator()
Add a generator.
Presentation & remove_generator(letter_type x)
Remove x as a generator.
Presentation & alphabet(word_type &&lphbt)
Set the alphabet from rvalue reference.
void throw_if_bad_alphabet_or_rules() const
Check if the alphabet and rules are valid.
Definition presentation.hpp:639
void throw_if_bad_rules() const
Check if every word in every rule consists only of letters belonging to the alphabet.
Presentation & add_generator_no_checks(letter_type x)
Add x as a generator.
Presentation & add_generator(letter_type x)
Add x as a generator.
Presentation & contains_empty_word(bool val) noexcept
Set whether whether the empty word is a valid relation word.
Definition presentation.hpp:562
typename std::vector< word_type >::size_type size_type
Size type for rules.
Definition presentation.hpp:119
auto alphabet(char const *lphbt) -> std::enable_if_t< std::is_same_v< std::string, word_type >, Return >
Set the alphabet from string literal.
Definition presentation.hpp:272
void throw_if_letter_not_in_alphabet(letter_type c) const
Check if a letter belongs to the alphabet or not.
size_type index_no_checks(letter_type val) const
Return the index of a letter in the alphabet.
Definition presentation.hpp:352
Presentation & alphabet(size_type n)
Set the alphabet by size.
Presentation & alphabet_from_rules()
Set the alphabet to be the letters in the rules.
Presentation & operator=(Presentation &&)
Default move assignment operator.
Presentation & add_rule_no_checks(Iterator1 lhs_begin, Iterator1 lhs_end, Iterator2 rhs_begin, Iterator2 rhs_end)
Add a rule to the presentation.
Definition presentation.hpp:421
typename std::vector< word_type >::iterator iterator
Type of an iterator to either side of a rule.
Definition presentation.hpp:116
Presentation(Presentation const &)
Default copy constructor.
Presentation & alphabet(std::initializer_list< typename word_type::value_type > const &lphbt)
Set the alphabet from std::initializer_list.
Definition presentation.hpp:283
void throw_if_alphabet_has_duplicates() const
Check if the alphabet is valid.
Definition presentation.hpp:576
letter_type letter_no_checks(size_type i) const
Return a letter in the alphabet by index.
Definition presentation.hpp:319
auto alphabet(std::string_view lphbt) -> std::enable_if_t< std::is_same_v< std::string, word_type >, Return & >
Set the alphabet from string_view.
Definition presentation.hpp:260
void throw_if_letter_not_in_alphabet(Iterator1 first, Iterator2 last) const
Check if every letter in a range belongs to the alphabet.
Presentation(Presentation &&)
Default move constructor.
letter_type letter(size_type i) const
Return a letter in the alphabet by index.
std::vector< word_type > rules
Data member holding the rules of the presentation.
Definition presentation.hpp:132
Presentation & operator=(Presentation const &)
Default copy assignment operator.
bool contains_empty_word() const noexcept
Return whether the empty word is a valid relation word.
Definition presentation.hpp:539
Presentation & alphabet(word_type const &lphbt)
Set the alphabet const reference.
size_type index(letter_type val) const
Return the index of a letter in the alphabet.
Presentation & init()
Remove the alphabet and all rules.
word_type const & alphabet() const noexcept
Return the alphabet of the presentation.
Definition presentation.hpp:184
Word word_type
Type of the words in the rules of a Presentation object.
Definition presentation.hpp:106
typename word_type::value_type letter_type
Type of the letters in the words that constitute the rules of a Presentation object.
Definition presentation.hpp:110
Presentation & remove_generator_no_checks(letter_type x)
Remove x as a generator.
Presentation()
Default constructor.
typename std::vector< word_type >::const_iterator const_iterator
Type of a const iterator to either side of a rule.
Definition presentation.hpp:113
Presentation & add_rule(Iterator1 lhs_begin, Iterator1 lhs_end, Iterator2 rhs_begin, Iterator2 rhs_end)
Add a rule to the presentation and check it is valid.
Definition presentation.hpp:445
bool in_alphabet(letter_type val) const
Check if a letter belongs to the alphabet or not.
Definition presentation.hpp:381
typename word_type::const_iterator const_iterator
Alias for word_type iterators.
Definition ukkonen.hpp:106
std::string to_human_readable_repr(Action< Element, Point, Func, Traits, LeftOrRight > const &action)
Return a human readable representation of an Action object.
bool operator!=(Bipartition const &x, Bipartition const &y)
Check bipartitions for inequality.
Definition bipart.hpp:1727
Undefined const UNDEFINED
Value for something undefined.
#define LIBSEMIGROUPS_EXCEPTION(...)
Throw a LibsemigroupsException.
Definition exception.hpp:99
Presentation(Presentation< Word > const &) -> Presentation< Word >
Deduction guide.
bool operator==(Presentation< Word > const &lhop, Presentation< Word > const &rhop)
Compare for equality.
Definition presentation.hpp:3378
static constexpr bool IsPresentation
Helper variable template.
Definition presentation.hpp:3618
static constexpr bool IsInversePresentation
Helper variable template.
Definition presentation.hpp:3602
constexpr bool is_specialization_of_v
Helper variable template for is_specialization_of.
Definition is_specialization_of.hpp:84
std::vector< letter_type > word_type
Type for a word over the generators of a semigroup.
Definition types.hpp:99
Namespace for Presentation helper functions.
Definition obvinf.hpp:61
std::vector< Word >::iterator find_rule(Presentation< Word > &p, Word const &lhs, Word const &rhs)
Find a rule.
Definition presentation.hpp:3065
Iterator::value_type::size_type longest_rule_length(Iterator first, Iterator last)
Return the maximum length of a rule in the given range.
void add_commutes_rules_no_checks(Presentation< Word > &p, Word const &letters1, Word const &letters2)
Add rules so specific letters commute.
Presentation< Word >::letter_type replace_word_with_new_generator(Presentation< Word > &p, Iterator first, Iterator last)
Replace non-overlapping instances of a subword via iterators.
bool reduce_to_2_generators(Presentation< Word > &p, size_t index=0)
Reduce the number of generators in a -relation presentation to 2.
void add_idempotent_rules_no_checks(Presentation< Word > &p, Word const &letters)
Add rules that define each letter as an idempotent.
Definition presentation.hpp:2254
Iterator longest_rule(Iterator first, Iterator last)
Return an iterator pointing at the left-hand side of the first rule of maximal length in the given ra...
void add_involution_rules_no_checks(Presentation< Word > &p, word_type const &letters)
Add rules that define involution.
Definition presentation.hpp:2277
void throw_if_odd_number_of_rules(Iterator first, Iterator last)
Throw if the distance between iterators is not even.
Definition presentation.hpp:698
Word commutator_no_checks(Word const &x, Word const &y, Word const &alphabet, Word const &inverses)
Return the commutator of two words without checks.
size_t index_rule_no_checks(Presentation< Word > const &p, Word const &lhs, Word const &rhs)
Returns the index of a rule or UNDEFINED.
void add_commutator_rule_no_checks(Presentation< Word > &p, Word const &x, Word const &y, Word const &alphabet, Word const &inverses, typename Presentation< Word >::letter_type id=UNDEFINED)
Add a commutator rule without checks.
Definition presentation.hpp:2538
void reverse(Presentation< Word > &p)
Reverse every rule.
Definition presentation.hpp:1707
bool contains_rule(Presentation< Word > &p, Word const &lhs, Word const &rhs)
Check if a presentation contains a rule.
void greedy_reduce_length_and_number_of_gens(Presentation< Word > &p)
Greedily reduce the length and number of generators of the presentation.
Word longest_subword_reducing_length(Presentation< Word > &p)
Return the longest common subword of the rules.
bool sort_each_rule(Presentation< Word > &p)
Sort the left-hand and right-hand side of each rule by shortlex.
bool is_rule(Presentation< Word > const &p, Word const &lhs, Word const &rhs)
Check whether a rule belongs to a presentation.
Definition presentation.hpp:3198
bool are_rules_sorted(Presentation< Word > const &p, Compare cmp)
Check the rules are sorted relative to cmp .
void add_rules(Presentation< Word > &p, Iterator first, Iterator last)
Add the rules stored in the range [first, last).
Definition presentation.hpp:1143
Iterator shortest_rule(Iterator first, Iterator last)
Return an iterator pointing at the left-hand side of the first rule of minimal length in the given ra...
void balance_no_checks(Presentation< Word1 > &p, Word2 const &letters, Word2 const &inverses)
Balance the length of the left-hand and right-hand sides.
Iterator::value_type::size_type shortest_rule_length(Iterator first, Iterator last)
Return the minimum length of a rule in the given range.
void add_commutator_rule(Presentation< Word > &p, Word const &x, Word const &y, Word const &alphabet, Word const &inverses, typename Presentation< Word >::letter_type id=UNDEFINED)
Add a commutator rule.
void balance(Presentation< Word1 > &p, Word2 const &letters, Word2 const &inverses)
Balance the length of the left-hand and right-hand sides.
Definition presentation.hpp:2832
void remove_trivial_rules(Presentation< Word > &p)
Remove rules consisting of identical words.
void throw_if_contains_duplicates(Word const &word, std::string_view where)
Throws an exception if a word contains duplicate letters.
void add_rules_no_checks(Presentation< Word > &p, Iterator first, Iterator last)
Add the rules stored in the range [first, last).
Definition presentation.hpp:1167
void replace_word(Presentation< Word > &p, Word const &existing, Word const &replacement)
Replace instances of a word on either side of a rule by another word.
void add_rule_no_checks(Presentation< Word > &p, Word const &lhop, Word const &rhop)
Add a rule to the presentation by reference.
Definition presentation.hpp:950
void throw_if_bad_rules(Presentation< Word > const &p, Iterator first, Iterator last)
Check rules against the alphabet of p.
Definition presentation.hpp:779
void try_detect_group_inverses(Presentation< Word > const &p, Word &letters, Word &inverses)
Try to detect group inverses.
void sort_rules(Presentation< Word > &p, Compare cmp)
Sort all of the rules by cmp.
void replace_subword(Presentation< Word > &p, Word const &existing, Word const &replacement)
Replace non-overlapping instances of a subword by another word.
void add_identity_rules(Presentation< Word > &p, typename Presentation< Word >::letter_type e)
Add rules for an identity element.
Presentation< Word >::letter_type make_semigroup(Presentation< Word > &p)
Convert a monoid presentation to a semigroup presentation.
void reduce_complements(Presentation< Word > &p)
If there are rules and where , then replace by .
void normalize_alphabet(Presentation< Word > &p)
Normalize the alphabet to .
bool strongly_compress(Presentation< Word > &p)
Strongly compress a -relation presentation.
bool is_rule_no_checks(Presentation< Word > const &p, Word const &lhs, Word const &rhs)
Check whether a rule belongs to a presentation.
Definition presentation.hpp:3177
Word commutator(Word const &x, Word const &y, Word const &alphabet, Word const &inverses)
Return the commutator of two words.
void add_cyclic_conjugates(Presentation< Word1 > &p, Word2 const &relator)
Add all cyclic permutations of a word as relators in a presentation.
void remove_redundant_generators(Presentation< Word > &p)
Remove any trivially redundant generators.
void throw_if_word_not_over_alphabet(Word const &alphabet, Word const &word)
Throws an exception if a word is not over an alphabet.
std::vector< Word >::iterator find_rule_no_checks(Presentation< Word > &p, Word const &lhs, Word const &rhs)
Find a rule.
void greedy_reduce_length(Presentation< Word > &p)
Greedily reduce the length of the presentation using longest_subword_reducing_length.
void change_alphabet(Presentation< Word > &, Word const &)
Change or re-order the alphabet.
void add_inverse_rules(Presentation< Word > &p, Word const &vals, typename Presentation< Word >::letter_type e=UNDEFINED)
Add rules for inverses.
bool is_strongly_compressible(Presentation< Word > const &p)
Return true if the -relation presentation can be strongly compressed.
void throw_if_bad_inverses(Word const &alphabet, Word const &inverses)
Throws an exception if the argument inverses does not define valid inverses for alphabet.
void remove_duplicate_rules(Presentation< Word > &p)
Remove duplicate rules.
size_t length(Iterator first, Iterator last)
Return the sum of the lengths of all values in the range [first, last).
std::string to_report_string(Presentation< Word > const &p)
Return a representation of a presentation to appear in the reporting output.
Presentation< Word >::letter_type first_unused_letter(Presentation< Word > const &p)
Return the first letter not in the alphabet of a presentation.
void add_cyclic_conjugates_no_checks(Presentation< Word1 > &p, Word2 const &relator)
Add all cyclic permutations of a word as relators in a presentation.
void try_detect_inverses(Presentation< Word > const &p, Word &letters, Word &inverses)
Try to detect group inverses.
Definition presentation.hpp:2179
bool is_normalized(Presentation< Word > const &p)
Check if the presentation is normalized.
void add_rule(Presentation< Word > &p, Word const &lhop, Word const &rhop)
Add a rule to the presentation by reference and check.
Definition presentation.hpp:970
void throw_if_not_normalized(Presentation< Word > const &p, std::string_view arg="1st")
Throws if the presentation isn't normalized.
size_t index_rule(Presentation< Word > const &p, Word const &lhs, Word const &rhs)
Returns the index of a rule or UNDEFINED.
Definition presentation.hpp:3152
void add_zero_rules(Presentation< Word > &p, typename Presentation< Word >::letter_type z)
Add rules for a zero element.
std::string to_gap_string(Presentation< word_type > const &p, std::string const &var_name)
Return the code that would create p in GAP.
Namespace containing some operators for creating words.
Definition word-range.hpp:2113
Word::value_type human_readable_letter(size_t i)
Returns a character by index in human readable order.
Definition word-range.hpp:2149
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.
Empty base for presentation-like classes.
Definition presentation.hpp:78
A stateless struct with binary call operator using shortlex_compare.
Definition order.hpp:380