This file contains documentation for creating semigroup and monoid presentations in libsemigroups from other types of objects.
libsemigroups types. Functions | |
| template<typename Result, typename Word> | |
| auto | to (Congrence< Word > &c) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
| Make a presentation from a Congruence. | |
| template<typename Result> | |
| auto | to (FroidurePinBase &fp) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
| Make a presentation from a FroidurePin object. | |
| template<typename Result, typename Word> | |
| auto | to (Kambtes< Word > &k) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
| Make a presentation from a Kambites. | |
| template<template< typename... > typename Thing, typename Word, typename Rewriter typename ReductionOrder> | |
| auto | to (KnutBendix< Word, Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Thing< Word >, Presentation< Word > >, Presentation< Word > > |
| Make a presentation from a KnuthBendix object. | |
| template<typename Result, typename WordIn, typename Rewriter, typename ReductionOrder> | |
| auto | to (KnuthBendix< WordIn, Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
| Make a presentation from a KnuthBendix object. | |
| template<typename Result, typename Word> | |
| auto | to (Presentation< Word > const &p) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
| Make a presentation from a different type of presentation. | |
| template<typename Result, typename Word, typename Func> | |
| auto | to (Presentation< Word > const &p, Func &&f) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
| Make a presentation from a different type of presentation. | |
| template<typename Result, typename PresentationType> | |
| auto | to (Stephen< PresentationType > &s) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
| Make a presentation from a Stephen object. | |
| template<typename Result, typename Word> | |
| auto | to (ToddCoxter< Word > &tc) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
| Make a presentation from a ToddCoxeter object. | |
| auto to | ( | Congrence< Word > & | c | ) | -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
Defined in to-presentation.hpp
Despite the hideous signature, this function should be invoked as follows:
There are two versions of this function:
typename Result::word_type and Word are not the same, this function calls to<Presentation<typename Result::word_type> on c.presentation() to return a presentation equivalent to the object used to construct or initialise the Congruence object (if any) but of a different type (for example, can be used to convert from std::string to word_type).c.presentation().| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| Word | the type of the words in the input Congruence. |
| c | the Congruence object from which to obtain the rules. |
Presentation<Word>. | auto to | ( | FroidurePinBase & | fp | ) | -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function constructs and returns a Presentation object using the rules of a FroidurePin object, accessed via FroidurePin::cbegin_rules and FroidurePin::cend_rules.
No enumeration of the argument fp is performed, so it might be the case that the resulting presentation does not define the same semigroup as fp. To ensure that the resulting presentation defines the same semigroup as fp, run FroidurePin::run (or any other function that fully enumerates fp) prior to calling this function.
| Result | the return type, also used for SFINAE, should be Presentation<Word> for some type Word. |
| fp | the FroidurePin object from which to obtain the rules. |
Presentation<Word>.| auto to | ( | Kambtes< Word > & | k | ) | -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
Defined in to-presentation.hpp
Despite the hideous signature, this function should be invoked as follows:
There are two versions of this function:
typename Result::word_type and Word are not the same, this function calls to<Presentation<typename Result::word_type> on k.presentation() to return a presentation equivalent to the object used to construct or initialise the Kambites object (if any) but of a different type (for example, this function can be used to convert from std::string to word_type).k.presentation().| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| Word | the type of the words in the input Kambites. |
| k | the Kambites object from which to obtain the rules. |
Presentation<Word>. | auto to | ( | KnutBendix< Word, Rewriter, ReductionOrder > & | kb | ) | -> std::enable_if_t< std::is_same_v< Thing< Word >, Presentation< Word > >, Presentation< Word > > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function constructs and returns a Presentation object using the currently active rules of kb.
No enumeration of the argument kb is performed, so it might be the case that the resulting presentation does not define the same semigroup/monoid as kb. To ensure that the resulting presentation defines the same semigroup as kb, run run (or any other function that fully enumerates kb) prior to calling this function.
| Thing | used for SFINAE, must be Presentation. |
| Word | the type of the rules in the presentation of the KnuthBendix object kb. |
| Rewriter | the second template parameter for KnuthBendix. |
| ReductionOrder | the third template parameter for KnuthBendix. |
| kb | the KnuthBendix object from which to obtain the rules. |
Presentation<Word>.| auto to | ( | KnuthBendix< WordIn, Rewriter, ReductionOrder > & | kb | ) | -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function constructs and returns a Presentation<WordOut> object using the currently active rules of kb.
No enumeration of the argument kb is performed, so it might be the case that the resulting presentation does not define the same semigroup/monoid as kb. To ensure that the resulting presentation defines the same semigroup as kb, run run (or any other function that fully enumerates kb) prior to calling this function.
| Result | the return type, also used for SFINAE. Must be Presentation<WordOut> for some type WordOut. |
| WordIn | the type of the rules in the presentation of the KnuthBendix object kb. |
| Rewriter | the second template parameter for KnuthBendix. |
| ReductionOrder | the third template parameter for KnuthBendix. |
| kb | the KnuthBendix object from which to obtain the rules. |
Presentation<WordOut>.kb, then the simpler to<Presentation>(kb) may be used instead.
|
noexcept |
Make an inverse presentation from a presentation.
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
There are 2 versions of this function:
typename Result::word_type and Word are not the same, this function returns a presentation equivalent to the input presentation but of a different type (for example, can be used to convert from std::string to word_type).typename Result::word_type and Word are the same, this function just returns its argument p (as a reference), and is included solely for the purpose of simplifying certain client code, where presentations must be converted from one type to another sometimes, but not other times.If the alphabet of of p is \(\{a_0, a_1, \dots a_{n-1}\}\), then the conversion from Presentation<WordInput>::letter_type to Presentation<WordOutput>::letter_type is \(a_i \mapsto\) human_readable_letter<WordOutput>(size_t i).
| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| Word | the type of the words in the input presentation. |
| p | the input presentation. |
Result.| LibsemigroupsException | if typename Result::word_type and Word are not the same and p.throw_if_bad_alphabet_or_rules() throws. If typename Result::word_type and Word are the same, then this function is noexcept. |
to-presentation.hpp to presentation.hpp in v4 of libsemigroups.Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns an inverse presentation with rules equivalent to those of the input presentation, but over a normalised alphabet. If the alphabet of p is \(\{a_0, a_1, \dots, a_{n-1}\}\), then the alphabet of the returned inverse presentation will be \(\{0, 1, \dots, n-1, n, \dots, 2n-1\}\), where the inverse of letter \(i\) is the letter \(i + n\, (\text{mod }2n)\).
| Thing | used for SFINAE, must be InversePresentation. |
| Word | the type of the words in the input presentation. |
| p | the input presentation. |
InversePresentation<Word>.| LibsemigroupsException | if p.throw_if_bad_alphabet_or_rules() throws. |
to-presentation.hpp to presentation.hpp in v4 of libsemigroups. | auto to | ( | Presentation< Word > const & | p, |
| Func && | f ) -> std::enable_if_t< std::is_same_v<Presentation<typename Result::word_type>, Result>, Result> |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns a presentation equivalent to the input presentation but of a different type (for example, can be used to convert from std::string to word_type). The second parameter specifies how to map the letters of one presentation to the other.
| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| Word | the type of the words in the input presentation. |
| Func | the type of a function for transforming letters. |
| p | the input presentation. |
| f | a function mapping Presentation<Word>::letter_type to Result::letter_type. |
Result.| LibsemigroupsException | if p.throw_if_bad_alphabet_or_rules() throws. |
Func must be a function type that is invocable with values of Presentation<Word>::letter_type. If this is not true, then template substitution will fail.to-presentation.hpp to presentation.hpp in v4 of libsemigroups. | auto to | ( | Stephen< PresentationType > & | s | ) | -> std::enable_if_t< std::is_same_v<Presentation<typename Result::word_type>, Result>, Result> |
Defined in to-presentation.hpp
Despite the hideous signature, this function should be invoked as follows:
This function calls to<Presentation<typename Result::word_type> on s.presentation() to return a presentation equivalent to the object used to construct or initialise the Stephen object (if any) but of a different type (for example, can be used to convert from word_type to std::string).
| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| PresentationType | the type of the presentation in the input Stephen. |
| s | the Stephen object from which to obtain the rules. |
Presentation<typename Result::word_type>. | auto to | ( | ToddCoxter< Word > & | tc | ) | -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result > &&!std::is_same_v< typename Result::word_type, Word >, Result > |
Defined in to-presentation.hpp
Despite the hideous signature, this function should be invoked as follows:
There are two versions of this function:
typename Result::word_type and Word are not the same, this function calls to<Presentation<typename Result::word_type> on tc.presentation() to return a presentation equivalent to the object used to construct or initialise the ToddCoxeter object (if any) but of a different type (for example, can be used to convert from std::string to word_type).tc.presentation().| Result | the return type, also used for SFINAE, should be Presentation<T> for some type T. |
| Word | the type of the words in the input ToddCoxeter. |
| tc | the ToddCoxeter object from which to obtain the rules. |
Presentation<Word>.