![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
This page contains documentation of the member functions of KnuthBendix that are implemented in all of the classes Congruence, Kambites, KnuthBendix, and ToddCoxeter.
Functions | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
KnuthBendix & | add_generating_pair (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) |
Add generating pair via iterators. | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
KnuthBendix & | add_generating_pair_no_checks (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) |
Add generating pair via iterators. | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
bool | contains (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) |
Check containment of a pair of words via iterators. | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
bool | contains_no_checks (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) |
Check containment of a pair of words via iterators. | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
tril | currently_contains (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) const |
Check containment of a pair of words via iterators. | |
template<typename Iterator1, typename Iterator2, typename Iterator3, typename Iterator4> | |
tril | currently_contains_no_checks (Iterator1 first1, Iterator2 last1, Iterator3 first2, Iterator4 last2) const |
Check containment of a pair of words via iterators. | |
std::vector< Word > const & | generating_pairs () const noexcept |
Get the generating pairs of the congruence (if any). | |
congruence_kind | kind () const noexcept |
The kind of the congruence (1- or 2-sided). | |
uint64_t | number_of_classes () |
Compute the number of classes in the congruence. | |
size_t | number_of_generating_pairs () const noexcept |
Returns the number of generating pairs. | |
Presentation< Word > const & | presentation () const noexcept |
Return the presentation used to construct or initialize a KnuthBendix object. | |
template<typename OutputIterator, typename InputIterator1, typename InputIterator2> | |
OutputIterator | reduce (OutputIterator d_first, InputIterator1 first, InputIterator2 last) |
Reduce a word. | |
template<typename OutputIterator, typename InputIterator1, typename InputIterator2> | |
OutputIterator | reduce_no_checks (OutputIterator d_first, InputIterator1 first, InputIterator2 last) |
Reduce a word with no checks. | |
template<typename OutputIterator, typename InputIterator1, typename InputIterator2> | |
OutputIterator | reduce_no_run (OutputIterator d_first, InputIterator1 first, InputIterator2 last) const |
Reduce a word with no enumeration. | |
template<typename OutputIterator, typename InputIterator1, typename InputIterator2> | |
OutputIterator | reduce_no_run_no_checks (OutputIterator d_first, InputIterator1 first, InputIterator2 last) const |
Reduce a word with no run and no checks. | |
|
inline |
This function adds a generating pair to the congruence represented by a KnuthBendix instance.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
*this
.LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
LibsemigroupsException | if started returns true . |
KnuthBendix & add_generating_pair_no_checks | ( | Iterator1 | first1, |
Iterator2 | last1, | ||
Iterator3 | first2, | ||
Iterator4 | last2 ) |
This function adds a generating pair to the congruence represented by a KnuthBendix instance.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
*this
.presentation().alphabet()
.false
. Adding generating pairs after started is not permitted (but also not checked by this function). bool contains | ( | Iterator1 | first1, |
Iterator2 | last1, | ||
Iterator3 | first2, | ||
Iterator4 | last2 ) |
This function checks whether or not the words represented by the ranges first1
to last1
and first2
to last2
are contained in the congruence represented by a KnuthBendix instance. This function triggers a full enumeration, which may never terminate.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
inlinenodiscard |
This function checks whether or not the words represented by the ranges first1
to last1
and first2
to last2
are contained in the congruence represented by a KnuthBendix instance. This function triggers a full enumeration, which may never terminate.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
presentation().alphabet()
.
|
inline |
This function checks whether or not the words represented by the ranges first1
to last1
and first2
to last2
are already known to be contained in the congruence represented by a KnuthBendix instance. This function performs no enumeration, so it is possible for the words to be contained in the congruence, but that this is not currently known.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
nodiscard |
This function checks whether or not the words represented by the ranges first1
to last1
and first2
to last2
are already known to be contained in the congruence represented by a KnuthBendix instance. This function performs no enumeration, so it is possible for the words to be contained in the congruence, but that this is not currently known.
Iterator1 | the type of the argument first1 . |
Iterator2 | the type of the argument last1 . |
Iterator3 | the type of the argument first2 . |
Iterator4 | the type of the argument last2 . |
first1 | iterator pointing at the first letter of the first word. |
last1 | iterator pointing one beyond the last letter in the first word. |
first2 | iterator pointing at the first letter of the second word. |
last2 | iterator pointing one beyond the last letter in the second word. |
presentation().alphabet()
.
|
inlinenodiscardnoexcept |
This function returns the generating pairs of the congruence as specified by add_generating_pair (if any).
noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the kind of the congruence represented by a KnuthBendix instance; see congruence_kind for details.
noexcept
and is guaranteed never to throw.
|
nodiscard |
This function computes the number of classes in the congruence represented by a KnuthBendix instance by running the congruence enumeration until it terminates.
this
has been run until finished, then this function can determine the number of classes of the congruence represented by this
even if it is infinite. Moreover, the complexity of this function is at worst \(O(mn)\) where \(m\) is the number of letters in the alphabet, and \(n\) is the number of nodes in the gilman_graph.
|
nodiscardnoexcept |
This function returns the number of generating pairs, which is the size of generating_pairs divided by \(2\).
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
This function returns the presentation used to construct or initialize a KnuthBendix object.
noexcept
and is guaranteed never to throw.
|
inline |
This function triggers a full enumeration and then writes a reduced word equivalent to the input word described by the iterator first
and last
to the output iterator d_first
. The word output by this function is equivalent to the input word in the congruence defined by a KnuthBendix instance. In other words, the output word is a normal form for the input word or equivalently a canconical representative of its congruence class.
OutputIterator | the type of the argument d_first . |
InputIterator1 | the type of the argument first . |
InputIterator2 | the type of the argument last . |
d_first | output iterator. |
first | iterator pointing at the first letter of the input word. |
last | iterator pointing one beyond the last letter in the input word. |
OutputIterator
pointing one beyond the last letter inserted into d_first
.LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
inline |
This function triggers a full enumeration and then writes a reduced word equivalent to the input word described by the iterator first
and last
to the output iterator d_first
. The word output by this function is equivalent to the input word in the congruence defined by a KnuthBendix instance. In other words, the output word is a normal form for the input word or equivalently a canconical representative of its congruence class.
OutputIterator | the type of the argument d_first . |
InputIterator1 | the type of the argument first . |
InputIterator2 | the type of the argument last . |
d_first | output iterator. |
first | iterator pointing at the first letter of the input word. |
last | iterator pointing one beyond the last letter in the input word. |
OutputIterator
pointing one beyond the last letter inserted into d_first
.presentation().alphabet()
.
|
inline |
This function writes a reduced word equivalent to the input word described by the iterator first
and last
to the output iterator d_first
. This function triggers no enumeration. The word output by this function is equivalent to the input word in the congruence defined by a KnuthBendix instance. If the KnuthBendix instance is finished, then the output word is a normal form for the input word. If the KnuthBendix instance is not finished, then it might be that equivalent input words produce different output words.
OutputIterator | the type of the argument d_first . |
InputIterator1 | the type of the argument first . |
InputIterator2 | the type of the argument last . |
d_first | output iterator. |
first | iterator pointing at the first letter of the input word. |
last | iterator pointing one beyond the last letter in the input word. |
OutputIterator
pointing one beyond the last letter inserted into d_first
.LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
OutputIterator reduce_no_run_no_checks | ( | OutputIterator | d_first, |
InputIterator1 | first, | ||
InputIterator2 | last ) const |
This function writes a reduced word equivalent to the input word described by the iterator first
and last
to the output iterator d_first
. This function triggers no enumeration. The word output by this function is equivalent to the input word in the congruence defined by a KnuthBendix instance. If the KnuthBendix instance is finished, then the output word is a normal form for the input word. If the KnuthBendix instance is not finished, then it might be that equivalent input words produce different output words.
OutputIterator | the type of the argument d_first . |
InputIterator1 | the type of the argument first . |
InputIterator2 | the type of the argument last . |
d_first | output iterator. |
first | iterator pointing at the first letter of the input word. |
last | iterator pointing one beyond the last letter in the input word. |
OutputIterator
pointing one beyond the last letter inserted into d_first
.presentation().alphabet()
.