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"
34#include "libsemigroups/word-range.hpp"
40 template <
typename KnuthBendix_>
43 using knuth_bendix_type = KnuthBendix_;
44 using native_word_type =
typename KnuthBendix_::native_word_type;
45 using native_letter_type =
46 typename KnuthBendix_::native_word_type::value_type;
50 KBE(KBE
const&) =
default;
53 KBE& operator=(KBE
const&) =
default;
54 KBE& operator=(KBE&&) =
default;
59 KBE(knuth_bendix_type&, native_letter_type
const&);
60 KBE(knuth_bendix_type&, native_word_type
const&);
62 bool operator==(KBE
const&)
const;
63 bool operator<(KBE
const&)
const;
66 native_word_type
const& word() const noexcept;
68 friend std::ostringstream& operator<<(std::ostringstream& os,
75 native_word_type _kb_word;
84 template <
typename KnuthBendix_>
87 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
92 template <
typename KnuthBendix_>
93 struct Degree<detail::KBE<KnuthBendix_>> {
95 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
100 template <
typename KnuthBendix_>
102 void operator()(detail::KBE<KnuthBendix_>
const&,
size_t)
const noexcept {}
105 template <
typename KnuthBendix_>
106 struct One<detail::KBE<KnuthBendix_>> {
107 detail::KBE<KnuthBendix_>
108 operator()(detail::KBE<KnuthBendix_>
const&)
const noexcept {
109 return detail::KBE<KnuthBendix_>();
112 detail::KBE<KnuthBendix_> operator()(
size_t = 0) const noexcept {
113 return detail::KBE<KnuthBendix_>();
117 template <
typename KnuthBendix_>
118 struct Product<detail::KBE<KnuthBendix_>> {
119 void operator()(detail::KBE<KnuthBendix_>& xy,
120 detail::KBE<KnuthBendix_>
const& x,
121 detail::KBE<KnuthBendix_>
const& y,
124 using words::operator+=;
125 using KBE_ = detail::KBE<KnuthBendix_>;
133 template <
typename KnuthBendix_>
134 struct FroidurePinState<detail::KBE<KnuthBendix_>> {
135 using type = KnuthBendix_;
152 template <
typename KnuthBendix_>
153 struct hash<libsemigroups::detail::KBE<KnuthBendix_>> {
154 size_t operator()(libsemigroups::detail::KBE<KnuthBendix_>
const& x)
const {
155 return hash<
typename libsemigroups::detail::KBE<
156 KnuthBendix_>::native_word_type>()(x.word());
160 template <
typename KnuthBendix_>
161 struct equal_to<libsemigroups::detail::KBE<KnuthBendix_>> {
162 bool operator()(libsemigroups::detail::KBE<KnuthBendix_>
const& x,
163 libsemigroups::detail::KBE<KnuthBendix_>
const& y)
const {
LimitMax const LIMIT_MAX
Value for the maximum of something.
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