// // libsemigroups - C++ library for semigroups and monoids // Copyright (C) 2022 James D. Mitchell // // 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/>. //
#include <cstddef> // for size_t #include <iostream> // for cout #include <stdexcept> // for number_of_congruencestime_error #include <unordered_set> // for unordered_set #include <vector> // for vector
#include"catch.hpp"// for REQUIRE, REQUIRE_THROWS_AS, REQUI... #include"test-main.hpp"// for LIBSEMIGROUPS_TEST_CASE
#include"libsemigroups/bipart.hpp"// for Bipartition #include"libsemigroups/config.hpp"// for LIBSEMIGROUPS_ENABLE_STATS #include"libsemigroups/digraph-helper.hpp"// for action_digraph_helper #include"libsemigroups/fpsemi-examples.hpp"// for brauer_monoid etc #include"libsemigroups/froidure-pin.hpp"// for FroidurePin #include"libsemigroups/knuth-bendix.hpp"// for redundant_rule #include"libsemigroups/make-froidure-pin.hpp"// for make #include"libsemigroups/make-present.hpp"// for make #include"libsemigroups/sims1.hpp"// for Sims1 #include"libsemigroups/transf.hpp"// for Transf #include"libsemigroups/types.hpp"// for word_type // namespace libsemigroups {
using Sims1_ = Sims1<uint32_t>; using digraph_type = typename Sims1_::digraph_type; using node_type = typename digraph_type::node_type;
using fpsemigroup::author; using fpsemigroup::make;
using fpsemigroup::brauer_monoid; using fpsemigroup::chinese_monoid; using fpsemigroup::fibonacci_semigroup; using fpsemigroup::full_transformation_monoid; using fpsemigroup::monogenic_semigroup; using fpsemigroup::partition_monoid; using fpsemigroup::plactic_monoid; using fpsemigroup::rectangular_band; using fpsemigroup::rook_monoid; using fpsemigroup::singular_brauer_monoid; using fpsemigroup::stellar_monoid; using fpsemigroup::stylic_monoid; using fpsemigroup::temperley_lieb_monoid;
namespace { template <typename P> void check_extra(congruence_kind ck, P const& p, P const& e, size_t n) {
P f = e; if (ck == congruence_kind::left) {
presentation::reverse(f);
} auto foo = [&f](autoconst& ad) { using action_digraph_helper::follow_path_nc; for (auto it = f.rules.cbegin(); it != f.rules.cend(); it += 2) { if (follow_path_nc(ad, 0, *it) != follow_path_nc(ad, 0, *(it + 1))) { returnfalse;
}
} returntrue;
};
Sims1_ S(ck);
S.short_rules(p);
LIBSEMIGROUPS_TEST_CASE("Sims1", "008", "full_transformation_monoid(4) left", "[fail][low-index][babbage]") { auto rg = ReportGuard(true);
auto p = make<Presentation<word_type>>(
full_transformation_monoid(4, author::Iwahori));
REQUIRE(p.alphabet().size() == 4);
auto w = presentation::longest_common_subword(p); while (!w.empty()) {
presentation::replace_subword(p, w);
w = presentation::longest_common_subword(p);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "013", "symmetric_inverse_monoid(5)", "[fail][low-index]") { // This might take an extremely long time to terminate auto rg = ReportGuard(true);
Presentation<word_type> p;
p.contains_empty_word(false);
p.alphabet(6); for (autoconst& rel : rook_monoid(5, 1)) {
p.add_rule_and_check(rel.first.cbegin(),
rel.first.cend(),
rel.second.cbegin(),
rel.second.cend());
}
Sims1_ C(congruence_kind::left);
C.short_rules(p);
REQUIRE(C.number_of_threads(6).number_of_congruences(1'546) == 0); // On 24/08/2022 JDM ran this for approx. 16 hours overnight on his laptop, // the last line of output was: // #4: Sims1: found 63'968'999 congruences in 52156s! // #21: Sims1: found 759'256'468 congruences in 244617.546875 // #12: Sims1: found 943'233'501 congruences in 321019.531250! // #30: Sims1: found 1'005'857'634 congruences in 350411.000000! // #45: Sims1: found 1'314'588'296 congruences in 487405.000000! // #20: Sims1: found 4'619'043'843 congruences in 2'334'184.500000! // #49: Sims1: found 5'582'499'404 congruences in 2'912'877.000000! // #10: Sims1: found 6'825'113'083 congruences in 3705611.250000! //
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "014", "temperley_lieb_monoid(3) from presentation", "[quick][low-index]") { auto rg = ReportGuard(false);
Presentation<word_type> p;
p.contains_empty_word(true);
LIBSEMIGROUPS_TEST_CASE("Sims1", "025", "brauer_monoid(5) (Kudryavtseva-Mazorchuk)", "[extreme][sims1]") { auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(brauer_monoid(5));
// This is just very long running (without e!) and I haven't managed to run // it to completion.
Presentation<word_type> e;
e.alphabet(9);
presentation::add_rule_and_check(e, {0}, {1});
auto d = MinimalRepOrc()
.short_rules(p)
.extra(e)
.target_size(945)
.number_of_threads(8)
.report_interval(100)
.digraph(); // WARNING: the number below is not necessarily the minimal degree of an // action on right congruences, only the minimal degree of an action on // right congruences containing the pair {0}, {1}.
REQUIRE(d.number_of_nodes() == 46); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
REQUIRE(S.size() == 945);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "026", "uniform_block_bijection_monoid(4) (Fitzgerald)", "[extreme][sims1]") { auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(
uniform_block_bijection_monoid(4, author::FitzGerald));
presentation::remove_duplicate_rules(p);
presentation::reduce_complements(p);
presentation::sort_each_rule(p);
presentation::sort_rules(p);
// a A b B c C
p.alphabet({0, 1, 2, 3, 4, 5});
presentation::add_inverse_rules(p, {1, 0, 3, 2, 5, 4});
presentation::add_rule_and_check(p, {0, 0, 5, 0, 4}, {});
presentation::add_rule_and_check(p, {0, 4, 2, 2, 1, 5, 2}, {});
presentation::add_rule_and_check(p, {1, 3, 0, 2, 4, 4, 4}, {});
Sims1_ S(congruence_kind::right);
S.short_rules(p);
std::stringbuf buff;
std::ostream os(&buff);
S.number_of_congruences(2); // REQUIRE(S.stats().max_pending != 0);
os << S.cbegin(3).stats(); // Also does not do anything visible
} #endif
for (size_t n = 3; n <= 6; ++n) { auto p = make<Presentation<word_type>>(temperley_lieb_monoid(n)); // There are no relations containing the empty word so we just manually // add it.
p.contains_empty_word(true); auto orc
= MinimalRepOrc().short_rules(p).number_of_threads(2).target_size(
sizes[n]);
auto d = orc.digraph();
REQUIRE(orc.target_size() == sizes[n]);
REQUIRE(action_digraph_helper::is_strictly_cyclic(d)); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
S.add_generator(S.generator(0).identity());
REQUIRE(S.size() == sizes[n]);
REQUIRE(d.number_of_nodes() == min_degrees[n]);
}
}
auto d = MinimalRepOrc().short_rules(p).target_size(720).digraph();
REQUIRE(d.number_of_nodes() == 6);
REQUIRE(action_digraph_helper::is_strictly_cyclic(d));
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "041", "rectangular_band(4, 4) - minimal o.r.c. rep", "[standard][sims1]") { auto rg = ReportGuard(false); auto p = make<Presentation<word_type>>(rectangular_band(4, 4));
p.contains_empty_word(true); auto d = MinimalRepOrc()
.short_rules(p)
.number_of_threads(2)
.target_size(17)
.digraph();
REQUIRE(action_digraph_helper::is_strictly_cyclic(d)); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
REQUIRE(S.size() == 16);
REQUIRE(d.number_of_nodes() == 7);
auto rg = ReportGuard(true); for (size_t m = 1; m <= 5; ++m) { for (size_t n = 1; n <= 5; ++n) {
std::cout << std::string(72, '#') << "\n"
<< "CASE m, n = " << m << ", " << n << "\n"
<< std::string(72, '#') << std::endl;
auto p = make<Presentation<word_type>>(rectangular_band(m, n));
p.contains_empty_word(true); auto d = MinimalRepOrc()
.short_rules(p)
.target_size(m * n + 1)
.number_of_threads(6)
.digraph();
REQUIRE(action_digraph_helper::is_strictly_cyclic(d)); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
REQUIRE(S.size() == m * n);
REQUIRE(d.number_of_nodes() == results[m][n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "043", "rectangular_band(2, 2) - with and without identity", "[quick][sims1]") { auto rg = ReportGuard(false); auto p = make<Presentation<word_type>>(rectangular_band(2, 2));
Sims1_ S(congruence_kind::right);
S.short_rules(p);
REQUIRE(S.number_of_congruences(10) == 1); auto d = MinimalRepOrc().short_rules(p).target_size(1).digraph();
REQUIRE(d.number_of_nodes() == 1);
REQUIRE(action_digraph_helper::is_strictly_cyclic(d));
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "045", "right zero semigroup - minimal o.r.c. rep", "[quick][sims1]") { // This is an example of a semigroup with a strictly cyclic faithful // right representation. auto rg = ReportGuard(false);
size_t const n = 5; auto p = make<Presentation<word_type>>(rectangular_band(1, n)); auto d = MinimalRepOrc().short_rules(p).target_size(n).digraph();
REQUIRE(action_digraph_helper::is_strictly_cyclic(d)); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
REQUIRE(S.size() == n);
REQUIRE(d.number_of_nodes() == 5);
}
LIBSEMIGROUPS_TEST_CASE( "Sims1", "046", "semigroup with faithful non-strictly cyclic action of right congruence", "[quick][sims1]") { // Found with Smallsemi, this example is minimal wrt size of the semigroup.
for (auto it = C.cbegin(5); it != C.cend(5); ++it) { auto W = make<FroidurePin<Transf<0, node_type>>>(
*it, 1, it->number_of_active_nodes()); if (p.contains_empty_word()) { auto one = W.generator(0).identity(); if (!W.contains(one)) {
W.add_generator(one);
}
} if (W.size() == 5) { auto result = *it;
result.induced_subdigraph(1, result.number_of_active_nodes());
result.number_of_active_nodes(result.number_of_active_nodes() - 1); if (action_digraph_helper::is_strictly_cyclic(result)) {
strictly_cyclic_count++;
} else {
REQUIRE(W.generator(0) == Transf<0, node_type>({3, 0, 2, 3, 4}));
REQUIRE(W.generator(1) == Transf<0, node_type>({3, 1, 2, 3, 4}));
REQUIRE(W.generator(2) == Transf<0, node_type>({4, 3, 2, 3, 4}));
REQUIRE(
result
== action_digraph_helper::make<uint32_t>( 5, {{3, 3, 4}, {0, 1, 3}, {2, 2, 2}, {3, 3, 3}, {4, 4, 4}}));
non_strictly_cyclic_count++;
}
}
}
REQUIRE(strictly_cyclic_count == 2);
REQUIRE(non_strictly_cyclic_count == 1);
}
// Takes about 3 to 4 minutes
LIBSEMIGROUPS_TEST_CASE("Sims1", "047", "rectangular_band(m, n) - m = 1 .. 5, n = 1 .. 5", "[fail][sims1]") { // This doesn't fail it's just very extreme
std::vector<std::array<size_t, 7>> left
= {{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
{0, 0, 6, 22, 94, 454, 2'430},
{0, 0, 30, 205, 1'555, 12'880},
{0, 0, 240, 4'065, 72'465, 1'353'390},
{0, 0, 2'756, 148'772, 8'174'244, 456'876'004}};
// Seems like the m,n-th entry of the table above is: // {m, n} -> Sum([0 .. n], k -> Bell(m)^k*Stirling2(n, k));
auto rg = ReportGuard(true); for (size_t m = 2; m <= 5; ++m) { for (size_t n = 2; n <= 6; ++n) {
std::cout << std::string(72, '#') << "\n"
<< "CASE m, n = " << m << ", " << n << "\n"
<< std::string(72, '#') << std::endl;
auto rg = ReportGuard(true); for (size_t n = 3; n < 7; ++n) { auto p = make<Presentation<word_type>>(temperley_lieb_monoid(n));
p.contains_empty_word(true);
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(size[n]) == num_right[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "054", "partial_transformation_monoid(4) from FroidurePin", "[fail][low-index]") { using Transf_ = Transf<5>; auto rg = ReportGuard(true);
word_type w = presentation::longest_common_subword(p); while (!w.empty()) {
presentation::replace_subword(p, w);
w = presentation::longest_common_subword(p);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "055", "plactic_monoid(3) up to index 8", "[extreme][low-index][plactic]") {
std::array<uint64_t, 9> const num
= {0, 1, 29, 484, 6'896, 103'204, 1'773'360, 35'874'182, 849'953'461}; auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(3)); for (size_t n = 2; n < 9; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "056", "plactic_monoid(4) up to index 6", "[extreme][low-index][plactic]") {
std::array<uint64_t, 8> const num
= {0, 1, 67, 2'794, 106'264, 4'795'980, 278'253'841, 20'855'970'290}; // Last value too 1h34m to compute so is not included. auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(4)); for (size_t n = 2; n < 7; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "057", "plactic_monoid(5) up to index 5", "[extreme][low-index][plactic]") {
std::array<uint64_t, 7> const num
= {0, 1, 145, 14'851, 1'496'113, 198'996'912, 37'585'675'984}; // Last value took 5h11m to compute auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(5)); for (size_t n = 3; n < 6; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "058", "plactic_monoid(6) up to index 4", "[extreme][low-index][plactic]") {
std::array<uint64_t, 6> const num
= {0, 1, 303, 77'409, 20'526'128, 7'778'840'717}; // The last value took 4h5m to run and is omitted. auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(6)); for (size_t n = 2; n < 5; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "059", "plactic_monoid(7) up to index 3", "[extreme][low-index][plactic]") {
std::array<uint64_t, 5> const num = {0, 1, 621, 408'024, 281'600'130}; // The last value took approx. 12m34s to run and is omitted from the // extreme test 12m34s to run and is omitted from the extreme test. auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(7)); for (size_t n = 2; n < 4; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "060", "plactic_monoid(8) up to index 3", "[extreme][low-index][plactic]") {
std::array<uint64_t, 4> const num = {0, 1, 1'259, 2'201'564}; auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(plactic_monoid(8)); for (size_t n = 2; n < 4; ++n) {
{
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
{
Sims1_ S(congruence_kind::left);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "061", "chinese_monoid(3) up to index 8", "[extreme][low-index][chinese]") {
std::array<uint64_t, 9> const num
= {0, 1, 31, 559, 8'904, 149'529, 2'860'018, 63'828'938, 1'654'488'307}; // index 8 is doable and the value is included above, but it took about X // minutes to run, so isn't included in the loop below. auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(3)); for (size_t n = 2; n < 8; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "062", "chinese_monoid(4) up to index 6", "[extreme][low-index][chinese]") { // n = 6 took between 3 and 4 minutes // n = 7 took 6h16m // both are omitted
std::array<uint64_t, 8> const num
= {0, 1, 79, 3'809, 183'995, 10'759'706, 804'802'045, 77'489'765'654}; auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(4)); for (size_t n = 3; n < 7; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "063", "chinese_monoid(5) up to index 5", "[extreme][low-index][chinese]") {
std::array<uint64_t, 7> const num
= {0, 1, 191, 23'504, 3'382'921, 685'523'226, 199'011'439'587};
// The last value took 21h32m and so is omitted auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(5)); for (size_t n = 3; n < 6; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "064", "chinese_monoid(6) up to index 4", "[extreme][low-index][chinese]") { // 0 1 2 3 4
std::array<uint64_t, 6> const num
= {0, 1, 447, 137'694, 58'624'384, 40'823'448'867}; // The last value took 9h54m to compute, and is omitted! auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(6)); for (size_t n = 3; n < 5; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "065", "chinese_monoid(7) up to index 4", "[extreme][low-index][chinese]") { // Last value took about 50m to compute
std::array<uint64_t, 5> const num = {0, 1, 1'023, 786'949, 988'827'143}; auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(7)); for (size_t n = 2; n < 4; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "066", "chinese_monoid(8) up to index 3", "[extreme][low-index][chinese]") {
std::array<uint64_t, 4> const num = {0, 1, 2'303, 4'459'599}; auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(chinese_monoid(8)); for (size_t n = 2; n < 4; ++n) {
Sims1_ S(congruence_kind::right);
S.short_rules(p).number_of_threads(4);
REQUIRE(S.number_of_congruences(n) == num[n]);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "067", "FreeSemigroup(n) up to index 3", "[extreme][low-index]") { // (27^n - 9^n)/2 - 12^n + 6^n
std::array<uint64_t, 10> const num = {0, 2, 229, 8022, 243241, 6904866}; // 4 ^ n - 2 ^ n // {0, 2, 13, 57, 241, 993, 4033}; // = {0, 1, 29, 249, 2'033, 16'353, 131'009}; // = {0, 1, 830, 81'762, 7'008'614}; auto rg = ReportGuard(true); for (size_t n = 2; n < 8; ++n) {
Presentation<word_type> p;
p.contains_empty_word(true);
p.alphabet(n);
Sims1_ S(congruence_kind::right);
S.short_rules(p);
REQUIRE(S.number_of_congruences(3) == num[n]);
}
// For n >= 1, a(n) is the number of deterministic, completely-defined, // initially-connected finite automata with n inputs and 3 unlabeled states. // A020522 counts similar automata with n inputs and 2 unlabeled states.
// According to a comment by Nelma Moreira in A006689 and A006690, the // number of such automata with N inputs and M unlabeled states is Sum // (Product_{i=1..M-1} i^(f_i - f_{i-1} - 1)) * M^(M*N - f_{M-1} - 1), where // the sum is taken over integers f_1, ..., f_{M-1} satisfying 0 <= f_1 < N // and f_{i-1} < f_{i} < i*N for i = 2..M-1. (See Theorem 8 in Almeida, // Moreira, and Reis (2007). The value of f_0 is not relevant.) For this // sequence we have M = 3 unlabeled states, for A020522 we have M = 2 // unlabeled states, for A006689 we have N = 2 inputs, and for A006690 we // have N = 3 inputs.
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "068", "RepOrc", "[quick][low-index]") { auto rg = ReportGuard(false);
auto p = make<Presentation<word_type>>(temperley_lieb_monoid(9)); // There are no relations containing the empty word so we just manually // add it.
p.contains_empty_word(true);
RepOrc orc; // Check bad input auto d = orc.short_rules(p)
.min_nodes(100)
.max_nodes(90)
.target_size(4'862)
.digraph();
REQUIRE(d.number_of_nodes() == 0);
d = orc.short_rules(p)
.min_nodes(80)
.max_nodes(100)
.target_size(4'862)
.digraph();
S = Sims1_(congruence_kind::left);
REQUIRE(S.short_rules(p)
.long_rules(q)
.number_of_threads(1)
.number_of_congruences(5)
== 9);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "070", "temperley_lieb_monoid(3) - n = minimal rep " "(single-threaded, reporting on)", "[standard][sims1]") { auto rg = ReportGuard(true);
for (size_t n = 3; n <= 3; ++n) { auto p = make<Presentation<word_type>>(temperley_lieb_monoid(n)); // There are no relations containing the empty word so we just manually // add it.
p.contains_empty_word(true); auto d = MinimalRepOrc()
.short_rules(p)
.number_of_threads(1)
.target_size(5)
.digraph();
REQUIRE(action_digraph_helper::is_strictly_cyclic(d)); auto S = make<FroidurePin<Transf<0, node_type>>>(d);
S.add_generator(S.generator(0).identity());
REQUIRE(S.size() == 5);
REQUIRE(d.number_of_nodes() == 4);
}
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "071", "FreeSemigroup(2) up to index 4", "[quick][low-index]") { auto rg = ReportGuard(true);
Presentation<word_type> p;
p.contains_empty_word(true);
p.alphabet(2);
Sims1_ S(congruence_kind::right);
S.short_rules(p);
REQUIRE(S.number_of_congruences(4) == 5'477);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "072", "symmetric_group(n) for n = 4", "[quick][low-index]") {
std::array<uint64_t, 10> const num = {0, 0, 0, 6, 30, 156, 1'455}; auto rg = ReportGuard(false);
size_t n = 4; auto p
= make<Presentation<word_type>>(symmetric_group(n, author::Carmichael));
Sims1_ C(congruence_kind::right);
C.short_rules(p).number_of_threads(4);
REQUIRE(C.number_of_congruences(factorial(n)) == num[n]);
}
for (size_t m = 1; m <= 10; ++m) { for (size_t r = 1; r <= 10; ++r) { // Cyclic groups auto p = make<Presentation<word_type>>(monogenic_semigroup(m, r));
LIBSEMIGROUPS_TEST_CASE("Sims1", "075", "partial_transformation_monoid(4)", "[fail][low-index]") { auto rg = ReportGuard(true); auto p = make<Presentation<word_type>>(
partial_transformation_monoid(4, author::Sutov)); auto w = presentation::longest_common_subword(p); while (!w.empty()) {
presentation::replace_subword(p, presentation::longest_common_subword(p));
w = presentation::longest_common_subword(p);
}
do { auto it = presentation::redundant_rule(p, std::chrono::milliseconds(100));
p.rules.erase(it, it + 2);
} while (presentation::length(p) > 800);
Sims1_ C(congruence_kind::left);
C.short_rules(p).number_of_threads(4).report_interval(10);
REQUIRE(C.number_of_congruences(624) == 0);
}
LIBSEMIGROUPS_TEST_CASE("Sims1", "076", "uninitialized RepOrc", "[quick][low-index]") { auto rg = ReportGuard(false);
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 und die Messung sind noch experimentell.