libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
to-todd-coxeter.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2023-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// This file contains declarations for overloads of the "to" function for
20// outputting a ToddCoxeter object.
21
22#ifndef LIBSEMIGROUPS_TO_TODD_COXETER_HPP_
23#define LIBSEMIGROUPS_TO_TODD_COXETER_HPP_
24
25#include <type_traits> // for is_same_v, enable_if_t
26
27#include "constants.hpp" // for POSITIVE_INFINITY
28#include "exception.hpp" // for LIBSEMIGROUPS_EXCEPTION
29#include "froidure-pin.hpp" // for FroidurePin
30#include "to-froidure-pin.hpp" // for to<FroidurePin>
31#include "todd-coxeter-class.hpp" // for KnuthBendix
32#include "todd-coxeter-class.hpp" // for ToddCoxeter
33
34namespace libsemigroups {
35
36 // TODO(1):
37 // * to<ToddCoxeter> for FroidurePin<TCE> just return the original
38 // ToddCoxeter instance.
39 // * to<ToddCoxeter<std::string>>(ToddCoxeter<word_type> const&)
40 // * to<ToddCoxeter<std::string>>(KnuthBendix<word_type> const&)
41
52
84#ifdef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
85 // FIXME(1) doxygen conflates this version of "to" with the one of the same
86 // signature in "to-cong.hpp" and so we misspell one of the types of the
87 // parameters to avoid this
88 template <typename Result, typename Node>
89 auto to(congruence_knd knd, FroidurePinBase& fpb, WordGraph<Node> const& wg)
90 -> std::enable_if_t<
91 std::is_same_v<ToddCoxeter<typename Result::native_word_type>,
92 Result>,
93 Result>;
94#else
95 template <typename Result, typename Node>
96 auto to(congruence_kind knd, FroidurePinBase& fpb, WordGraph<Node> const& wg)
97 -> std::enable_if_t<
98 std::is_same_v<ToddCoxeter<typename Result::native_word_type>,
99 Result>,
100 Result>;
101#endif
102
135 template <template <typename...> typename Thing,
136 typename Word,
137 typename Rewriter,
138 typename ReductionOrder>
139 auto to(congruence_kind knd, KnuthBendix<Word, Rewriter, ReductionOrder>& kb)
140 -> std::enable_if_t<std::is_same_v<ToddCoxeter<Word>, Thing<Word>>,
141 ToddCoxeter<Word>>;
142
143} // namespace libsemigroups
144
145#include "to-todd-coxeter.tpp"
146#endif // LIBSEMIGROUPS_TO_TODD_COXETER_HPP_
Base class for FroidurePin containing non-element specific data and member functions.
Definition froidure-pin-base.hpp:66
Class for representing word graphs.
Definition word-graph.hpp:82
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