libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
freeband.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2021-2025 James D. Mitchell
4// Tom D. Conti-Leslie
5// Murray T. Whyte
6// Reinis Cirpons
7//
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21
22// This file contains a declaration of the function freeband_equal_to which
23// implements the algorithm described in:
24// "Efficient Testing of Equivalence of Words in a Free Idempotent Semigroup"
25// by J. Radoszewski and W. Rytter
26// in SOFSEM 2010: Theory and Practice of Computer Science. Jan. 2010,
27// pp. 664-671
28// doi: 10.1007/978-3-642-11266-9_55
29
30#ifndef LIBSEMIGROUPS_FREEBAND_HPP_
31#define LIBSEMIGROUPS_FREEBAND_HPP_
32
33#include "types.hpp" // word_type
34
35namespace libsemigroups {
36
45
88 bool freeband_equal_to(word_type const& x, word_type const& y);
89
111 template <typename T>
112 bool freeband_equal_to(T x, T y) {
113 word_type x1(x), y1(y);
114 return freeband_equal_to(x1, y1);
115 }
116
140 template <typename T>
141 bool freeband_equal_to(T first1, T last1, T first2, T last2) {
142 return freeband_equal_to(word_type(first1, last1),
143 word_type(first2, last2));
144 }
145
146} // namespace libsemigroups
147
148#endif // LIBSEMIGROUPS_FREEBAND_HPP_
bool freeband_equal_to(word_type const &x, word_type const &y)
Check if two words represent the same element of a free band.
std::vector< letter_type > word_type
Type for a word over the generators of a semigroup.
Definition types.hpp:101
Namespace for everything in the libsemigroups library.
Definition action.hpp:44