// // libsemigroups - C++ library for semigroups and monoids // Copyright (C) 2020 James D. Mitchell // Copyright (C) 2020 Reinis Cirpons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //
// This file contains a helper class for checking whether or not a congruence // defined by generating pairs or finitely presented semigroup is obviously // infinite. Currently, all that is checked is that: // // 1. For every generator there is at least one side of one relation that // consists solely of that generator. If this condition is not met, then // there is a generator of infinite order. // // 2. The number of occurrences of every generator is not preserved by the // relations. Otherwise, it is not possible to use the relations to reduce // the number of occurrences of a generator in a word, and so there are // infinitely many distinct words. // // 3. The number of generators on the left hand side of a relation is not the // same as the number of generators on the right hand side for at least // one generator. Otherwise the relations preserve the length of any word // and so there are infinitely many distinct words. // // 4. There are at least as many relations as there are generators. Otherwise // we can find a surjective homomorphism onto an infinite subsemigroup of // the rationals under addition. // // 5. The checks 2., 3. and 4. are a special case of a more general matrix based // condition. We construct a matrix whose columns correspond to generators // and rows correspond to relations. The (i, j)-th entry is the number of // occurrences of the j-th generator in the left hand side of the i-th // relation minus the number of occurrences of it on the right hand side. // If this matrix has a non-trivial kernel, then we can construct a // surjective homomorphism onto an infinite subsemigroup of the rationals // under addition. So we check that the matrix is full rank. // // 6. The presentation is not that of a free product. To do this we consider // a graph whose vertices are generators and an edge connects two generators // if they occur on either side of the same relation. If this graph is // disconnected then the presentation is a free product and is therefore // infinite. Note that we currently do not consider the case where the // identity occurs in the presentation.
#include <cstddef> // for size_t #include <numeric> // for accumulate #include <string> // for string #include <utility> // for pair #include <vector> // for vector
#include"config.hpp"// for LIBSEMIGROUPS_EIGEN_ENABLED #include"types.hpp"// for word_type etc #include"uf.hpp"// for Duf
// letter_type i belongs to "preserve" if there exists a relation where // the number of occurrences of i is not the same on both sides of the // relation letter_type i belongs to "unique" if there is a relation // where one side consists solely of i. bool _empty_word;
detail::Duf<> _letter_components;
size_t _nr_gens;
size_t _nr_letter_components;
size_t _nr_relations; bool _preserve_length;
std::vector<bool> _preserve;
std::vector<bool> _seen;
std::vector<bool> _unique;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.