From 07648e86afe92bb3f1534e1609382b21c11b3adf Mon Sep 17 00:00:00 2001 From: Ruth Hoffmann Date: Fri, 30 Aug 2024 13:19:53 +0100 Subject: [PATCH 1/3] fixed testing --- tst/AuxFun.tst | 6 -- tst/SubAut.tst | 4 +- tst/chap10.tst | 19 +++--- tst/chap2.tst | 8 +-- tst/chap4.tst | 2 +- tst/chap6.tst | 92 ++++++++++++------------- tst/chap8.tst | 21 ++---- tst/chap9.tst | 15 ++--- tst/experiments.tst | 1 - tst/testall.tst | 161 ++++++++++++++++---------------------------- 10 files changed, 130 insertions(+), 199 deletions(-) diff --git a/tst/AuxFun.tst b/tst/AuxFun.tst index 40ef79b..9a67382 100644 --- a/tst/AuxFun.tst +++ b/tst/AuxFun.tst @@ -3,23 +3,19 @@ #A AuxFun.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - gap> a1:=RationalExpression("(bUcUd)*ab*"); (bUcUd)*ab* gap> a2:=RationalExpression("(acUd)*(aU@)"); (acUd)*(aU@) gap> NDIntersectionAutomaton(a1,a2); Error, The arguments must be two automata over the same alphabet - gap> a2:=RationalExpression("(acUd)*(aUb)"); (acUd)*(aUb) gap> NDIntersectionAutomaton(a1,a2); < epsilon automaton on 5 letters with 9 states > - gap> NDUnionAutomata(a1,a2); Error, The arguments must be two automata gap> a1:=RatExpToAut(RationalExpression("(bUcU@)*ab*")); @@ -28,7 +24,6 @@ gap> a2:=RatExpToAut(RationalExpression("(acUd)*(@Ub)")); < deterministic automaton on 4 letters with 4 states > gap> NDUnionAutomata(a1,a2); Error, The arguments must be two automata over the same alphabet - gap> a1:=RatExpToAut(RationalExpression("(bUcUdU@)*ab*")); < deterministic automaton on 4 letters with 3 states > gap> a2:=RatExpToAut(RationalExpression("(acUd)*(@Ub)")); @@ -41,5 +36,4 @@ gap> a2:=RatExpToAut(RationalExpression("(acUd)*(@Ub)")); < deterministic automaton on 4 letters with 4 states > gap> NDUnionAutomata(a1,a2); Error, The arguments must be two automata over the same alphabet - gap> STOP_TEST( "AuxFun.tst", 10000 ); diff --git a/tst/SubAut.tst b/tst/SubAut.tst index 8d7741d..ff8b0db 100644 --- a/tst/SubAut.tst +++ b/tst/SubAut.tst @@ -3,7 +3,6 @@ #A SubAut.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); @@ -16,11 +15,10 @@ gap> InbetweenPermAutomaton([1,2,3,4,5,6,7],[1,2,3]); gap> InbetweenPermAutomaton([5,4,3,2,1],[1]); < deterministic automaton on 5 letters with 7 states > gap> InbetweenPermSet([1,2,3,4,5,6,7],[1,2,3]); -[ [ 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 1, 2, 3, 4, 5 ], [ 1, 2, 3, 4, 5, 6 ], +[ [ 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 1, 2, 3, 4, 5 ], [ 1, 2, 3, 4, 5, 6 ], [ 1, 2, 3, 4, 5, 6, 7 ] ] gap> IsSubPerm([1,2,3,4,5,6,7],[1,2,3]); true gap> IsSubPerm([1,2,3,4,7,6,5],[5,4,3,2,1]); false - gap> STOP_TEST( "SubAut.tst", 10000 ); diff --git a/tst/chap10.tst b/tst/chap10.tst index 8dec744..b1d17fd 100644 --- a/tst/chap10.tst +++ b/tst/chap10.tst @@ -3,21 +3,19 @@ #A chap10.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); < deterministic automaton on 3 letters with 4 states > gap> b:=LoopFreeAut(a); < deterministic automaton on 3 letters with 5 states > gap> Display(b); - | 1 2 3 4 5 + | 1 2 3 4 5 -------------------- - a | 2 4 5 3 5 - b | 4 4 1 5 5 - c | 3 1 2 5 5 + a | 2 4 5 3 5 + b | 4 4 1 5 5 + c | 3 1 2 5 5 Initial state: [ 1 ] Accepting state: [ 2 ] gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); @@ -25,12 +23,11 @@ gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); gap> b:=LoopVertexFreeAut(a); < deterministic automaton on 3 letters with 3 states > gap> Display(b); - | 1 2 3 + | 1 2 3 -------------- - a | 2 2 1 - b | 2 2 2 - c | 3 2 2 + a | 2 2 1 + b | 2 2 2 + c | 3 2 2 Initial state: [ 3 ] Accepting state: [ 1 ] - gap> STOP_TEST( "chap10.tst", 10000 ); diff --git a/tst/chap2.tst b/tst/chap2.tst index 24d9958..a5a6dcc 100644 --- a/tst/chap2.tst +++ b/tst/chap2.tst @@ -7,15 +7,15 @@ gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); gap> Parstacks(3,5); -[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], +[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], [ 7, 9 ], [ 8 ], [ ] ] gap> Parstacks(3,5); -[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], +[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], [ 7, 9 ], [ 8 ], [ ] ] gap> Seqstacks(3,4,3,3); -[ [ 2 ], [ 3, 5 ], [ 2, 4 ], [ 3 ], [ 6, 9 ], [ 5, 7 ], [ 6, 8 ], [ 7 ], +[ [ 2 ], [ 3, 5 ], [ 2, 4 ], [ 3 ], [ 6, 9 ], [ 5, 7 ], [ 6, 8 ], [ 7 ], [ 10, 12 ], [ 9, 11 ], [ 10 ], [ 13, 15 ], [ 12, 14 ], [ 13 ], [ ] ] gap> BufferAndStack(4,4); -[ [ 2 .. 5 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 7, 10 ], [ 6, 8 ], [ 7, 9 ], +[ [ 2 .. 5 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 7, 10 ], [ 6, 8 ], [ 7, 9 ], [ 8 ], [ ] ] gap> STOP_TEST( "chap2.tst", 10000 ); diff --git a/tst/chap4.tst b/tst/chap4.tst index 5000ac8..28dfdb2 100644 --- a/tst/chap4.tst +++ b/tst/chap4.tst @@ -11,7 +11,7 @@ gap> a:=Seqstacks(3,3); gap> aut:=GraphToAut(a,1,8); < epsilon automaton on 6 letters with 680 states > gap> a:=Parstacks(5,5); -[ [ 2, 7 ], [ 3, 12 ], [ 2, 4 ], [ 3, 5 ], [ 4, 6 ], [ 5 ], [ 8, 12 ], +[ [ 2, 7 ], [ 3, 12 ], [ 2, 4 ], [ 3, 5 ], [ 4, 6 ], [ 5 ], [ 8, 12 ], [ 7, 9 ], [ 8, 10 ], [ 9, 11 ], [ 10 ], [ ] ] gap> aut:=ConstrainedGraphToAut(a,1,12,5); < epsilon automaton on 12 letters with 5074 states > diff --git a/tst/chap6.tst b/tst/chap6.tst index c59866d..0925eb1 100644 --- a/tst/chap6.tst +++ b/tst/chap6.tst @@ -7,45 +7,45 @@ gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); gap> trans:=Transducer(3,1,[[1,2,1,2],[1,2,2,2],[2,2,1,3],[2,2,2,3],[1,1,3,3],[2,2,3,3]],[2]); -rec( accepting := [ 2 ], initial := 1, states := 3, - transitions := [ [ 1, 2, 1, 2 ], [ 1, 2, 2, 2 ], [ 2, 2, 1, 3 ], +rec( accepting := [ 2 ], initial := 1, states := 3, + transitions := [ [ 1, 2, 1, 2 ], [ 1, 2, 2, 2 ], [ 2, 2, 1, 3 ], [ 2, 2, 2, 3 ], [ 1, 1, 3, 3 ], [ 2, 2, 3, 3 ] ] ) gap> DeletionTrans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 4, 4, 6, 6 ], [ 4, 0, 6, 4 ], [ 5, 4, 4, 4 ], [ 4, 4, 4, 5 ], [ 4, 4, 5, 5 ], [ 5, 5, 6, 6 ], [ 5, 0, 6, 5 ], [ 5, 5, 5, 5 ] ] ) gap> TransposedTransducer(last); -rec( accepting := [ 1 .. 5 ], initial := 6, states := 6, - transitions := [ [ 1, 1, 6, 6 ], [ 0, 1, 6, 1 ], [ 1, 2, 1, 1 ], - [ 1, 1, 1, 2 ], [ 2, 3, 1, 1 ], [ 1, 1, 2, 3 ], [ 3, 4, 1, 1 ], - [ 1, 1, 3, 4 ], [ 4, 5, 1, 1 ], [ 1, 1, 4, 5 ], [ 1, 1, 5, 5 ], - [ 2, 2, 6, 6 ], [ 0, 2, 6, 2 ], [ 2, 3, 2, 2 ], [ 2, 2, 2, 3 ], - [ 3, 4, 2, 2 ], [ 2, 2, 3, 4 ], [ 4, 5, 2, 2 ], [ 2, 2, 4, 5 ], - [ 2, 2, 5, 5 ], [ 3, 3, 6, 6 ], [ 0, 3, 6, 3 ], [ 3, 4, 3, 3 ], - [ 3, 3, 3, 4 ], [ 4, 5, 3, 3 ], [ 3, 3, 4, 5 ], [ 3, 3, 5, 5 ], - [ 4, 4, 6, 6 ], [ 0, 4, 6, 4 ], [ 4, 5, 4, 4 ], [ 4, 4, 4, 5 ], +rec( accepting := [ 1 .. 5 ], initial := 6, states := 6, + transitions := [ [ 1, 1, 6, 6 ], [ 0, 1, 6, 1 ], [ 1, 2, 1, 1 ], + [ 1, 1, 1, 2 ], [ 2, 3, 1, 1 ], [ 1, 1, 2, 3 ], [ 3, 4, 1, 1 ], + [ 1, 1, 3, 4 ], [ 4, 5, 1, 1 ], [ 1, 1, 4, 5 ], [ 1, 1, 5, 5 ], + [ 2, 2, 6, 6 ], [ 0, 2, 6, 2 ], [ 2, 3, 2, 2 ], [ 2, 2, 2, 3 ], + [ 3, 4, 2, 2 ], [ 2, 2, 3, 4 ], [ 4, 5, 2, 2 ], [ 2, 2, 4, 5 ], + [ 2, 2, 5, 5 ], [ 3, 3, 6, 6 ], [ 0, 3, 6, 3 ], [ 3, 4, 3, 3 ], + [ 3, 3, 3, 4 ], [ 4, 5, 3, 3 ], [ 3, 3, 4, 5 ], [ 3, 3, 5, 5 ], + [ 4, 4, 6, 6 ], [ 0, 4, 6, 4 ], [ 4, 5, 4, 4 ], [ 4, 4, 4, 5 ], [ 4, 4, 5, 5 ], [ 5, 5, 6, 6 ], [ 0, 5, 6, 5 ], [ 5, 5, 5, 5 ] ] ) gap> InvolvementTransducer(3); -rec( accepting := [ 1 .. 4 ], initial := 4, states := 4, - transitions := [ [ 1, 1, 1, 2 ], [ 1, 0, 1, 3 ], [ 2, 1, 1, 1 ], - [ 2, 0, 1, 3 ], [ 3, 2, 1, 1 ], [ 3, 0, 1, 1 ], [ 1, 1, 2, 4 ], - [ 1, 0, 2, 1 ], [ 2, 2, 2, 4 ], [ 2, 0, 2, 2 ], [ 3, 2, 2, 2 ], - [ 3, 0, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 0, 3, 3 ], [ 2, 1, 3, 1 ], - [ 2, 0, 3, 3 ], [ 3, 1, 3, 3 ], [ 3, 0, 3, 3 ], [ 1, 1, 4, 4 ], - [ 1, 0, 4, 1 ], [ 2, 2, 4, 4 ], [ 2, 0, 4, 2 ], [ 3, 3, 4, 4 ], +rec( accepting := [ 1 .. 4 ], initial := 4, states := 4, + transitions := [ [ 1, 1, 1, 2 ], [ 1, 0, 1, 3 ], [ 2, 1, 1, 1 ], + [ 2, 0, 1, 3 ], [ 3, 2, 1, 1 ], [ 3, 0, 1, 1 ], [ 1, 1, 2, 4 ], + [ 1, 0, 2, 1 ], [ 2, 2, 2, 4 ], [ 2, 0, 2, 2 ], [ 3, 2, 2, 2 ], + [ 3, 0, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 0, 3, 3 ], [ 2, 1, 3, 1 ], + [ 2, 0, 3, 3 ], [ 3, 1, 3, 3 ], [ 3, 0, 3, 3 ], [ 1, 1, 4, 4 ], + [ 1, 0, 4, 1 ], [ 2, 2, 4, 4 ], [ 2, 0, 4, 2 ], [ 3, 3, 4, 4 ], [ 3, 0, 4, 4 ] ] ) gap> a:=Automaton("det",1,1,[[1]],[1],[1]); < deterministic automaton on 1 letters with 1 states > gap> t:=Transducer(2,1,[[1,2,1,2],[2,1,1,2],[1,1,2,1],[2,2,2,1]],[1]); -rec( accepting := [ 1 ], initial := 1, states := 2, - transitions := [ [ 1, 2, 1, 2 ], [ 2, 1, 1, 2 ], [ 1, 1, 2, 1 ], +rec( accepting := [ 1 ], initial := 1, states := 2, + transitions := [ [ 1, 2, 1, 2 ], [ 2, 1, 1, 2 ], [ 1, 1, 2, 1 ], [ 2, 2, 2, 1 ] ] ) gap> res:=CombineAutTransducer(a,t); < non deterministic automaton on 2 letters with 2 states > @@ -88,12 +88,12 @@ gap> aut:=Automaton("det",3,2,[[2,2,3],[3,3,3]],[1],[3]); gap> ExpandAlphabet(aut,4); < deterministic automaton on 4 letters with 3 states > gap> Display(last); - | 1 2 3 + | 1 2 3 -------------- - a | 2 2 3 - b | 3 3 3 - c | - d | + a | 2 2 3 + b | 3 3 3 + c | + d | Initial state: [ 1 ] Accepting state: [ 3 ] gap> ClassDirectSum(BoundedClassAutomaton(4),BoundedClassAutomaton(3)); @@ -103,28 +103,28 @@ gap> ClassDirectSum(BoundedClassAutomaton(3),BoundedClassAutomaton(6)); gap> a:=BoundedClassAutomaton(5); < deterministic automaton on 5 letters with 5 states > gap> Spectrum(a); -[ 1, 2, 6, 24, 120, 600, 3000, 15000, 75000, 375000, 1875000, 9375000, +[ 1, 2, 6, 24, 120, 600, 3000, 15000, 75000, 375000, 1875000, 9375000, 46875000, 234375000, 1171875000 ] gap> Spectrum(a,10); [ 1, 2, 6, 24, 120, 600, 3000, 15000, 75000, 375000 ] gap> NumberAcceptedWords(a,10); 375000 gap> AutStateTransitionMatrix(a); -[ [ 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 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], - [ 1, 1, 2, 2 ], [ 1, 2, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 2, 3, 2 ], - [ 1, 1, 1, 3 ], [ 1, 2, 1, 3 ], [ 1, 1, 2, 3 ], [ 1, 2, 2, 3 ], - [ 1, 1, 3, 3 ], [ 1, 2, 3, 3 ], [ 1, 1, 1, 4 ], [ 1, 2, 1, 4 ], +[ [ 1, 1, 1, 1 ], [ 1, 2, 1, 1 ], [ 1, 1, 2, 1 ], [ 1, 2, 2, 1 ], + [ 1, 1, 3, 1 ], [ 1, 2, 3, 1 ], [ 1, 1, 1, 2 ], [ 1, 2, 1, 2 ], + [ 1, 1, 2, 2 ], [ 1, 2, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 2, 3, 2 ], + [ 1, 1, 1, 3 ], [ 1, 2, 1, 3 ], [ 1, 1, 2, 3 ], [ 1, 2, 2, 3 ], + [ 1, 1, 3, 3 ], [ 1, 2, 3, 3 ], [ 1, 1, 1, 4 ], [ 1, 2, 1, 4 ], [ 1, 1, 2, 4 ], [ 1, 2, 2, 4 ], [ 1, 1, 3, 4 ], [ 1, 2, 3, 4 ] ] gap> a:=BoundedClassAutomaton(5); < deterministic automaton on 5 letters with 5 states > diff --git a/tst/chap8.tst b/tst/chap8.tst index 400e711..e7686c1 100644 --- a/tst/chap8.tst +++ b/tst/chap8.tst @@ -3,16 +3,13 @@ #A chap8.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - gap> IsInterval([3,6,9,2]); false gap> IsInterval([2,6,5,3,4]); true - gap> IsSimplePerm([2,3,4,5,1,1,1,1]); true gap> IsSimplePerm([2,4,6,8,1,3,5,7]); @@ -21,16 +18,17 @@ gap> IsSimplePerm([3,2,8,6,7,1,5,4]); false gap> IsSimplePerm([1,1,1,1]); false - gap> OnePointDelete([5,2,3,1,2,1]); [ [ 2, 3, 1, 2, 1 ], [ 4, 1, 2, 2, 1 ] ] gap> OnePointDelete([5,2,4,1,6,3]); [ [ 2, 3, 1, 2, 1 ], [ 4, 1, 2, 2, 1 ] ] gap> OnePointDelete([2,4,6,8,1,3,5,7]); -[ 2, 4, 6, 8, 1, 3, 5, 7 - ]is an exceptional permutation and needs 2 point deletion.fail +[ 2, 4, 6, 8, 1, 3, 5, 7 + ] is an exceptional permutation and needs 2 point deletion. +fail gap> OnePointDelete([1,2,4,6,8,3,5,7]); -[ 1, 2, 4, 6, 8, 3, 5, 7 ]is not simple.fail +[ 1, 2, 4, 6, 8, 3, 5, 7 ] is not simple. +fail gap> TwoPointDelete([2,4,6,8,1,3,5,7]); [ [ 2, 3, 4, 1, 1, 1 ] ] gap> TwoPointDelete([2,3,4,5,1,1,1,1]); @@ -53,8 +51,8 @@ gap> PointDeletion([2,4,6,8,1,3,5,7]); gap> PointDeletion([2,3,4,5,1,1,1,1]); [ [ 2, 3, 4, 1, 1, 1 ] ] gap> PointDeletion([1,2,3,4,5]); -[ 1, 2, 3, 4, 5 ]is not simple.fail - +[ 1, 2, 3, 4, 5 ] is not simple. +fail gap> Inflation([[3,2,1],[1],[1,2],[1,2,3]]); [ 6, 4, 5, 1, 2, 3 ] gap> Inflation([[1,2],[1],[4,2,1,3]]); @@ -67,14 +65,12 @@ gap> BlockDecomposition([1,2,3,4,5]); [ [ 1, 2 ], [ 1, 2, 3, 4 ], [ 1 ] ] gap> BlockDecomposition([5,4,3,2,1]); [ [ 2, 1 ], [ 4, 3, 2, 1 ], [ 1 ] ] - gap> IsPlusDecomposable([3,3,2,3,2,2,1,1]); true gap> IsPlusDecomposable([3,2,8,6,7,1,5,4]); false gap> IsPlusDecomposable([3,4,2,6,5,7,1,8]); true - gap> IsMinusDecomposable([3,3,3,3,3,3,2,1]); true gap> IsMinusDecomposable([3,4,5,6,7,8,2,1]); @@ -83,7 +79,6 @@ gap> IsMinusDecomposable([3,2,8,6,7,1,5,4]); false gap> IsMinusDecomposable([1,2,6,5,4,3]); false - gap> PermDirectSum([2,4,1,3],[2,5,4,1,3]); [ 2, 4, 1, 3, 6, 9, 8, 5, 7 ] gap> PermDirectSum([2,3,1,1],[2,4,3,1,1]); @@ -92,6 +87,4 @@ gap> PermSkewSum([2,4,1,3],[2,5,4,1,3]); [ 7, 9, 6, 8, 2, 5, 4, 1, 3 ] gap> PermSkewSum([2,3,1,1],[2,4,3,1,1]); [ 7, 8, 6, 6, 2, 4, 3, 1, 1 ] - - gap> STOP_TEST( "chap8.tst", 10000 ); diff --git a/tst/chap9.tst b/tst/chap9.tst index b4f2677..8a63cf0 100644 --- a/tst/chap9.tst +++ b/tst/chap9.tst @@ -3,11 +3,9 @@ #A chap9.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - gap> a:=InversionAut(1); < deterministic automaton on 2 letters with 4 states > gap> Spectrum(a); @@ -17,14 +15,13 @@ gap> b:=InversionAut(5); gap> Spectrum(b); [ 0, 0, 0, 3, 22, 71, 169, 343, 628, 1068, 1717, 2640, 3914, 5629, 7889 ] gap> InversionAutOfClass(BoundedClassAutomaton(5),4); -< deterministic automaton on 5 letters with 20 states > +< epsilon automaton on 6 letters with 20 states > gap> InversionAutOfClass(BoundedClassAutomaton(5),6); -< deterministic automaton on 7 letters with 42 states > +< epsilon automaton on 8 letters with 30 states > gap> InversionAutOfClass(BoundedClassAutomaton(5),10); -< deterministic automaton on 11 letters with 86 states > +< epsilon automaton on 12 letters with 50 states > gap> InversionAutOfClass(BoundedClassAutomaton(7),4); -< deterministic automaton on 7 letters with 27 states > - +< epsilon automaton on 8 letters with 20 states > gap> PlusDecomposableAut(BoundedClassAutomaton(4)); < deterministic automaton on 4 letters with 7 states > gap> PlusDecomposableAut(BoundedClassAutomaton(10)); @@ -41,7 +38,6 @@ gap> MinusIndecomposableAut(BoundedClassAutomaton(4)); < deterministic automaton on 4 letters with 9 states > gap> MinusIndecomposableAut(BoundedClassAutomaton(8)); < deterministic automaton on 8 letters with 31 states > - gap> NonSimpleAut(5); < epsilon automaton on 6 letters with 187 states > gap> NonSimpleAut(7); @@ -56,7 +52,6 @@ gap> SimplePermAut(5); < deterministic automaton on 5 letters with 77 states > gap> SimplePermAut(6); < deterministic automaton on 6 letters with 266 states > - gap> IsExceptionalPerm([1,2,5,3,4]); false gap> IsExceptionalPerm([1,1,3,1,1]); @@ -85,6 +80,4 @@ gap> ExceptionalBoundedAutomaton(15); < deterministic automaton on 15 letters with 104 states > gap> Spectrum(last); [ 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0 ] - - gap> STOP_TEST( "chap9.tst", 10000 ); diff --git a/tst/experiments.tst b/tst/experiments.tst index 3646eee..4cf62eb 100644 --- a/tst/experiments.tst +++ b/tst/experiments.tst @@ -6,5 +6,4 @@ gap> START_TEST("PatternClass"); gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - gap> STOP_TEST( "chap5.tst", 10000 ); diff --git a/tst/testall.tst b/tst/testall.tst index 225dce7..0a27639 100644 --- a/tst/testall.tst +++ b/tst/testall.tst @@ -3,14 +3,11 @@ #A testall.tst PatternClass package Ruth Hoffmann ## gap> START_TEST("PatternClass"); - gap> LoadPackage("patternclass",false); true gap> SetAssertionLevel(1); - - gap> Parstacks(3,5); -[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], +[ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], [ 7, 9 ], [ 8 ], [ ] ] gap> Parstacks(3,5); [ [ 2, 5 ], [ 3, 10 ], [ 2, 4 ], [ 3 ], [ 6, 10 ], [ 5, 7 ], [ 6, 8 ], @@ -21,18 +18,12 @@ gap> Seqstacks(3,4,3,3); gap> BufferAndStack(4,4); [ [ 2 .. 5 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 7, 10 ], [ 6, 8 ], [ 7, 9 ], [ 8 ], [ ] ] - - - gap> RankEncoding([3, 2, 5, 1, 6, 7, 4, 8, 9]); [ 3, 2, 3, 1, 2, 2, 1, 1, 1 ] gap> RankDecoding(last); [ 3, 2, 5, 1, 6, 7, 4, 8, 9 ] gap> SequencesToRatExp([[1,1,1,1,1],[2,1,2,2,1],[3,2,1,2,1],[4,2,3,2,1]]); aaaaaUbabbaUcbabaUdbcba - - - gap> a:=Seqstacks(3,3); [ [ 2 ], [ 3, 5 ], [ 2, 4 ], [ 3 ], [ 6, 8 ], [ 5, 7 ], [ 6 ], [ ] ] gap> aut:=GraphToAut(a,1,8); @@ -42,9 +33,6 @@ gap> a:=Parstacks(5,5); [ 7, 9 ], [ 8, 10 ], [ 9, 11 ], [ 10 ], [ ] ] gap> aut:=ConstrainedGraphToAut(a,1,12,5); < epsilon automaton on 12 letters with 5074 states > - - - gap> x:=Automaton("det",4,2,[[3,4,2,4],[2,2,2,4]],[1],[2]); < deterministic automaton on 2 letters with 4 states > gap> IsStarClosed(x); @@ -77,53 +65,49 @@ gap> x:=Automaton("det",2,2,[[1,2],[1,2]],[1],[1]); < deterministic automaton on 2 letters with 2 states > gap> IsPossibleGraphAut(x); false - - - gap> trans:=Transducer(3,1,[[1,2,1,2],[1,2,2,2],[2,2,1,3],[2,2,2,3],[1,1,3,3],[2,2,3,3]],[2]); -rec( accepting := [ 2 ], initial := 1, states := 3, - transitions := [ [ 1, 2, 1, 2 ], [ 1, 2, 2, 2 ], [ 2, 2, 1, 3 ], +rec( accepting := [ 2 ], initial := 1, states := 3, + transitions := [ [ 1, 2, 1, 2 ], [ 1, 2, 2, 2 ], [ 2, 2, 1, 3 ], [ 2, 2, 2, 3 ], [ 1, 1, 3, 3 ], [ 2, 2, 3, 3 ] ] ) gap> DeletionTransducer(5); -rec( accepting := [ 1 .. 5 ], initial := 6, states := 6, - transitions := [ [ 1, 1, 6, 6 ], [ 1, 0, 6, 1 ], [ 2, 1, 1, 1 ], - [ 1, 1, 1, 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6, 5 ], [ 5, 5, 5, 5 ] ] ) gap> TransposedTransducer(last); -rec( accepting := [ 1 .. 5 ], initial := 6, states := 6, - transitions := [ [ 1, 1, 6, 6 ], [ 0, 1, 6, 1 ], [ 1, 2, 1, 1 ], - [ 1, 1, 1, 2 ], [ 2, 3, 1, 1 ], [ 1, 1, 2, 3 ], [ 3, 4, 1, 1 ], - [ 1, 1, 3, 4 ], [ 4, 5, 1, 1 ], [ 1, 1, 4, 5 ], [ 1, 1, 5, 5 ], - [ 2, 2, 6, 6 ], [ 0, 2, 6, 2 ], [ 2, 3, 2, 2 ], [ 2, 2, 2, 3 ], - [ 3, 4, 2, 2 ], [ 2, 2, 3, 4 ], [ 4, 5, 2, 2 ], [ 2, 2, 4, 5 ], - [ 2, 2, 5, 5 ], [ 3, 3, 6, 6 ], [ 0, 3, 6, 3 ], [ 3, 4, 3, 3 ], - [ 3, 3, 3, 4 ], [ 4, 5, 3, 3 ], [ 3, 3, 4, 5 ], [ 3, 3, 5, 5 ], - [ 4, 4, 6, 6 ], [ 0, 4, 6, 4 ], [ 4, 5, 4, 4 ], [ 4, 4, 4, 5 ], +rec( accepting := [ 1 .. 5 ], initial := 6, states := 6, + transitions := [ [ 1, 1, 6, 6 ], [ 0, 1, 6, 1 ], [ 1, 2, 1, 1 ], + [ 1, 1, 1, 2 ], [ 2, 3, 1, 1 ], [ 1, 1, 2, 3 ], [ 3, 4, 1, 1 ], + [ 1, 1, 3, 4 ], [ 4, 5, 1, 1 ], [ 1, 1, 4, 5 ], [ 1, 1, 5, 5 ], + [ 2, 2, 6, 6 ], [ 0, 2, 6, 2 ], [ 2, 3, 2, 2 ], [ 2, 2, 2, 3 ], + [ 3, 4, 2, 2 ], [ 2, 2, 3, 4 ], [ 4, 5, 2, 2 ], [ 2, 2, 4, 5 ], + [ 2, 2, 5, 5 ], [ 3, 3, 6, 6 ], [ 0, 3, 6, 3 ], [ 3, 4, 3, 3 ], + [ 3, 3, 3, 4 ], [ 4, 5, 3, 3 ], [ 3, 3, 4, 5 ], [ 3, 3, 5, 5 ], + [ 4, 4, 6, 6 ], [ 0, 4, 6, 4 ], [ 4, 5, 4, 4 ], [ 4, 4, 4, 5 ], [ 4, 4, 5, 5 ], [ 5, 5, 6, 6 ], [ 0, 5, 6, 5 ], [ 5, 5, 5, 5 ] ] ) gap> InvolvementTransducer(3); -rec( accepting := [ 1 .. 4 ], initial := 4, states := 4, - transitions := [ [ 1, 1, 1, 2 ], [ 1, 0, 1, 3 ], [ 2, 1, 1, 1 ], - [ 2, 0, 1, 3 ], [ 3, 2, 1, 1 ], [ 3, 0, 1, 1 ], [ 1, 1, 2, 4 ], - [ 1, 0, 2, 1 ], [ 2, 2, 2, 4 ], [ 2, 0, 2, 2 ], [ 3, 2, 2, 2 ], - [ 3, 0, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 0, 3, 3 ], [ 2, 1, 3, 1 ], - [ 2, 0, 3, 3 ], [ 3, 1, 3, 3 ], [ 3, 0, 3, 3 ], [ 1, 1, 4, 4 ], - [ 1, 0, 4, 1 ], [ 2, 2, 4, 4 ], [ 2, 0, 4, 2 ], [ 3, 3, 4, 4 ], +rec( accepting := [ 1 .. 4 ], initial := 4, states := 4, + transitions := [ [ 1, 1, 1, 2 ], [ 1, 0, 1, 3 ], [ 2, 1, 1, 1 ], + [ 2, 0, 1, 3 ], [ 3, 2, 1, 1 ], [ 3, 0, 1, 1 ], [ 1, 1, 2, 4 ], + [ 1, 0, 2, 1 ], [ 2, 2, 2, 4 ], [ 2, 0, 2, 2 ], [ 3, 2, 2, 2 ], + [ 3, 0, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 0, 3, 3 ], [ 2, 1, 3, 1 ], + [ 2, 0, 3, 3 ], [ 3, 1, 3, 3 ], [ 3, 0, 3, 3 ], [ 1, 1, 4, 4 ], + [ 1, 0, 4, 1 ], [ 2, 2, 4, 4 ], [ 2, 0, 4, 2 ], [ 3, 3, 4, 4 ], [ 3, 0, 4, 4 ] ] ) gap> a:=Automaton("det",1,1,[[1]],[1],[1]); < deterministic automaton on 1 letters with 1 states > gap> t:=Transducer(2,1,[[1,2,1,2],[2,1,1,2],[1,1,2,1],[2,2,2,1]],[1]); -rec( accepting := [ 1 ], initial := 1, states := 2, - transitions := [ [ 1, 2, 1, 2 ], [ 2, 1, 1, 2 ], [ 1, 1, 2, 1 ], +rec( accepting := [ 1 ], initial := 1, states := 2, + transitions := [ [ 1, 2, 1, 2 ], [ 2, 1, 1, 2 ], [ 1, 1, 2, 1 ], [ 2, 2, 2, 1 ] ] ) gap> res:=CombineAutTransducer(a,t); < non deterministic automaton on 2 letters with 2 states > - gap> x:=Parstacks(2,2); [ [ 2, 4 ], [ 3, 6 ], [ 2 ], [ 5, 6 ], [ 4 ], [ ] ] gap> xa:=GraphToAut(x,1,6); @@ -163,66 +147,56 @@ gap> aut:=Automaton("det",3,2,[[2,2,3],[3,3,3]],[1],[3]); gap> ExpandAlphabet(aut,4); < deterministic automaton on 4 letters with 3 states > gap> Display(last); - | 1 2 3 + | 1 2 3 -------------- - a | 2 2 3 - b | 3 3 3 - c | - d | + a | 2 2 3 + b | 3 3 3 + c | + d | Initial state: [ 1 ] Accepting state: [ 3 ] - gap> ClassDirectSum(BoundedClassAutomaton(4),BoundedClassAutomaton(3)); < deterministic automaton on 4 letters with 4 states > gap> ClassDirectSum(BoundedClassAutomaton(3),BoundedClassAutomaton(6)); < deterministic automaton on 6 letters with 6 states > - gap> a:=BoundedClassAutomaton(5); < deterministic automaton on 5 letters with 5 states > gap> Spectrum(a); -[ 1, 2, 6, 24, 120, 600, 3000, 15000, 75000, 375000, 1875000, 9375000, +[ 1, 2, 6, 24, 120, 600, 3000, 15000, 75000, 375000, 1875000, 9375000, 46875000, 234375000, 1171875000 ] gap> NumberAcceptedWords(a,10); 375000 gap> AutStateTransitionMatrix(a); -[ [ 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1 ], [ 0, 2, 1, 1, 1 ], [ 0, 0, 3, 1, 1 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 1, 3, 2 ], [ 1, 2, 3, 2 ], - [ 1, 1, 1, 3 ], [ 1, 2, 1, 3 ], [ 1, 1, 2, 3 ], [ 1, 2, 2, 3 ], - [ 1, 1, 3, 3 ], [ 1, 2, 3, 3 ], [ 1, 1, 1, 4 ], [ 1, 2, 1, 4 ], +[ [ 1, 1, 1, 1 ], [ 1, 2, 1, 1 ], [ 1, 1, 2, 1 ], [ 1, 2, 2, 1 ], + [ 1, 1, 3, 1 ], [ 1, 2, 3, 1 ], [ 1, 1, 1, 2 ], [ 1, 2, 1, 2 ], + [ 1, 1, 2, 2 ], [ 1, 2, 2, 2 ], [ 1, 1, 3, 2 ], [ 1, 2, 3, 2 ], + [ 1, 1, 1, 3 ], [ 1, 2, 1, 3 ], [ 1, 1, 2, 3 ], [ 1, 2, 2, 3 ], + [ 1, 1, 3, 3 ], [ 1, 2, 3, 3 ], [ 1, 1, 1, 4 ], [ 1, 2, 1, 4 ], [ 1, 1, 2, 4 ], [ 1, 2, 2, 4 ], [ 1, 1, 3, 4 ], [ 1, 2, 3, 4 ] ] - - - gap> PermComplement([3,2,8,6,7,1,5,4]); [ 6, 7, 1, 3, 2, 8, 4, 5 ] gap> PermComplement([1]); [ 1 ] gap> PermComplement([1,2]); [ 2, 1 ] - gap> IsRankEncoding([3,2,6,4,4,1,2,1]); true gap> IsRankEncoding([3,2,6,4,5,1,2,1]); false - - - gap> IsInterval([3,6,9,2]); false gap> IsInterval([2,6,5,3,4]); true - gap> IsSimplePerm([2,3,4,5,1,1,1,1]); true gap> IsSimplePerm([2,4,6,8,1,3,5,7]); @@ -231,7 +205,6 @@ gap> IsSimplePerm([3,2,8,6,7,1,5,4]); false gap> IsSimplePerm([1,1,1,1]); false - gap> OnePointDelete([5,2,3,1,2,1]); [ [ 2, 3, 1, 2, 1 ], [ 4, 1, 2, 2, 1 ] ] gap> OnePointDelete([5,2,4,1,6,3]); @@ -248,7 +221,6 @@ gap> PointDeletion([2,4,6,8,1,3,5,7]); [ [ 2, 3, 4, 1, 1, 1 ] ] gap> PointDeletion([2,3,4,5,1,1,1,1]); [ [ 2, 3, 4, 1, 1, 1 ] ] - gap> Inflation([[3,2,1],[1],[1,2],[1,2,3]]); [ 6, 4, 5, 1, 2, 3 ] gap> Inflation([[1,2],[1],[4,2,1,3]]); @@ -261,21 +233,18 @@ gap> BlockDecomposition([1,2,3,4,5]); [ [ 1, 2 ], [ 1, 2, 3, 4 ], [ 1 ] ] gap> BlockDecomposition([5,4,3,2,1]); [ [ 2, 1 ], [ 4, 3, 2, 1 ], [ 1 ] ] - gap> IsPlusDecomposable([3,3,2,3,2,2,1,1]); true gap> IsPlusDecomposable([3,2,8,6,7,1,5,4]); false gap> IsPlusDecomposable([3,4,2,6,5,7,1,8]); true - gap> IsMinusDecomposable([3,3,3,3,3,3,2,1]); true gap> IsMinusDecomposable([3,4,5,6,7,8,2,1]); true gap> IsMinusDecomposable([3,2,8,6,7,1,5,4]); false - gap> PermDirectSum([2,4,1,3],[2,5,4,1,3]); [ 2, 4, 1, 3, 6, 9, 8, 5, 7 ] gap> PermDirectSum([2,3,1,1],[2,4,3,1,1]); @@ -284,9 +253,6 @@ gap> PermSkewSum([2,4,1,3],[2,5,4,1,3]); [ 7, 9, 6, 8, 2, 5, 4, 1, 3 ] gap> PermSkewSum([2,3,1,1],[2,4,3,1,1]); [ 7, 8, 6, 6, 2, 4, 3, 1, 1 ] - - - gap> a:=InversionAut(1); < deterministic automaton on 2 letters with 4 states > gap> Spectrum(a); @@ -296,12 +262,11 @@ gap> b:=InversionAut(5); gap> Spectrum(b); [ 0, 0, 0, 3, 22, 71, 169, 343, 628, 1068, 1717, 2640, 3914, 5629, 7889 ] gap> InversionAutOfClass(BoundedClassAutomaton(5),4); -< deterministic automaton on 5 letters with 20 states > +< epsilon automaton on 6 letters with 20 states > gap> InversionAutOfClass(BoundedClassAutomaton(5),6); -< deterministic automaton on 7 letters with 42 states > +< epsilon automaton on 8 letters with 30 states > gap> InversionAutOfClass(BoundedClassAutomaton(5),10); -< deterministic automaton on 11 letters with 86 states > - +< epsilon automaton on 12 letters with 50 states > gap> PlusDecomposableAut(BoundedClassAutomaton(4)); < deterministic automaton on 4 letters with 7 states > gap> PlusDecomposableAut(BoundedClassAutomaton(10)); @@ -318,7 +283,6 @@ gap> MinusIndecomposableAut(BoundedClassAutomaton(4)); < deterministic automaton on 4 letters with 9 states > gap> MinusIndecomposableAut(BoundedClassAutomaton(8)); < deterministic automaton on 8 letters with 31 states > - gap> NonSimpleAut(5); < epsilon automaton on 6 letters with 187 states > gap> NonSimpleAut(7); @@ -333,7 +297,6 @@ gap> SimplePermAut(5); < deterministic automaton on 5 letters with 77 states > gap> SimplePermAut(6); < deterministic automaton on 6 letters with 266 states > - gap> IsExceptionalPerm([1,2,5,3,4]); false gap> IsExceptionalPerm([1,1,3,1,1]); @@ -362,19 +325,16 @@ gap> ExceptionalBoundedAutomaton(15); < deterministic automaton on 15 letters with 104 states > gap> Spectrum(last); [ 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0 ] - - - gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); < deterministic automaton on 3 letters with 4 states > gap> b:=LoopFreeAut(a); < deterministic automaton on 3 letters with 5 states > gap> Display(b); - | 1 2 3 4 5 + | 1 2 3 4 5 -------------------- - a | 2 4 5 3 5 - b | 4 4 1 5 5 - c | 3 1 2 5 5 + a | 2 4 5 3 5 + b | 4 4 1 5 5 + c | 3 1 2 5 5 Initial state: [ 1 ] Accepting state: [ 2 ] gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); @@ -382,14 +342,11 @@ gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]); gap> b:=LoopVertexFreeAut(a); < deterministic automaton on 3 letters with 3 states > gap> Display(b); - | 1 2 3 + | 1 2 3 -------------- - a | 2 2 1 - b | 2 2 2 - c | 3 2 2 + a | 2 2 1 + b | 2 2 2 + c | 3 2 2 Initial state: [ 3 ] Accepting state: [ 1 ] - - - -gap> STOP_TEST( "testall.tst", 10000 ); \ No newline at end of file +gap> STOP_TEST( "testall.tst", 10000 ); From d950f731f103190cc29a526bc3af0964f8c2a0dc Mon Sep 17 00:00:00 2001 From: Ruth Hoffmann Date: Fri, 30 Aug 2024 13:22:36 +0100 Subject: [PATCH 2/3] removed the patch notice --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 3f9e35a..f37911c 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,6 @@ The 'PatternClass' GAP 4 package ================================ -!!!!!!!!!!!!!! -! Patch info ! -!!!!!!!!!!!!!! -We had to patch the IntersectionAutomaton, UnionAutomata and ProductLanguage -from the Automata pkg (version 1.13) to improve performance testing. The -patched functions are located in lib/automata.* . - Introduction ------------ From de4b8faf940fa7e9258952b6fb354931a57b5dad Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 30 Aug 2024 13:36:40 +0100 Subject: [PATCH 3/3] CI: install latest version of automata --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 413c14b..308b875 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -35,6 +35,7 @@ jobs: - uses: actions/checkout@v4 - uses: gap-actions/setup-gap@v2 with: + GAP_PKGS_TO_CLONE: "automata" GAPBRANCH: ${{ matrix.gap-branch }} - uses: gap-actions/build-pkg@v1 - uses: gap-actions/run-pkg-tests@v2