Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/tst/testinstall/   (GAP Algebra Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 14 kB image not shown  

Quelle  semipperm.tst   Sprache: unbekannt

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

#@local BruteForceInverseCheck,BruteForceIsoCheck,I,PPermDisplayLimit
#@local PPermNotation,S,inv,x,f,T

#
gap> START_TEST("semipperm.tst");

#
gap> PPermDisplayLimit := UserPreference("PartialPermDisplayLimit");;
gap> PPermNotation := UserPreference("NotationForPartialPerms");;
gap> SetUserPreference("PartialPermDisplayLimit", 100);
gap> SetUserPreference("NotationForPartialPerms", "component");

# Test DisplayString
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> DisplayString(S);
"\><\>partial perm\< \>semigroup\< \>of\< \>rank \>3\<\< \>with\< \>2\< \>gene\
rators\<>\<"

# Test  One for a partial perm semigroup without generators
gap> S := SymmetricInverseMonoid(3);;
gap> I := SemigroupIdealByGenerators(S, [S.3]);;
gap> HasGeneratorsOfSemigroup(I);
false
gap> One(I);
fail
gap> I := SemigroupIdealByGenerators(S, [S.1]);;
gap> HasGeneratorsOfSemigroup(I);
false
gap> One(I);
<identity partial perm on [ 123 ]>

# Test  One for a partial perm monoid with generators
gap> S := SymmetricInverseMonoid(3);;
gap> One(S);
<identity partial perm on [ 123 ]>
gap> S := Semigroup(S);;
gap> One(S);
<identity partial perm on [ 123 ]>

# Test  One for a partial perm semigroup with generators
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> One(S);
fail
gap> S := Semigroup(PartialPerm([213]));;
gap> One(S);
<identity partial perm on [ 123 ]>

# Test  Co/DegreeOfPartialPermSemigroup/Collection
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> DegreeOfPartialPermSemigroup(S);
3
gap> CodegreeOfPartialPermSemigroup(S);
11
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> DegreeOfPartialPermCollection(S);
3
gap> CodegreeOfPartialPermCollection(S);
11
gap> S := InverseSemigroup(PartialPerm([123], [4511]), 
>                          PartialPerm([1], [3]));;
gap> CodegreeOfPartialPermSemigroup(S);
11

# Test  RankOfPartialPermSemigroup/Collection 
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> RankOfPartialPermSemigroup(S);
3
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> RankOfPartialPermCollection(S);
3
gap> S := InverseSemigroup(PartialPerm([123], [4511]), 
>                          PartialPerm([1], [3]));;
gap> RankOfPartialPermSemigroup(S);
6
gap> S := Group(PartialPerm([]));;
gap> RankOfPartialPermSemigroup(S);
0
gap> S := Group([], PartialPerm([12]));;
gap> RankOfPartialPermSemigroup(S);
2

# Test Domain/ImageOfPartialPermCollection/Semigroup
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> DomainOfPartialPermCollection(S);
1 .. 3 ]
gap> ImageOfPartialPermCollection(S);
34511 ]
gap> S := Semigroup(PartialPerm([123], [4511]), 
>                   PartialPerm([1], [3]));;
gap> DomainOfPartialPermCollection(S);
1 .. 3 ]
gap> ImageOfPartialPermCollection(S);
34511 ]
gap> S := InverseSemigroup(PartialPerm([123], [4511]), 
>                          PartialPerm([1], [3]));;
gap> DomainOfPartialPermCollection(S);
1234511 ]
gap> ImageOfPartialPermCollection(S);
1234511 ]

# Test Fixed/moved points etc
gap> S := Semigroup(PartialPerm([12346710], [10846532]),
>              PartialPerm([12456910], [3584197]),
>              PartialPerm([12479], [53749]),
>              PartialPerm([123468], [5110789]));
<partial perm semigroup of rank 10 with 4 generators>
gap> FixedPointsOfPartialPerm(S);
9 ]
gap> MovedPoints(S);
1234567810 ]
gap> NrFixedPoints(S);
1
gap> NrMovedPoints(S);
9
gap> LargestMovedPoint(S);
10
gap> LargestImageOfMovedPoint(S);
10
gap> SmallestMovedPoint(S);
1
gap> SmallestImageOfMovedPoint(S);
1

