Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/patternclass/tst/   (GAP Algebra Version 4.15.1©)  Datei vom 30.7.2024 mit Größe 13 kB image not shown  

Quelle  testall.tst   Sprache: unbekannt

 
Spracherkennung für: .tst vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

#############################################################################
##
#A  testall.tst            PatternClass package                 Ruth Hoffmann
##
gap> START_TEST("PatternClass");
gap> LoadPackage("patternclass",false);
true
gap> SetAssertionLevel(1);
gap> Parstacks(3,5);
[ [ 25 ], [ 310 ], [ 24 ], [ 3 ], [ 610 ], [ 57 ], [ 68 ], 
  [ 79 ], [ 8 ], [  ] ]
gap> Parstacks(3,5);
[ [ 25 ], [ 310 ], [ 24 ], [ 3 ], [ 610 ], [ 57 ], [ 68 ], 
  [ 79 ], [ 8 ], [  ] ]
gap> Seqstacks(3,4,3,3);
[ [ 2 ], [ 35 ], [ 24 ], [ 3 ], [ 69 ], [ 57 ], [ 68 ], [ 7 ], 
  [ 1012 ], [ 911 ], [ 10 ], [ 1315 ], [ 1214 ], [ 13 ], [  ] ]
gap> BufferAndStack(4,4);
[ [ 2 .. 5 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 710 ], [ 68 ], [ 79 ], 
  [ 8 ], [  ] ]
gap> RankEncoding([325167489]);
323122111 ]
gap> RankDecoding(last);
325167489 ]
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 ], [ 35 ], [ 24 ], [ 3 ], [ 68 ], [ 57 ], [ 6 ], [  ] ]
gap> aut:=GraphToAut(a,1,8);
< epsilon automaton on 6 letters with 680 states >
gap> a:=Parstacks(5,5);
[ [ 27 ], [ 312 ], [ 24 ], [ 35 ], [ 46 ], [ 5 ], [ 812 ], 
  [ 79 ], [ 810 ], [ 911 ], [ 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);
false
gap> x:=Automaton("det",3,2,[[3,2,1],[2,3,1]],[1],[1]);
< deterministic automaton on 2 letters with 3 states >
gap> IsStarClosed(x);
true
gap> x:=Automaton("det",3,2,[[1,2,3],[2,2,3]],[1],[2]);
< deterministic automaton on 2 letters with 3 states >
gap> Is2StarReplaceable(x);
true
gap> x:=Automaton("det",4,2,[[4,1,1,2],[1,4,2,2]],[1],[4]);
< deterministic automaton on 2 letters with 4 states >
gap> Is2StarReplaceable(x);
false
gap> x:=Automaton("det",4,2,[[1,3,1,4],[2,2,4,4]],[1],[2]);
< deterministic automaton on 2 letters with 4 states >
gap> IsStratified(x);
true
gap> x:=Automaton("det",4,2,[[1,3,2,4],[2,4,1,4]],[1],[2]);
< deterministic automaton on 2 letters with 4 states >
gap> IsStratified(x);
false
gap> x:=Automaton("det",2,2,[[1,2],[2,2]],[1],[1]);
< deterministic automaton on 2 letters with 2 states >
gap> IsPossibleGraphAut(x);
true
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 := [ [ 1212 ], [ 1222 ], [ 2213 ], 
      [ 2223 ], [ 1133 ], [ 2233 ] ] )
gap> DeletionTransducer(5);
rec( accepting := [ 1 .. 5 ], initial := 6, states := 6
  transitions := [ [ 1166 ], [ 1061 ], [ 2111 ], 
      [ 1112 ], [ 3211 ], [ 1123 ], [ 4311 ], 
      [ 1134 ], [ 5411 ], [ 1145 ], [ 1155 ], 
      [ 2266 ], [ 2062 ], [ 3222 ], [ 2223 ], 
      [ 4322 ], [ 2234 ], [ 5422 ], [ 2245 ], 
      [ 2255 ], [ 3366 ], [ 3063 ], [ 4333 ], 
      [ 3334 ], [ 5433 ], [ 3345 ], [ 3355 ], 
      [ 4466 ], [ 4064 ], [ 5444 ], [ 4445 ], 
      [ 4455 ], [ 5566 ], [ 5065 ], [ 5555 ] ] )
gap> TransposedTransducer(last);
rec( accepting := [ 1 .. 5 ], initial := 6, states := 6
  transitions := [ [ 1166 ], [ 0161 ], [ 1211 ], 
      [ 1112 ], [ 2311 ], [ 1123 ], [ 3411 ], 
      [ 1134 ], [ 4511 ], [ 1145 ], [ 1155 ], 
      [ 2266 ], [ 0262 ], [ 2322 ], [ 2223 ], 
      [ 3422 ], [ 2234 ], [ 4522 ], [ 2245 ], 
      [ 2255 ], [ 3366 ], [ 0363 ], [ 3433 ], 
      [ 3334 ], [ 4533 ], [ 3345 ], [ 3355 ], 
      [ 4466 ], [ 0464 ], [ 4544 ], [ 4445 ], 
      [ 4455 ], [ 5566 ], [ 0565 ], [ 5555 ] ] )
