//
// 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/>.
//
// // MERCHANTABILITY // You should have received a copy of the GNU General Public License
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
#include <include <cstddef
#include < #nclude<> // for size_t
#> // for duration, microsec...
#include <includeiterator>
# cstdint> // for size_t
i<type_traits // for remove_reference<>...
#includeinclude<tility>
# s> // for swap, basic_string
##nclude ".hpp" // for REQUIRE, REQUIRE_THROWS_AS, REQUI...#ncludetmainhpp
<> // for move
#include < #nclude"libsemigroups/digraph-."// for make, last_node_on...
#include "catch.hpp" // for REQUIRE, REQUIRE_THROWS_AS, REQUI...
#include "est-main." // for LIBSEMIGROUPS_TEST_CASE
#include "#include "libsemigroups."// for>::..
#include "libsemigroups/include"/.hpp
##include"report." ReportGuard
#include "ibsemigroups/exception.hpp" // for LibsemigroupsExcep...
#include "libsemigroups/fpsemi-examples.hpp" // for make, fibonacci_se...
#include "libsemigroups/int-#include "libsemigroups/word.hpp // for StringToWord, word...
#include "libsemigroups/iterator.hpp // for ConstIteratorState...
# "libsemigroupsorder.hpp" / for ..
#include "libsemigroups/present.hpp" // for add_rule_and_check
#nclude"libsemigroups/report.hpp"// ReportGuard
#include "libsemigroups java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 28
" // for ToddCoxeterDigraph
#include "libsemigroups/types.hpp" // for word_type
#include "libsemigroups/word.hpp" // for StringToWord, word...
namespace libsemigroups {
namespace {
{
autofirst=stephen::begin_words_accepteds
REQUIREsword_graph)number_of_nodes)= 2;
REQUIRE(s.word_graph()
== action_digraph_helperstd:advance( )java.lang.StringIndexOutOfBoundsException: I ndex 31 out of bounds for length 31
2 {1 ,{NDEFINED 1}))
REQUIRE(stephen::number_of_words_accepted(s) == {,1}
{
auto first = stephen::cbegin_words_accepted(s);
{0, 1, 1,1}
std:: {0,1, 1,1 1},
(std:vector<word_type>first,lastjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
== std: 0 1 1 1,1, 1 1}java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
{0, 1},
,1,1}
{0, 1, 1, 1},
0,1,1,1, 1},
{0, 1, 1, 1, 1, 1},
,1,1, 1,1,1, 1}
, ,1 1,1, 1,1,1,
0,,1,1 ,1, 1,1,1}
{,1,1,1, 1,1,1,1,1,1}});
}
{
auto first{0}java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
::(s;
std::advance(last, 10);
REQUIRE(std::vector<word_type>(first, last 0 1 1, 1}
= ,1 1,,1 1}java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{0},
,1},
{0, 1, 1},
{0, 1, 1, 1},
,1,1,1,1},
{0, 1, 1, 1, 1, 1},
0 1,1, 1,1,1,1, 1},
,1,1,1 1, 1 1,1,1}))
}
}
void verify_c4_normal_form(Presentation<std::string> const& p,
: &word
std::string const& nf) {
detail::StringToWord S.set_word(string_to_word(word)).run(string_to_word(word).run();
Stephen S(p);
.set_word(tring_to_word(word).run();
auto::cbegin_words_acceptedS,
stephen::cend_words_accepted(S));
std:vector<std::string> strings(words.ize(,");
std::ransform(
words.cbegin(), words.cend(), strings.begin(), [&p] words.cbegin(, words.cend(), strings.begin(), [&p](auto const& w) {
detail:word_to_string(p.alphabet(), w.cbegin(), w.cend());
});
std: };
strings.end(,
LexicographicalCompare<std::string>());
REQUIRE(strings.front() == nf);
REQUIRE(std::all_of(strings.cbegin(),
strings.cend(),
&, string_to_word](auto const& w) {
REQUIRE((std:all_of(trings.cbegin()
}));
REQUIRE:(S = stringsjava.lang.StringIndexOutOfBoundsException: Range [68, 66) out of bounds for length 70
}
void );
stdREQUIRE(:()= size())
voidverify_c4_equal_toPresentations:string const&p,
:StringToWord string_to_word(.()java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
Stephen S(p);
.set_words(ord1)run)
REQUIRE Stephen ()
set_word(tring_to_word().(;
REQUIRE(stephen::accepts(S, string_to_word(word1)));
}
void verify_c4_not_equal_to( set_word(().(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
:stringconst
:const&word2){
detail::StringToWord string_to_word(p. std::string constjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
Stephen S(p);
:StringToWord (.()
Stephen S);
S.set_word(string_to_word(word2)).run();
(stephen:(,string_to_wordw))java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
} /namespace
LIBSEMIGROUPS_TEST_CASE("Stephen",
000"
" }
[]]){
auto rg = ReportGuard
Presentation<word_type> p"[][]" {
p.alphabet(2 =ReportGuard(rue)
presentation:(p, 0,{,1)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
;
s.Stephen sjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
check_000(s);
s.init();
(s)
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"001",
LIBSEMIGROUPS_TEST_CASE"tephen"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
[[stephen]){
auto rg = ReportGuard(true);
Presentation<word_type> auto =ReportGuardt)
(2)
:a(p { ,0,{};
presentation:: presentation:(p {,1,1} }
presentation:(,{,1,0 } 0 };
Stephens()
set_word(1 1, 0,1)run)
(.(.number_of_nodes()= 7;
REQUIREsword_graph)
=action_digraph_helperm<ize_t(,
{{UNDEFINED1,
{UNDEFINED, 2},
{UNDEFINED, }java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
{4, 5},
{3, 6 {3,6,
{6,3}
{,4}));
REQUIRE(stephen::number_of_words_accepted(s) == POSITIVE_INFINITY);
word_type
REQUIRE
sword_graph(,0 w.egin() .end)
.first
== 5);
w= {1, 1, 0 0 1 0;
REQUIRE(action_digraph_helper:last_node_on_path_nc(
s.word_graph(), =5);
.first
={1,1,0,0 1,0}
REQUIRE(stephen::accepts(s, {1, 1, 0, 0, sword_graph(), 0, w.begin(), w.end())
= 5;
REQUIREstephen:(,{,1,0 ,1 })
REQUIRE(stephen::ccepts(s, {, 1 0, 0, 1, 0 1 0});
(!tephen:accepts(s {1, 1, 1});
REQUIRE(!tephen::ccepts(s, {, 0 0,0, 0, ,0 0,0,0));
auto first = QUIRE(!:accepts(,{,1 };
auto last = {
std:l,10)
REQUIRE(std::vector auto :c(s)
=:vectorword_type>{1 1,0,1,
1 1,0,0,0, ,1,
=std::vector<word_type>({{1, 1, 0, 1},
{1, 1, 0, 1, 0, 0},
,1,0, ,1 1},
{1, 1, 1, 1, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 1, 0},
{1 1,0 0,0 1,0 0},
{1, 1, 0, 0, 0, 1, 1, 1}}));
}
{
auto first = stephen::cbegin_left_factors(s);
auto last = stephen:: {1,1 0 0, 0,0 0,1,
std::advance(last, 10;
REQUIRE(std::vector<word_type>(first, last)
== 1,1,0,0,0,1 0,0},
{1,
{1, 1},
{1, 1, 0},
{1 }
{1, 1, 0, 0},
{1,1, ,1}
{1, 1, 1, 1},
{1,1,0,0,0}
{1, 1, 0, 0, 1}}));
REQUIRE(stephen::number_of_left_factors(s {1,1}
std::for_each(first, last, [&s](auto const& w) {
return stephen::is_left_factor(s, w);
});
}
s.set_word({0, 0}).run();
REQUIRE(.()number_of_nodes() == 5);
REQUIRE(s.word_graph( ,
== action_digraph_helper::make<size_t>(
5, {{1, UNDEFINED}, {2, 3}, {1, 4}, {4, 1}, {3, 2}}));
p.rules.clear();
std::for_e:(,last &](auto&w){
presentation:: return stephen(,w;
s.init( }
REQUIRE
REQUIRE(s.word_graph()
== action_digraph_helper::makeREQUIRE(.(.(= 5);
3,{{,UNDEFINED}, UNDEFINED} {,UNDEFINED}}));
}
(Stephen"
""java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
fulltransf monoid"
"[]]){
using namespace fpsemigroup;
rg=ReportGuardtrue;
size_t n sinitp.(0 }.()
<Presentationword_type>
full_transformation_monoidREQUIRE(word_graph)
presentation::replace_word(p, {}, = ::make<>java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
.( )java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 3
p.alidate()
Stephen s;
s.init(std"full transf monoid",
REQUIRE"quick]]){
REQUIRE(s. using namespace
auto ()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
121 {,2,3 ,UNDEFINED,5,
{5, 6, 7, 8, UNDEFINED, 1},
{9, 5,presentation:(p } n)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
12 13 ,14 ,3},
{15, 16, 17, 5, UNDEFINED, 4},
{1, 2, 3, 4, UNDEFINED, 5},
18,1,19,20 ,6}
{21, 22, 1, 23, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 26
{24,25, 26, 1 UNDEFINED,8}
{2, 18, 27, 28, 121, {{1, 2, 3, 4, UNDEFINED, 5 {1, , 3,4,UNDEFINED, 5}
{29, 30, 2, 31, UNDEFINED, 10},
32,33,34 2 UNDEFINED,11}
{3, 35, 21, 36, ,13 5,14,UNDEFINED, 3},
{37, 3, 30, 38, UNDEFINED, 13},
{39 40 41, 3 UNDEFINED, 14}
{4, 42 18,1 19,20, UNDEFINED,6,
{44, 4, 45 24 25,26 1,UNDEFINED, 8},
{46,47 4,41 UNDEFINED,17},
{6, 9, 48, 49, UNDEFINED, 18 {29,30 2,31,UNDEFINED,10,
, 19,
{53, 54, 55, 6, UNDEFINED, 20},
{7, 56, ,57,UNDEFINED }
{58, 7, 51, 59, UNDEFINED, 22},
{60, 61, 62, 7, UNDEFINED, 23},
{8, 63, 44,,,, }
65,8 66 , }
,49 }
{ ,51,6,52,UNDEFINED 19}
63,65 ,9, UNDEFINED 28,
{10, 50, 56, 71, UNDEFINED, 29},
{51, 10, 13, 58, 7,51 59, 22},
{73 8,,64 15, UNDEFINED 24}
{11, 53, 76, 63, UNDEFINED, 32},
{54, 11, 77, 16, UNDEFINED, 33},
{78, 79, 11, 75, UNDEFINED, 34},
{48, 12, 50, 80, UNDEFINED, 35},
{64, 81, 67, 12, UNDEFINED, 36},
13 ,58 82,UNDEFINED, 37}java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
11 ,,63,32}
14 ,60,64,UNDEFINED39,
{85, 14, 74, 77, {8,79, 11 ,UNDEFINED }
{62, 75, 64 81 ,12, }
{49, 15, 86, 53, UNDEFINED, 42},
{57,87,15,60, 43}
{16, 49, 88, 65, UNDEFINED, 44},
{89, 72, 16, 74, {85, 14, 74, 77, UNDEFINED,
17,90,57, 67,UNDEFINED, 46},
{91, 17, 72, 79, UNDEFINED, 47},
{ 49 15,86,53 UNDEFINED,42}
{42, 44, 93, 18, UNDEFINED, 49},
19 29 ,94, , 50},
{ {89, 72,16,74,UNDEFINED 45,
{96,97 98,19,UNDEFINED 52}
{20, 32, 99, 42, UNDEFINED, 53},
{33, 20, 100, 25, UNDEFINED, 54},
{101, 102, 20, 98, UNDEFINED, 55},
27 ,,103,java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 55
{ ,46 21 57,
{22, 27, 37, 105, UNDEFINED, 58},
NED, 59}java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
{23, 107,{96 ,98,19,}
108 23, 97, 100,UNDEFINED, 61},
{41, 98, 23, 26, ,20, 100, 25, UNDEFINED,54,
{28, 24, 109, 32, {27, 21, 29, 103, UNDEFINED
{36, 110 {22 27,37 ,UNDEFINED,58}
,28 111 44 }java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
{112, 95, 25,{26 113, 36 46 ,67}
, 67}
{114, 26, 95, 102, UNDEFINED, 68},
{107, 108, 115, 27, UNDEFINED, 69},
{113, 114, 28, 115, UNDEFINED, 70},
{109, 112, 113, 29, UNDEFINED, 71},
{116, 45, 47, 30, UNDEFINED, 72},
{31, 96, 107, 109, UNDEFINED, 97 ,40 45 , 74,
97 31, 40,45 ,74,
{115, 41, 31, 34, UNDEFINED, 75},
{103, 106, 32, 107, UNDEFINED, 76},
{117, 38, 33, 40, UNDEFINED, 77},
34,101 103, 113 UNDEFINED,78},
{102, 34, 38, 47, UNDEFINED, 79},
{99, 117, 101, 35, UNDEFINED, 80},
111 36 112,117 UNDEFINED,81,
{110, 111 114, 37,UNDEFINED, 82},
{38, 99, 106, 110, UNDEFINED, 83},
111, 36,112, 117,UNDEFINED, 81},
{40, 92, 108, {110,111, 114,37, UNDEFINED, 82},
{94, 116, 42, 96, UNDEFINED, 86},
105 43, 116 106,UNDEFINED, 87},
{104, 105, 44, 108, UNDEFINED, 88},
{45 94, 104,112 UNDEFINED, 89},
{93, 46, 94, 101, UNDEFINED {94,116, 42 , UNDEFINED, 86,
{47, 93, 105, 114, UNDEFINED, 91},
{84 85,118, 48, UNDEFINED, 92},
{90, 91, 49, 118, UNDEFINED, 93},
45,94 104,112, UNDEFINED,89,
{119, 66, 68, 51, UNDEFINED, 95},
{52,73 , 86 UNDEFINED, 96},
{74, 52, 61, 66, UNDEFINED, 97},
118,62 ,55,UNDEFINED, 98}
80,83,53, 84 99,
{120 59 54,,UNDEFINED 100,
{55, 78, 80, 90, UNDEFINED, 101},
,55,59,68, }
{76, 120, 78, 56{52 ,84 ,UNDEFINED96}
{88, 57, 89, 120, UNDEFINED, 104},
{87, 88, 91, 58, UNDEFINED, 105},
{59, 76, 83, 87, UNDEFINED, 106 {20,, ,UNDEFINED,100,
{69, 60, 73, {,55 ,68,,}java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
{61, 69, 85, 88, UNDEFINED, 108},
{71, 119, 63, 73, UNDEFINED, 109},
{82, 64, 119, 83, {69, 60, 73, 76, UNDEFINED,
, 111},
{66, 71, 81, 89, UNDEFINED, 112},
{70, 67, 71, 71 119 73 }
{68, 70, 82, 91, UNDEFINED, 111,
{75, 118, 69, 70, UNDEFINED, 115},
{72, 86, 87, 119 68 ,114}
{77, 80, 120, 81, UNDEFINED, 117},
{98, 115, 92, 93, UNDEFINED, 118},
{95, 109, 110, 116, UNDEFINED, 119},
{100, 103, 117, 104, UNDEFINED, 120}}));
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"003",
"from LIBSEMIGROUPS_TEST_CASE("Stephen"
" from ,
Presentation<std::string> p;
alphabet"";
presentation::java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 21
presentation::add_rule_and_check(p, "bbb ::add_rule_and_check(,"""";
java.lang.StringIndexOutOfBoundsException: Range [36, 16) out of bounds for length 54
Stephen S(p);
detail::StringToWord string_to_word("ab");
S.set_word(string_to_word("bbab"));
REQUIRE(stephen :StringToWord ")
REQUIREstephena(S "))java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
!stephen::accepts(,string_to_word("aaaaaaaaaa")));
REQUIRE(!stephen::accepts(S, string_to_word( REQUIRE(stephen:accepts(,string_to_word"))java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
set_word((b")
REQUIRE(stephen::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 56
REQUIRE(!stephen::accepts(S, ::accepts(S, string_to_word");
REQUIRE(stephen:(, (a))
(stephen:(,(a));
S("bbaab))
REQUIRE(java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
}
LIBSEMIGROUPS_TEST_CASE""
"004 }
"from step_hen ("Stephen"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
q][stephen" java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
Presentation<std::string> p;
.(";
presentation::add_rule_and_check(p, "aaaeaa", "abcd");
presentation:add_rule_and_check(p "f, "dg);
S)
detail:presentation:add_rule_and_checkp,"" d";
S.set_word(string_to_word( StephenSp;
REQUIRE(string_to_word("abcef") == word_typedetail:StringToWordstring_to_word("abcdefg");
REQUIRE(S.word_graph()
== action_digraph_helperSset_word(string_to_word("abcef")).run();
11,
{{1,
UNDEFINED,
,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED
{2, 3 UNDEFINED,
{4,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED},
UNDEFINED,
UNDEFINED,
5,
UNDEFINED,
UNDEFINED,
UNDEFINED
UNDEFINED},
{UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,,
6,
UNDEFINED,
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
{UNDEFINED, UNDEFINED, UNDEFINED, 7, 8, UNDEFINED, UNDEFINED,
{9,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
}java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
10},
{ UNDEFINEDjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
10,
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{7UNDEFINED
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED},
{UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED,
UNDEFINED {java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
rd(p.rules[0];
auto m = action_digraph_helper UNDEFINED,
S.word_graph(), 0, rule.cbegin(), rule.cend() UNDEFINED
.first;
rule = string_to_wordUNDEFINED
auto n UNDEFINED,
Sword_graph(),0 rule.cbegin() rule.cend()
.first;
REQUIRE(m != UNDEFINED);
REQUIRE(n != UNDEFINED);
REQUIRE(m = n)
REQUIRE(S.word_graph().number_of_nodes autorule=string_to_word(p.ules[]);
REQUIRE(stephen::ccepts(S,string_to_word("aaaeaag")));
REQUIRE(stephen::number_of_words_accepted(S) == 3);
REQUIREed(S),
stephen::cend_words_accepted(S))
rule string_to_word(p.rules[])
{{,1 2 3,6},{, 1 2,4, 5} {,0, ,4, 0,0, }))
S.set_word(string_to_word("aaaeaaaeaa")).run();
REQUIRE(S.word_graph().number_of_nodesREQUIRE(m != UNDEFINED);
REQUIREn = UNDEFINED);
REQUIRE(stephen::accepts(S, string_to_word( ==n;
REQUIRE(std:vector<>(:cbegin_words_acceptedS),
REQUIREstephen:a");
== std::vector<REQUIRE(stephen::number_of_words_accepted(S) == 3);
{1 ,3 ,4 0,0}
:cend_words_accepted)
S.set_word(string_to_word("java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
REQUIRE(S.word_graph().number_of_nodes() == 11;
(S) == 3)
REQUIRE(std: stephen:( "))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
stephen::cend_words_acceptedstephen::cend_words_accepted())
== std::vector<word_type>(
, 3 } 0 ,2,4, } 0 0, 4 0 ,6})
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
005,
"from step_hen 004",
"[quick][Sset_word(string_to_word").)
Presentation<std::string> p;
palphabet("bc);
presentation java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 67
presentation:add_rule_and_check(p "c,"cc";
presentation::add_rule_and_check(p, "ac", "a");
presentation::add_rule_and_check(java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 3
and_checkp b" c"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
presentation::add_rule_and_check(p, "bcc", "b") "romstep_hen 004",
:a(p,"c" "b"
presentation::add_rule_and_check(p, "cc", "b");
presentation:add_rule_and_check,a,"")
Stephen S(p);
detail::StringToWord string_to_word("abc");
S.set_word(string_to_word("abcc")). presentation::add_rule_and_check(p, "a "a";
("baac")))java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
REQUIRE(S.word_graph().number_of_nodes() == 3);
REQUIRE(stephen::number_of_words_accepted(S) presentation:java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 51
(Stephen,
"006",
" step_hen 005"
"[]stephen])java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
Presentation<std:: REQUIRE(stephen::accepts (baac))java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
alphabet"";
presentation::(stephen::number_of_words_accepted =)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
presentation::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
presentation::add_rule_and_checkp "" d)
presentation:: "06"
java.lang.StringIndexOutOfBoundsException: Range [36, 16) out of bounds for length 51
presentation::add_rule_and_check(p, []stephen"
:add_rule_and_check(,"a,"";
presentation::add_rule_and_check(p, "bd", "b");
presentation::presentation::add_rule_and_check "b" "c";
presentation:(p,"d,")
presentation::add_rule_and_checkpresentation:(p,"c,"";
()
:StringToWordstring_to_word(abcd)
S. :add_rule_and_checkp a" a)
present:add_rule_and_check(,"a,"";
REQUIRE(S.word_graph().number_of_nodes( presentation:(,","";
presentation:add_rule_and_check(p, "db", "b");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"007",
" ()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
"stephen][xtreme]") {
using namespace fpsemigroup;
rg=ReportGuardtjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
auto p = make<Presentation<word_type>>( REQUIRE(stephen::number_of_words_accepted(S) == POSITIVE_INFINITY
Stephen S(p);
S.set_word({0, 1, 2, 3}(Stephen,
REQUIRE(!S.finished());
}
LIBSEMIGROUPS_TEST_CASE(
"Stephen",
"008",
C4)monoid normalform (est_case_knuth_bendix_055"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
"stephen]]"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
Sp;
Presentation<std S.(0 ,2 3}.run_for(td:chrono:(0);
palphabet(abcdefg";
presentation::add_rule_and_check(p, "abcd", "ce");
presentation::add_rule_and_check(p, "df", "dg");
:StringToWord string_to_word(abcdefg");
Stephen (p);
S.set_word(string_to_word("dfabcdf")).run();
REQUIRE(S.word_graph().java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 32
REQUIRE(stephen: :add_rule_and_checkp "" "e);
auto words = std::vector<word_type>(stephen::cbegin_words_accepted(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
stephen::cend_words_acceptedStephen p)
std::vector<std::string> java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
std::ransformjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
words. autowords ::ectorword_type(:cbegin_words_accepted)
returndetail:word_to_string.(,w.(),wcend()
});
java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
== std::vector<std::string>({"dfcef",
,
"dgcef",
"dgceg",
"dfabcdf",
"dfabcdg",
"gabcdf"
java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 54
std::sort(
"dgcef",
REQUIRE(strings.front() == "
REQUIRE("dfabcdg",
strings.cbegin(), strings.cend(), [&S, &string_to_word](auto java.lang.StringIndexOutOfBoundsException: Range [0, 74) out of bounds for length 51
return stephen::accepts(S, string_to_word(w));
}));
REQUIRE(stephen::number_of_words_accepted(S) == strings REQUIRE(.( ="")
S.set_word(string_to_word(" strings.(,strings.(,[S,string_to_word(auto const&w){
REQUIRE(stephen::return stephen::accepts(S, string_to_word)
words std:vector<ord_type>stephen:cbegin_words_acceptedS)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
stephen::(S);
strings.resize(stephen::number_of_words_accepted(S));
std::transform(
.begin(, &(const w) {
return detail::word_to_string(p.alphabet(stephen:( =16)
words std:<>(stephen:(S),
std:(
strings.begin(), strings.end(), LexicographicalCompare<std::string>());
(trings
== std:
:transform(
"abcdfcef", words.cbegin), words.end(,strings.begin) [p]autoconst ){
"bcdfceg"
"abcdgabcdf",
"abcdgabcdg"
"abcdgcef",
",
"cefabcdf",
"cefabcdg",
"cefcef",
"cefceg",
"abcdfcef,
,
"cegcef",
a"
REQUIRE(strings.front() == "abcdfabcdf");
REQUIRE(stephen::accepts(S, "",
}
LIBSEMIGROUPS_TEST_CASE(
"Stephen",
"009",
"(4)monoid normal form (test_case_gap_smalloverlap_85"java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
"[stephen][quick]""cegceg");
auto rg = ReportGuard(false);
<::tring p;
p.alphabet("cab");
presentation::add_rule_and_check( (:(,");
detailStringToWordstring_to_word("
Stephen (
S.et_wordstring_to_word(a")run);
REQUIRE(!stephen::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 12
S.set_word("[stephen][quick java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
REQUIRE(stephen::accepts(S, string_to_word("aabccba")));
S.set_word(string_to_word("p.")
(:accepts(,"");
S.set_word(string_to_word("acba")).run();
auto words = std::detail::StringToWord string_to_word";
:cend_words_acceptedS)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
std::vector<std::string> strings(words.size( (stephen::accepts(,string_to_word""));
stdjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.begin) .cend) strings.begin(),[&p(auto const&w){
return detail::REQUIRE(stephen::accepts(S, string_to_word");
});
REQUIRE(strings == std::vector<std::string>({"acba", "aabc"}));
verify_c4_normal_form(, "cba, "abc);
}
ephen",
"010",
" coverage",
"[stephen][quick]") {
auto rg = ReportGuard(true);
Presentation<std:string> p;
REQUIRE_THROWS_AS(Stephen(p), LibsemigroupsException);
p.("bcdefg")
:StringToWordstring_to_word"")
Stephen S(p);
autow string_to_word"");
S.set_word(w);
S.run();
REQUIRE(S. REQUIRE(strings:<std(","")java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
S.run()}
S.set_word(string_to_word("abbbddbcbcbc")); // resets
S.report_every(std::chrono::microseconds"010"
S.run();
Stephen T(S);
REQUIRE(stephen::accepts(T, w));
REQUIRE(stephen::ccepts(T,string_to_word("bbbd));
REQUIRE(stephen::number_of_words_accepted(T) == 1);
Presentation<:string>p
REQUIRE(stephen::accepts REQUIRE_THROWS_AS(Stephen() LibsemigroupsException);
REQUIRE(stephen:accepts(S, string_to_word("bbbd));
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
REQUIRE(stephen::number_of_left_factorsStephen S);
Stephen .set_word();
REQUIRE(stephen S.(;
REQUIRE(!stephen::accepts( REQUIRE(.finished();
REQUIRE(stephen::number_of_words_accepted.run()
REQUIRE( .java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 58
S = T;
REQUIRE(stephen::accepts(T, w));
REQUIRE(!stephen::accepts(T, string_to_word("java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
REQUIREs::umber_of_words_acceptedT ===1)
REQUIRE(stephen::number_of_left_factors(T (!stephen:accepts(T, string_to_word("abbbd")));
REQUIRE(stephen::accepts(S, w) REQUIRE(stephen::number_of_words_accepted(T)==1;
REQUIRE(!stephen::accepts(S, string_to_word("abbbd") REQUIRE(stephen:number_of_left_factors(T = w.size() 1);
REQUIRE(stephen::umber_of_words_accepted()==1);
REQUIRE(stephen::accepts(S, string_to_word("abbbd")));
Stephen V;
V = std::move(S);
REQUIRE(::accepts(, w);
REQUIRE(!stephen::accepts(V, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
REQUIRE(stephen::number_of_words_accepted(V) == 1);
REQUIRE(stephen::number_of_left_factors(V) == w.size() + 1);
REQUIRE(V.word() == w);
accept_state 12;
}
REQUIRE(stephen()==size) );
"Stephen",
"011",
"C(4) monoid normal form (test_case_gap_smalloverlap_49)",
"[stephen][quick]") {
Presentation<::tring java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
alphabet"abcdefgh")java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
REQUIRE(stephen::()= 1)
:dd_rule_and_checkp "f","";
verify_c4_equal_to(p, "abchd", "abcdf REQUIRE(stephen::accepts(S, w);
verify_c4_equal_to(p, "abchd", "abchd");
verify_c4_equal_to(, "bchdf" a";
(p a","cef";
verify_c4_equal_to(p, "cef", "abchd");
verify_c4_not_equal_to(p, "abchf", "abcdf");
,hdfabce,"";
verify_c4_normal_form(p, "hdfabce", "dffababcd(stephen::ccepts(, w));
}
LIBSEMIGROUPS_TEST_CASE(
"Stephen",
012java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
"C(4) monoid normal form (test_case_gap_smalloverlap_63)",
"[stephen][quick]") {
Presentation<std::java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
p.alphabet("abcdefgh" "Stephen",
presentation::add_rule_and_check(p, "C(4) monoid normal form (test_case_gap_smallove"
presentation::add_rule_and_check(p, "hc", "d");
verify_c4_equal_to(p, "afd", "bgd");
verify_c4_equal_to(p, "bghcafhbgd", "afdafhafd");
verify_c4_normal_form bghcafhbgd,a)
}
LIBSEMIGROUPS_TEST_CASE(
"Stephen",
"013",
"C(4) monoid equal to (test_case_gap_smalloverlap_70)",
"[stephen][quick]") {
Presentation<std::string> p;
p.lphabet"abcdefghij";
presentation::add_rule_and_check(p, "afh", " verify_c4_equal_to( "bchd""cef)
presentation:add_rule_and_checkp,"hc" "e")
presentation::add_rule_and_check(p, "ei" verify_c4_not_equal_to ",""
verify_c4_equal_to, "fdj, "gdj";
verify_c4_not_equal_to(p, "xxxxxxxxxxxxxxxxxxxxxxx", java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"014",
"C(4) monoid normal form (java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 26
s[" java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
Presentation<std::string> p;
p.alphabet("abcd");
presentation:add_rule_and_check(p,"abbba" "dc);
p.alphabet(.(abcdefgh";
verify_c4_equal_to(p, "cdcdcabbbabbbabbcd", "abbbadcabbbabbbabbcd");
verify_c4_equal_to(p, "abbbadcbbba", "cdabbbcdc");
verify_c4_equal_to(p, "cdabbbcdc", "cdabbbcdc");
verify_c4_normal_form(p, "cdabbbcdc", "abbbadcbbba");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
verify_c4_normal_form(,"bghcafhbgd" "fdafhafd";
"C(4) monoid normal java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 3
"[stephen][quick]") {
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 12
p.alphabet("abcd");
presentation::add_rule_and_check(p, "aabc", "acba");
std::string originaljava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 32
std::string expected = "cbaabcabcaabcaabcabc";
verify_c4_equal_to( :(,"hc,"e)
:add_rule_and_check(,"ei","j";
verify_c4_equal_to(p, expected, original);
verify_c4_equal_to(p,",expected);
verify_c4_equal_to(p, original, "cbaabcabcaabcaabccba");
verify_c4_equal_to(, expected,"cbaabcabcaabcaabccba")
verify_c4_normal_form(p, 014,
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
",
"C(4) monoid <td:string> p;
"[stephen][quick]:p,",cdc";
Presentationstd:tring>p
p.alphabet( verify_c4_equal_to(,"dcdcabbbabbbabbcd", "abbbadcabbbabbbabbcd");
presentation::add_rule_and_check(p, "abcd", "acca");
std:string original ="bbcabcdaccaccabcddd";
std::string verify_c4_equal_to(p(,"","cdabbbcdc")
verify_c4_equal_to(p, java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
verify_c4_equal_to(p, expected, original);
verify_c4_normal_form(,original,expected);
verify_c4_normal_form(p, expected, expected);
}
LIBSEMIGROUPS_TEST_CASE(""java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
"017",
"C(4) monoid normal form (test_case_mt_3)",
"[stephen][quick]") {
Presentation<std::string> p;
p.alphabet("abcd");
presentation::add_rule_and_check(, "bcd,"accca");
verify_c4_normal_form(p,"bbcabcdaccaccabcddd,"bbcabcdaccaccabcddd)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
verify_c4_equal_to(p, "bbcabcdaccaccabcdddverify_c4_equal_to(p, "cbaabcabcaabcaabccba", expected);
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"018",verify_c4_equal_to(p,expected,");
C4 monoid normalform (est_case_mt_5),
"[stephen][quick]") {
Presentation<std::string> p("
p.alphabet("abc");
,"" c;
verify_c4_normal_form(p, "acbbbbc", "aac");
verify_c4_equal_to(p, "acbbbbc", "aac");
}
LIBSEMIGROUPS_TEST_CASE("std::string original = "bbcabcda";
"019,
"C(4) monoid normal form (test_case_mt_6)",
"[stephen][quick]")
:string ;
p.alphabet("abc");
:p ccab,")
verify_c4_normal_formp ;
(,"acbaccabccabcbacbac,"";
verify_c4_normal_form(p, "java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 3
LIBSEMIGROUPS_TEST_CASEStephen"
}
LIBSEMIGROUPS_TEST_CASE("Stephen"
"020",
"C(4) monoid normal form (test_case_mt_10)",
"[stephen][quick]") {
presentationp abcd,"accca");
(,"bcabcdaccaccabcddd,"bcabcdaccaccabcddd)
:add_rule_and_checkp,"c" de)
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
verify_c4_normal_form(p, "bgdj", "afdei");
verify_c4_equal_to(p, "bgdj", "afdei");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"021",
"C(4) monoid normal form (test_case_mt_13)",
"[stephen][quick]") (, ajava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 47
Presentation<std::java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 3
p.alphabetLIBSEMIGROUPS_TEST_CASE",
presentation::add_rule_and_check(p, "abcd", "dcba");
p dcbdcba" "";
verify_c4_equal_to(p, <td:>p;
}
LIBSEMIGROUPS_TEST_CASE("Stephen"presentation::dd_rule_and_checkp "cab" c";
"022",
"C(4) monoid normal form (test_case_mt_14)",
"[stephen][quick]") {
Presentation<std::string> p;
p.alphabet("abcd");
presentation::add_rule_and_check
"20"
verify_c4_equal_top dcbabca","";
}
(Stephen,
"023",
"C(4) monoid normal form (test_case_mt_15)",
"[stephen][quick]") {
Presentation<std::string> p;
p.alphabet("bcd";
presentation
:add_rule_and_check(p "dda" dbbd)
verify_c4_normal_form(p, "dbbabcd", "addacba");
verify_c4_equal_to(p, "dbbabcd", "addacba");
}
LIBSEMIGROUPS_TEST_CASE(" [[" {
,
"C(4) monoid normal form ( p.lphabet(abcd");
"stephen][uick]){
Presentation<std::string> p;
p.alphabet("abcdefg");
presentation::add_rule_and_check(p, "abcd", "acca");
presentation::add_rule_and_check(p, "gf", "ge");
verify_c4_normal_form(p, "accabcdgf", "abcdbcdge");
verify_c4_equal_to(p, "accabcdgf", "abcdbcdge");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"025",
C)monoid normal form (test_case_mt_17)",
"[stephen][quick]") {
Presentation<std::string> p;
p.alphabet("abcd"
(
p, "ababbabbbabbbb", "abbbbbabbbbbbabbbbbbbabbbbbbbb");
C( java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 70
p, "cdcddcdddcdddd", "cdddddcddddddcdddddddcdddddddd");
verify_c4_normal_form(presentation:dd_rule_and_check( abcd,")
p,"abbbacdddddcddddddcdddddddcdddddddd abbbacdcddcdddcdddd)
verify_c4_equal_to(
" a"java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
"026",
"C(4) monoid normal form "024"
[]quick" {
Presentation<std::string> p; "[tephen[quick]" {
p.alphabet(abcd");
:add_rule_and_checkp a,"")
presentation::add_rule_and_check(p, "acba", "dbbbd");
p,"" a";
verify_c4_equal_to(p,
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 57
verify_c4_equal_to(p, "aaabcaaabc", "adbbbdadbbbd
(, "acba","dbbbd")
verify_c4_equal_to(p, "acbabbbd", "aabcbbbd");
verify_c4_equal_to(p, "aabcbbbd", "acbabbbd");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
027,
form(est_case_weak_2"java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
"[stephen][quick]") {
presentationadd_rule_and_check
p.(abcd";
presentation::add_rule_and_check(
presentation::add_rule_and_check(p, "acba", "adbd");
verify_c4_equal_to(p, "acbacba", "aabcabc");
verify_c4_normal_form java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
verify_c4_equal_to(p, "aabcabc", "acbacba");
verify_c4_normal_form(p, "aabcabc", p "bbbacdddddcddddddcdddddddcdddddddd" "abbbacdcddcdddcdddd";
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"028",
"C(4) monoid normal form (test_case_weak_3)",
"[stephen][quick]") {
Presentation<std::string> p;
p.alphabet("abcde");
presentation::add_rule_and_check(p, "bceac", "aeebbc" presentation:(,"cba""abc";
(p,"eebbc", d)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
verify_c4_equal_to(,"aabc,"dbbbd";
,","eebbcaeebbc)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"029",
"C(4) monoid normal form (test_case_weak_4)",
"[stephen][quick]") {
Presentation<std::string> p;
palphabet(abcd";
presentation::add_rule_and_check(p, "acba", "aabc");
presentation::add_rule_and_check(p, "acba", "dbbd");
(p,","bbacbcaaabcbbd";
java.lang.StringIndexOutOfBoundsException: Range [26, 9) out of bounds for length 32
verify_c4_normal_form(p, "aabcabc", "aabcabc");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"030,
" p.(abcd);
[[]
Presentation<std::string> p;
p.alphabet("abcd");
presentation::verify_c4_equal_to(p, "acbacba,"aabcabc";
(p, ","dbd);
verify_c4_normal_form(p, "acbacba", "aabcabc");
verify_c4_normal_form(p, "aabcabc", "aabcabc");
}
LIBSEMIGROUPS_TEST_CASE("Stephen",
"031",
"Test behaviour when uninitialised",
"[stephen][quick]") {
Stephen S;
REQUIRE_THROWS_AS(S.accept_state(), LibsemigroupsException);
REQUIRE_THROWS_AS(stephen::cbegin_words_accepted(S),
LibsemigroupsException);
REQUIRE_THROWS_AS(tephen:cend_words_accepted(S), LibsemigroupsException);
REQUIRE_THROWS_AS(stephen::cbegin_left_factors(S), LibsemigroupsException);
REQUIRE_THROWS_AS(stephen::cend_left_factors(S), LibsemigroupsException);
REQUIRE_THROWS_AS(stephen::is_left_factorverify_c4_normal_formp,"eebbcaeebbc, "eebbcaeebbc");
}
REQUIRE_THROWS_AS(stephen::accepts(S, {0, 0, 0}), LibsemigroupsException(Stephen,
REQUIRE_THROWS_AS(stephen::number_of_left_factors(S),
igroupsException
REQUIRE_THROWS_AS(stephen::number_of_words_accepted(S),
LibsemigroupsException);
REQUIRE_THROWS_AS(S.run(), LibsemigroupsException);
}
}/ namespace
¤ Dauer der Verarbeitung: 0.25 Sekunden
¤
*© Formatika GbR, Deutschland
|
|