# Test MultiplicativeZero for partial perm semigroups
gap> x := PartialPerm([12479], [53749]);;
gap> S := InverseSemigroup(x);
<inverse partial perm semigroup of rank 7 with 1 generator>
gap> Zero(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `ZeroMutable' on 1 arguments
gap> MultiplicativeZero(S);
fail

# Test MultiplicativeZero 
gap> S := SymmetricInverseMonoid(5);
<symmetric inverse monoid of degree 5>
gap> MultiplicativeZero(S);
<empty partial perm>
gap> S := Monoid(PartialPerm([1]));;
gap> MultiplicativeZero(S);
<identity partial perm on [ 1 ]>
gap> MultiplicativeZero(S);
<identity partial perm on [ 1 ]>
gap> S := Monoid(PartialPerm([21]));;
gap> MultiplicativeZero(S);
fail

# Test Zero 
gap> S := SymmetricInverseMonoid(5);
<symmetric inverse monoid of degree 5>
gap> ZeroMutable(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `ZeroMutable' on 1 arguments
gap> ZeroImmutable(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `ZeroMutable' on 1 arguments
gap> S := Monoid(PartialPerm([21]));;
gap> ZeroImmutable(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `ZeroMutable' on 1 arguments
gap> ZeroMutable(S);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `ZeroMutable' on 1 arguments

# Test GeneratorsOfInverseSemigroup
gap> S := Semigroup(PartialPerm([13], [35]), 
>                   PartialPerm([134], [451]),
>                   PartialPerm([35], [13]), 
>                   PartialPerm([145], [413]));;
gap> IsInverseSemigroup(S);
true
gap> GeneratorsOfInverseSemigroup(S);
[ [1,3,5], [3,5](1,4) ]

# Test GeneratorsOfInverseMonoid
gap> S := Monoid(PartialPerm([13], [35]), 
>                PartialPerm([134], [451]),
>                PartialPerm([35], [13]), 
>                PartialPerm([145], [413]));;
gap> IsInverseMonoid(S);
true
gap> GeneratorsOfInverseMonoid(S);
[ [1,3,5], [3,5](1,4) ]

#T# BruteForceIsoCheck helper functions
gap> BruteForceIsoCheck := function(iso)
>   local x, y;
>   if not IsInjective(iso) or not IsSurjective(iso) then
>     return false;
>   fi;
>   if Size(Range(iso)) <> Size(Source(iso)) then 
>     return false;
>   fi;
>   for x in GeneratorsOfSemigroup(Source(iso)) do
>     for y in GeneratorsOfSemigroup(Source(iso)) do
>       if x ^ iso * y ^ iso <> (x * y) ^ iso then
>         return false;
>       fi;
>     od;
>   od;
>   return true;
> end;;
gap> BruteForceInverseCheck := function(map)
> local inv;
>   inv := InverseGeneralMapping(map);
>   return ForAll(Source(map), x -> x = (x ^ map) ^ inv)
>     and ForAll(Range(map), x -> x = (x ^ inv) ^ map);
> end;;

# Test IsomorphismPartialPermSemigroup for a semigroup
gap> S := SemigroupByMultiplicationTable(
> [[12225], 
>  [22222], 
>  [22342], 
>  [42223],
>  [22512]]);;
gap> IsInverseSemigroup(S);
true
gap> HasGeneratorsOfSemigroup(S);
true
gap> IsomorphismPartialPermSemigroup(S);
MappingByFunction( <inverse semigroup of size 5, with 5 generators>, 
<inverse partial perm semigroup of size 5, rank 5 with 5 generators>
 , function( x ) ... end )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> S := SemigroupByMultiplicationTable(
> [[1111],
>  [1111],
>  [1142],
>  [1121]]);;
gap> IsomorphismPartialPermSemigroup(S);
Error, the argument must be an inverse semigroup

# Test IsomorphismPartialPermMonoid for a semigroup
gap> S := SemigroupByMultiplicationTable(
> [[1111],
>  [1111],
>  [1142],
>  [1121]]);;
gap> IsomorphismPartialPermMonoid(S);
Error, the argument must be a semigroup with a multiplicative neutral element
gap> S := MonoidByMultiplicationTable(
> [[1234],
>  [2222],
>  [3222],
>  [4222]]);;
gap> IsomorphismPartialPermMonoid(S);
Error, the argument must be an inverse semigroup
gap> S := MonoidByMultiplicationTable(
> [[12],
>  [22]]);
<monoid of size 2, with 2 generators>
gap> IsomorphismPartialPermMonoid(S);
MappingByFunction( <inverse monoid of size 2, with 2 generators>, 
<inverse partial perm monoid of size 2, rank 2 with 2 generators>
 , function( x ) ... end, function( x ) ... end )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true

# Test IsomorphismPartialPermSemigroup/Monoid for a partial perm
# semigroup/monoid
gap> IsomorphismPartialPermSemigroup(SymmetricInverseMonoid(3));
MappingByFunction( <symmetric inverse monoid of degree 3>, <symmetric inverse \
monoid of degree 3>, function( object ) ... end, function( object ) ... end )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(SymmetricInverseMonoid(3));
MappingByFunction( <symmetric inverse monoid of degree 3>, <symmetric inverse \
monoid of degree 3>, function( object ) ... end, function( object ) ... end )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true

# Test IsomorphismPartialPermMonoid for a partial perm semigroup
gap> S := Semigroup(PartialPerm([2], [2]), PartialPerm([1], [1]));;
gap> IsomorphismPartialPermMonoid(S);
Error, the argument must be a semigroup with a multiplicative neutral element
gap> S := Semigroup(PartialPerm([21]));;
gap> IsomorphismPartialPermMonoid(S);;
gap> IsMonoid(Range(last));
true
gap> BruteForceIsoCheck(last2);
true
gap> BruteForceInverseCheck(last3);
true
gap> S := InverseSemigroup(PartialPerm([21]));;
gap> IsomorphismPartialPermMonoid(S);;
gap> IsMonoid(Range(last));
true
gap> BruteForceIsoCheck(last2);
true
gap> BruteForceInverseCheck(last3);
true

# Test IsomorphismPartialPermSemigroup for a transformation semigroup
gap> S := Semigroup(Transformation([225121]),
>                   Transformation([222222]),
>                   Transformation([422233]));;
gap> IsomorphismPartialPermSemigroup(S);;
gap> IsInverseSemigroup(Range(last));
true
gap> BruteForceIsoCheck(last2);
true
gap> BruteForceInverseCheck(last3);
true
gap> S := Semigroup(Transformation([11111]),
>                   Transformation([13412]));;
gap> IsomorphismPartialPermSemigroup(S);
Error, the argument must be an inverse semigroup

# Test IsomorphismPartialPermSemigroup for a perm group
gap> IsomorphismPartialPermSemigroup(Group((1,2,3)));
MappingByFunction( Group([ (1,2,3) ]), <partial perm group of rank 3 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermSemigroup(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermSemigroup(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group((1,2,3)));
MappingByFunction( Group([ (1,2,3) ]), <partial perm group of rank 3 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
  1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true

# Test SymmetricInverseMonoid
gap> SymmetricInverseMonoid(-1);
Error, the argument should be a non-negative integer
gap> SymmetricInverseMonoid(0);
<symmetric inverse monoid of degree 0>
gap> SymmetricInverseMonoid(1);
<symmetric inverse monoid of degree 1>
gap> SymmetricInverseMonoid(2);
<symmetric inverse monoid of degree 2>

# Test IsSymmetricInverseSemigroup
gap> IsSymmetricInverseSemigroup(Semigroup(PartialPerm([1])));
false
gap> IsSymmetricInverseSemigroup(Semigroup(PartialPerm([])));
true

# Test NaturalPartialOrder and ReverseNaturalPartialOrder
gap> S := SymmetricInverseMonoid(3);;
gap> NaturalPartialOrder(S);
[ [  ], [ 1 ], [ 1 ], [ 1 ], [ 1 ], [ 1 ], [ 1 ], [ 126 ], [ 127 ], 
  [ 135 ], [ 137 ], [ 145 ], [ 146 ], [ 1 ], [ 1 ], [ 1 ], 
  [ 1515 ], [ 1516 ], [ 1614 ], [ 1616 ], [ 1714 ], 
  [ 1715 ], [ 1215 ], [ 1216 ], [ 1268162024 ], 
  [ 1279152223 ], [ 1314 ], [ 1316 ], 
  [ 13510161828 ], [ 13711142127 ], [ 1414 ], 
  [ 1415 ], [ 14512151732 ], [ 14613141931 ] ]
gap> ReverseNaturalPartialOrder(S);
[ [ 23456789101112131415161718192021
      22232425262728293031323334 ], 
  [ 8923242526 ], [ 101127282930 ], 
  [ 121331323334 ], [ 101217182933 ], 
  [ 81319202534 ], [ 91121222630 ], [ 25 ], [ 26 ], 
  [ 29 ], [ 30 ], [ 33 ], [ 34 ], [ 192127303134 ], 
  [ 172223263233 ], [ 182024252829 ], [ 33 ], [ 29 ], 
  [ 34 ], [ 25 ], [ 30 ], [ 26 ], [ 26 ], [ 25 ], [  ], [  ], [ 30 ], [ 29 ], 
  [  ], [  ], [ 34 ], [ 33 ], [  ], [  ] ]

#
gap> f:=PartialPerm([1,2,3,70000],[1,2,3,100]);
[70000,100](1)(2)(3)
gap> T:=InverseSemigroup(List(GeneratorsOfInverseSemigroup(S),x->x*f));;
gap> NaturalPartialOrder(S) = NaturalPartialOrder(T);
true
gap> ReverseNaturalPartialOrder(S) = ReverseNaturalPartialOrder(T);
true

#
gap> S := InverseSemigroup([PartialPerm([234], [251]),
> PartialPerm([2], [2]), PartialPerm([125], [423])]);;
gap> NaturalPartialOrder(S);
[ [  ], [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
gap> ReverseNaturalPartialOrder(S);
[ [ 2345 ], [  ], [  ], [  ], [  ] ]

#
gap> STOP_TEST("semipperm.tst");

[Dauer der Verarbeitung: 0.16 Sekunden, vorverarbeitet 2026-06-11]