![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
This file contains documentation for creating semigroup and monoid presentations in libsemigroups
from other types of objects.
libsemigroups
types. Functions | |
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<template< typename... > typename Thing, typename Word, typename Rewriter, typename ReductionOrder> | |
auto | to (KnuthBendix< 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 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. | |
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 | ( | KnuthBendix< 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. constructed. |
kb | the KnuthBendix object from which to obtain the rules. |
Presentation<Word>
.
|
noexcept |
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 . |
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.