23#ifndef LIBSEMIGROUPS_DETAIL_KBE_HPP_
24#define LIBSEMIGROUPS_DETAIL_KBE_HPP_
30#include "libsemigroups/adapters.hpp"
31#include "libsemigroups/froidure-pin.hpp"
32#include "libsemigroups/obvinf.hpp"
33#include "libsemigroups/types.hpp"
39 template <
typename KnuthBendix_>
41 using internal_string_type = std::string;
43 explicit KBE(internal_string_type
const&);
44 explicit KBE(internal_string_type&&);
47 using knuth_bendix_type = KnuthBendix_;
51 KBE(KBE
const&) =
default;
54 KBE& operator=(KBE
const&) =
default;
55 KBE& operator=(KBE&&) =
default;
60 KBE(knuth_bendix_type&, internal_string_type
const&);
61 KBE(knuth_bendix_type&, internal_string_type&&);
65 KBE(knuth_bendix_type&,
word_type const&);
67 bool operator==(KBE
const&)
const;
68 bool operator<(KBE
const&)
const;
71 internal_string_type
const& string() const noexcept;
73 std::
string string(knuth_bendix_type const& kb) const;
75 word_type word(knuth_bendix_type const& kb) const;
77 friend std::ostringstream& operator<<(std::ostringstream& os,
84 internal_string_type _kb_word;
93 template <
typename KnuthBendix_>
96 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
101 template <
typename KnuthBendix_>
102 struct Degree<detail::KBE<KnuthBendix_>> {
104 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
109 template <
typename KnuthBendix_>
111 void operator()(detail::KBE<KnuthBendix_>
const&,
size_t)
const noexcept {}
114 template <
typename KnuthBendix_>
115 struct One<detail::KBE<KnuthBendix_>> {
116 detail::KBE<KnuthBendix_>
117 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
118 return detail::KBE<KnuthBendix_>();
121 detail::KBE<KnuthBendix_> operator()(
size_t = 0) const noexcept {
122 return detail::KBE<KnuthBendix_>();
126 template <
typename KnuthBendix_>
127 struct Product<detail::KBE<KnuthBendix_>> {
128 void operator()(detail::KBE<KnuthBendix_>& xy,
129 detail::KBE<KnuthBendix_>
const& x,
130 detail::KBE<KnuthBendix_>
const& y,
133 std::string w(x.string());
135 xy = detail::KBE<KnuthBendix_>(*kb, w);
139 template <
typename KnuthBendix_>
140 struct FroidurePinState<detail::KBE<KnuthBendix_>> {
141 using type = KnuthBendix_;
158 template <
typename KnuthBendix_>
159 struct hash<libsemigroups::detail::KBE<KnuthBendix_>> {
160 size_t operator()(libsemigroups::detail::KBE<KnuthBendix_>
const& x)
const {
165 template <
typename KnuthBendix_>
166 struct equal_to<libsemigroups::detail::KBE<KnuthBendix_>> {
167 bool operator()(libsemigroups::detail::KBE<KnuthBendix_>
const& x,
168 libsemigroups::detail::KBE<KnuthBendix_>
const& y)
const {
LimitMax const LIMIT_MAX
Value for the maximum of something.
std::vector< letter_type > word_type
Type for a word over the generators of a semigroup.
Definition types.hpp:101
size_t letter_type
Type for the index of a generator of a semigroup.
Definition types.hpp:98
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
Adapter for the complexity of multiplication.
Definition adapters.hpp:121
Adapter for the degree of an element.
Definition adapters.hpp:159
Adapter for increasing the degree of an element.
Definition adapters.hpp:199
Adapter for the identity element of the given type.
Definition adapters.hpp:246
Adapter for the product of two elements.
Definition adapters.hpp:284