gap> InvolvementTransducer(3);
rec( accepting := [ 1 .. 4 ], initial := 4, states := 4
  transitions := [ [ 1112 ], [ 1013 ], [ 2111 ], 
      [ 2013 ], [ 3211 ], [ 3011 ], [ 1124 ], 
      [ 1021 ], [ 2224 ], [ 2022 ], [ 3222 ], 
      [ 3022 ], [ 1132 ], [ 1033 ], [ 2131 ], 
      [ 2033 ], [ 3133 ], [ 3033 ], [ 1144 ], 
      [ 1041 ], [ 2244 ], [ 2042 ], [ 3344 ], 
      [ 3044 ] ] )
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 := [ [ 1212 ], [ 2112 ], [ 1121 ], 
      [ 2221 ] ] )
gap> res:=CombineAutTransducer(a,t);
< non deterministic automaton on 2 letters with 2 states >
gap> x:=Parstacks(2,2);
[ [ 24 ], [ 36 ], [ 2 ], [ 56 ], [ 4 ], [  ] ]
gap> xa:=GraphToAut(x,1,6);
< epsilon automaton on 5 letters with 66 states >
gap> ma:=MinimalAutomaton(xa);
< deterministic automaton on 4 letters with 9 states >
gap> ba:=BasisAutomaton(ma);
< non deterministic automaton on 4 letters with 9 states >
gap> ma:=MinimalAutomaton(last);
< deterministic automaton on 4 letters with 9 states >
gap> ca:=ClassAutomaton(ma);
< non deterministic automaton on 4 letters with 12 states >
gap> BoundedClassAutomaton(6);
< deterministic automaton on 6 letters with 6 states >
gap> BoundedClassAutomaton(12);
< deterministic automaton on 12 letters with 12 states >
gap> a:=BoundedClassAutomaton(4);
< deterministic automaton on 4 letters with 4 states >
gap> ba:=BasisAutomaton(a);
< non deterministic automaton on 4 letters with 3 states >
gap> ma:=MinimalAutomaton(ba);
< deterministic automaton on 4 letters with 3 states >
gap> ca:=ClassAutomaton(ma);
< non deterministic automaton on 4 letters with 4 states >
gap> MinimalAutomaton(ca);
< deterministic automaton on 4 letters with 4 states >
gap> ClassAutFromBaseEncoding([[2,1]],4);
< deterministic automaton on 4 letters with 2 states >
gap> ClassAutFromBase([[2,1]],4);
< deterministic automaton on 4 letters with 2 states >
gap> ClassAutFromBaseEncoding([[4,1,1,1]],4);
< deterministic automaton on 4 letters with 7 states >
gap> ClassAutFromBase([[4,1,2,3]],4);
< deterministic automaton on 4 letters with 7 states >
gap> aut:=Automaton("det",3,2,[[2,2,3],[3,3,3]],[1],[3]);
< deterministic automaton on 2 letters with 3 states >
gap> ExpandAlphabet(aut,4);
< deterministic automaton on 4 letters with 3 states >
gap> Display(last);
   |  1  2  3  
--------------
 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);
126241206003000150007500037500018750009375000
  468750002343750001171875000 ]
gap> NumberAcceptedWords(a,10);
375000
gap> AutStateTransitionMatrix(a);
[ [ 11111 ], [ 11111 ], [ 02111 ], [ 00311 ], 
  [ 00041 ] ]
gap> AcceptedWords(a,4);
[ [ 1111 ], [ 1121 ], [ 1211 ], [ 1221 ], 
  [ 1311 ], [ 1321 ], [ 2111 ], [ 2121 ], 
  [ 2211 ], [ 2221 ], [ 2311 ], [ 2321 ], 
  [ 3111 ], [ 3121 ], [ 3211 ], [ 3221 ], 
  [ 3311 ], [ 3321 ], [ 4111 ], [ 4121 ], 
  [ 4211 ], [ 4221 ], [ 4311 ], [ 4321 ] ]
gap> AcceptedWordsR(a,4);
[ [ 1111 ], [ 1211 ], [ 1121 ], [ 1221 ], 
  [ 1131 ], [ 1231 ], [ 1112 ], [ 1212 ], 
  [ 1122 ], [ 1222 ], [ 1132 ], [ 1232 ], 
  [ 1113 ], [ 1213 ], [ 1123 ], [ 1223 ], 
  [ 1133 ], [ 1233 ], [ 1114 ], [ 1214 ], 
  [ 1124 ], [ 1224 ], [ 1134 ], [ 1234 ] ]
