libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
to-knuth-bendix.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2025 James D. Mitchell
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19#ifndef LIBSEMIGROUPS_TO_KNUTH_BENDIX_HPP_
20#define LIBSEMIGROUPS_TO_KNUTH_BENDIX_HPP_
21
22#include "knuth-bendix.hpp"
23
24namespace libsemigroups {
25 class FroidurePinBase;
26 enum class congruence_kind;
27
38
63 template <typename Result>
64 auto to(congruence_kind knd, FroidurePinBase& fpb) -> std::enable_if_t<
65 std::is_same_v<KnuthBendix<typename Result::native_word_type,
66 typename Result::rewriter_type>,
67 Result>,
68 Result> {
69 using Word = typename Result::native_word_type;
70 using Rewriter = typename Result::rewriter_type;
72 }
73
100 template <template <typename...> typename Thing, typename Word>
101 auto to(congruence_kind knd, ToddCoxeter<Word>& tc)
102 -> std::enable_if_t<std::is_same_v<Thing<Word>, KnuthBendix<Word>>,
103 KnuthBendix<Word>> {
104 // TODO(1) could do a version where we convert tc to FroidurePin, then use
105 // the rules of that instead?
106 return KnuthBendix<Word>(knd, tc.presentation());
107 }
108
135 template <typename Result>
137 ToddCoxeter<typename Result::native_word_type>& tc)
138 -> std::enable_if_t<
139 std::is_same_v<KnuthBendix<typename Result::native_word_type,
140 typename Result::rewriter_type>,
141 Result>,
142 Result> {
143 using Word = typename Result::native_word_type;
144 using Rewriter = typename Result::rewriter_type;
145 return KnuthBendix<Word, Rewriter>(knd, tc.presentation());
146 }
147
148} // namespace libsemigroups
149#endif // LIBSEMIGROUPS_TO_KNUTH_BENDIX_HPP_
Base class for FroidurePin containing non-element specific data and member functions.
Definition froidure-pin-base.hpp:66
For an implementation of presentations for semigroups or monoids.
Definition presentation.hpp:102
KnuthBendix(congruence_kind, Presentation< Word > const &) -> KnuthBendix< Word >
Deduction guide.
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.
congruence_kind
Enum to indicate the sided-ness of a congruence.
Definition types.hpp:69
Namespace for everything in the libsemigroups library.
Definition action.hpp:44