libsemigroups  v3.6.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-2026 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 <type_traits>
23
24#include "knuth-bendix-class.hpp" // for KnuthBendix
25#include "presentation.hpp" // for Presentation
26#include "to-presentation.hpp" // for to<Presentation>
27
28namespace libsemigroups {
29
31 // Forward decls
33
34 class FroidurePinBase;
35
36 template <typename Word>
37 class ToddCoxeter;
38
39 enum class congruence_kind;
40
51
78 template <typename Result>
79 auto to(congruence_kind knd, FroidurePinBase& fpb) -> std::enable_if_t<
80 std::is_same_v<KnuthBendix<typename Result::native_word_type,
81 typename Result::rewriter_type>,
82 Result>,
83 Result> {
84 using Word = typename Result::native_word_type;
85 using Rewriter = typename Result::rewriter_type;
87 }
88
115 template <template <typename...> typename Thing, typename Word>
116 auto to(congruence_kind knd, ToddCoxeter<Word>& tc)
117 -> std::enable_if_t<std::is_same_v<Thing<Word>, KnuthBendix<Word>>,
118 KnuthBendix<Word>> {
119 // TODO(1) could do a version where we convert tc to FroidurePin, then use
120 // the rules of that instead?
121 return KnuthBendix<Word>(knd, tc.presentation());
122 }
123
150 template <typename Result>
152 ToddCoxeter<typename Result::native_word_type>& tc)
153 -> std::enable_if_t<
154 std::is_same_v<KnuthBendix<typename Result::native_word_type,
155 typename Result::rewriter_type>,
156 Result>,
157 Result> {
158 using Word = typename Result::native_word_type;
159 using Rewriter = typename Result::rewriter_type;
160 return KnuthBendix<Word, Rewriter>(knd, tc.presentation());
161 }
162
163} // namespace libsemigroups
164#endif // LIBSEMIGROUPS_TO_KNUTH_BENDIX_HPP_
Base class for FroidurePin containing non-element specific data and member functions.
Definition froidure-pin-base.hpp:67
For an implementation of presentations for semigroups or monoids.
Definition presentation.hpp:103
KnuthBendix(congruence_kind, Presentation< Word > const &) -> KnuthBendix< Word >
Deduction guide.
congruence_kind
Enum to indicate the sided-ness of a congruence.
Definition types.hpp:67
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.