gap> PermComplement([3,2,8,6,7,1,5,4]);
67132845 ]
gap> PermComplement([1]);
1 ]
gap> PermComplement([1,2]);
21 ]
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]);
true
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]);
[ [ 23121 ], [ 41221 ] ]
gap> OnePointDelete([5,2,4,1,6,3]);
[ [ 23121 ], [ 41221 ] ]
gap> TwoPointDelete([2,4,6,8,1,3,5,7]);
[ [ 234111 ] ]
gap> TwoPointDelete([2,3,4,5,1,1,1,1]);
[ [ 234111 ] ]
gap> PointDeletion([5,2,3,1,2,1]);
[ [ 23121 ], [ 41221 ] ]
gap> PointDeletion([5,2,4,1,6,3]);
[ [ 23121 ], [ 41221 ] ]
gap> PointDeletion([2,4,6,8,1,3,5,7]);
[ [ 234111 ] ]
gap> PointDeletion([2,3,4,5,1,1,1,1]);
[ [ 234111 ] ]
gap> Inflation([[3,2,1],[1],[1,2],[1,2,3]]);
645123 ]
gap> Inflation([[1,2],[1],[4,2,1,3]]);
15324 ]
gap> Inflation([[2,4,1,3],[2,1],[3,1,2],[1],[2,4,1,3]]);
32108915746 ]
gap> BlockDecomposition([3,2,10,8,9,1,5,7,4,6]);
[ [ 2413 ], [ 21 ], [ 312 ], [ 1 ], [ 2413 ] ]
gap> BlockDecomposition([1,2,3,4,5]);
[ [ 12 ], [ 1234 ], [ 1 ] ]
gap> BlockDecomposition([5,4,3,2,1]);
[ [ 21 ], [ 4321 ], [ 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]);
241369857 ]
gap> PermDirectSum([2,3,1,1],[2,4,3,1,1]);
231124311 ]
gap> PermSkewSum([2,4,1,3],[2,5,4,1,3]);
796825413 ]
gap> PermSkewSum([2,3,1,1],[2,4,3,1,1]);
786624311 ]
gap> a:=InversionAut(1);
< deterministic automaton on 2 letters with 4 states >
gap> Spectrum(a);
01234567891011121314 ]
gap> b:=InversionAut(5);
< deterministic automaton on 6 letters with 14 states >
gap> Spectrum(b);
00032271169343628106817172640391456297889 ]
gap> InversionAutOfClass(BoundedClassAutomaton(5),4);
< epsilon automaton on 6 letters with 20 states >
gap> InversionAutOfClass(BoundedClassAutomaton(5),6);
< epsilon automaton on 8 letters with 30 states >
gap> InversionAutOfClass(BoundedClassAutomaton(5),10);
< epsilon automaton on 12 letters with 50 states >
gap> PlusDecomposableAut(BoundedClassAutomaton(4));
< deterministic automaton on 4 letters with 7 states >
gap> PlusDecomposableAut(BoundedClassAutomaton(10));
< deterministic automaton on 10 letters with 19 states >
gap> PlusIndecomposableAut(BoundedClassAutomaton(4));
< deterministic automaton on 4 letters with 6 states >
gap> PlusIndecomposableAut(BoundedClassAutomaton(10));
< deterministic automaton on 10 letters with 12 states >
gap> MinusDecomposableAut(BoundedClassAutomaton(4));
< epsilon automaton on 5 letters with 28 states >
gap> MinusDecomposableAut(BoundedClassAutomaton(8));
< epsilon automaton on 9 letters with 181 states >
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);
< epsilon automaton on 8 letters with 771 states >
gap> NonSimpleAut(4);
< epsilon automaton on 5 letters with 85 states >
gap> SimplePermAut(3);
< deterministic automaton on 3 letters with 8 states >
gap> SimplePermAut(4);
< deterministic automaton on 4 letters with 22 states >
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]);
false
gap> IsExceptionalPerm([2,3,4,5,1,1,1,1]);
true
gap> IsExceptionalPerm([2,4,6,8,1,3,5,7]);
true
gap> IsExceptionalPerm([7,5,3,1,4,3,2,1]);
true
gap> IsExceptionalPerm([7,5,3,1,8,6,4,2]);
true
gap> IsExceptionalPerm([5,1,4,1,3,1,2,1]);
true
gap> IsExceptionalPerm([5,1,6,2,7,3,8,4]);
true
gap> IsExceptionalPerm([4,7,3,5,2,3,1,1]);
true
gap> IsExceptionalPerm([4,8,3,7,2,6,1,5]);
true
gap> ExceptionalBoundedAutomaton(6);
< deterministic automaton on 6 letters with 26 states >
gap> Spectrum(last);
020204020200000 ]
gap> ExceptionalBoundedAutomaton(15);
< deterministic automaton on 15 letters with 104 states >
gap> Spectrum(last);
020204040404040 ]
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  
--------------------
 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]);
< deterministic automaton on 3 letters with 4 states >
gap> b:=LoopVertexFreeAut(a);
< deterministic automaton on 3 letters with 3 states >
gap> Display(b);
   |  1  2  3  
--------------
 a |  2  2  1  
 b |  2  2  2  
 c |  3  2  2  
Initial state:   [ 3 ]
Accepting state: [ 1 ]
gap> STOP_TEST( "testall.tst", 10000 );

[Dauer der Verarbeitung: 0.15 Sekunden, vorverarbeitet 2026-06-17]