This file contains documentation for creating inverse semigroup and monoid presentations in libsemigroups from other types of objects.
- See also
- The `to` function for an overview of possible conversions between libsemigroups types.
|
| template<typename Result, typename Word> |
| auto | to (InversePresentation< Word > const &ip) noexcept -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result > &&!std::is_same_v< Word, typename Result::word_type >, Result > |
| | Make an inverse presentation from a different type of inverse presentation when typename Result::word_type and Word are not the same.
|
| template<typename Result, typename Word> |
| auto | to (InversePresentation< Word > const &ip) noexcept -> std::enable_if_t< std::is_same_v< InversePresentation< Word >, Result >, Result const & > |
| | Make an inverse presentation from a different type of inverse presentation when typename Result::word_type and Word are the same.
|
| template<typename Result, typename Word, typename Func> |
| auto | to (InversePresentation< Word > const &ip, Func &&f) -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result >, Result > |
| | Make an inverse presentation from a different type of inverse presentation.
|
| template<template< typename... > typename Thing, typename Word> |
| auto | to (Presentation< Word > const &p) -> std::enable_if_t< std::is_same_v< InversePresentation< Word >, Thing< Word > >, InversePresentation< Word > > |
| | Make an inverse presentation from a presentation.
|
template<typename Result, typename Word>
| auto to |
( |
InversePresentation< Word > const & | ip | ) |
-> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result > &&!std::is_same_v< Word, typename Result::word_type >, Result > |
|
noexcept |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.
This function returns an inverse presentation equivalent to the input inverse presentation but of a different type (for example, can be used to convert from std::string to word_type).
If the alphabet of of ip is \(\{a_0, a_1, \dots a_{n-1}\}\), then the conversion from InversePresentation<WordInput>::letter_type to InversePresentation<WordOutput>::letter_type is \(a_i \mapsto\) human_readable_letter<WordOutput>(size_t i).
- Template Parameters
-
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
- Parameters
-
| ip | the input inverse presentation. |
- Returns
- A value of type InversePresentation<WordOutput>.
- Exceptions
-
- Note
- This function will be moved from the header to-presentation.hpp to presentation.hpp in v4 of libsemigroups.
template<typename Result, typename Word>
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function just returns its argument ip (as a reference), and is included solely for the purpose of simplifying certain client code, where inverse presentations must be converted from one type to another sometimes, but not other times.
- Template Parameters
-
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
- Parameters
-
| ip | the input inverse presentation. |
- Returns
- A value of type InversePresentation<WordOutput>.
This function is noexcept and is guaranteed never to throw.
- Note
- This function will be moved from the header to-presentation.hpp to presentation.hpp in v4 of libsemigroups.
template<typename Result, typename Word, typename Func>
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns an inverse presentation equivalent to the input inverse 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 inverse presentation to the other.
- Template Parameters
-
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
| Func | the type of a function for transforming letters. |
- Parameters
-
- Returns
- A value of type InversePresentation<WordOutput>.
- Exceptions
-
- Note
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.
-
This function will be moved from the header to-presentation.hpp to presentation.hpp in v4 of libsemigroups.
template<template< typename... > typename Thing, typename Word>
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)\).
- Template Parameters
-
| Thing | used for SFINAE, must be InversePresentation. |
| Word | the type of the words in the input presentation. |
- Parameters
-
- Returns
- A value of type InversePresentation<Word>.
- Exceptions
-
- Note
- This function will be moved from the header to-presentation.hpp to presentation.hpp in v4 of libsemigroups.