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

Quelle  semigrp.tst   Sprache: unbekannt

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

############################################################################
##
#W  standard/semigroups/semigrp.tst
#Y  Copyright (C) 2015-2022                              James D. Mitchell
##
##  Licensing information can be found in the README file of this package.
##
#############################################################################
##

#@local G, I, IsIsometryPP, M, S, T, U, acting, func, gens, i, j, k, l, n
#@local regular, small, x
gap> START_TEST("Semigroups package: standard/semigroups/semigrp.tst");
gap> LoadPackage("semigroups", false);;

#
gap> SEMIGROUPS.StartTest();;

# AsMonoid with 1 arg
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> AsMonoid(S);
<trivial transformation group of degree 0 with 1 generator>
gap> T := AsSemigroup(IsBooleanMatSemigroup, S);;
gap> IsMonoid(T);
false
gap> IsMonoidAsSemigroup(T);
true
gap> AsMonoid(T);
<trivial group of 1x1 boolean matrices with 1 generator>
gap> S := AsSemigroup(IsFpSemigroup, S);
<fp semigroup with 1 generator and 1 relation of length 4>
gap> AsMonoid(S);;
gap> S := AsSemigroup(IsMaxPlusMatrixSemigroup, S);
<trivial group of 2x2 max-plus matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 max-plus matrices with 1 generator>
gap> S := AsSemigroup(IsMinPlusMatrixSemigroup, S);
<trivial group of 1x1 min-plus matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsMinPlusMatrixSemigroup, S);
<commutative semigroup of 2x2 min-plus matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 min-plus matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsProjectiveMaxPlusMatrixSemigroup, S);
<commutative semigroup of 2x2 projective max-plus matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 projective max-plus matrices with 1 generator>
gap> S := AsSemigroup(IsIntegerMatrixSemigroup, S);
<trivial group of 1x1 integer matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsIntegerMatrixSemigroup, S);
<commutative semigroup of 2x2 integer matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 integer matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsTropicalMaxPlusMatrixSemigroup, 3, S);
<commutative semigroup of 2x2 tropical max-plus matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 tropical max-plus matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsTropicalMinPlusMatrixSemigroup, 3, S);
<commutative semigroup of 2x2 tropical min-plus matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 tropical min-plus matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsNTPMatrixSemigroup, 33, S);
<commutative semigroup of 2x2 ntp matrices with 1 generator>
gap> AsMonoid(S);
<trivial group of 1x1 ntp matrices with 1 generator>
gap> S := Semigroup(Transformation([2234]));
<commutative transformation semigroup of degree 2 with 1 generator>
gap> S := AsSemigroup(IsPBRSemigroup, S);
<commutative pbr semigroup of degree 2 with 1 generator>
gap> AsMonoid(S);
<trivial pbr group of degree 1 with 1 generator>

# AsMonoid returns fail
gap> S := InverseSemigroup(
> [Bipartition([[1, -4], [2, -1], [3, -2], [4], [-3]]),
>  Bipartition([[1, -3], [2], [3], [4, -1], [-2], [-4]])]);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsTransformationSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsPartialPermSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsBooleanMatSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsFpSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsMaxPlusMatrixSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsMinPlusMatrixSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsTropicalMaxPlusMatrixSemigroup, 3, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsTropicalMinPlusMatrixSemigroup, 3, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsProjectiveMaxPlusMatrixSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsIntegerMatrixSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsNTPMatrixSemigroup, 33, S);;
gap> AsMonoid(S);
fail
gap> S := AsSemigroup(IsPBRSemigroup, S);;
gap> AsMonoid(S);
fail
gap> S := TrivialSemigroup(IsReesMatrixSemigroup); 
<Rees matrix semigroup 1x1 over Group(())>
gap> AsMonoid(S);
fail
gap> S := ReesZeroMatrixSemigroup(Group(()), [[()]]);;
gap> AsMonoid(S);
fail
gap> S := GraphInverseSemigroup(Digraph([[2], []]));
<finite graph inverse semigroup with 2 vertices, 1 edge>
gap> AsMonoid(S);
fail

# ClosureSemigroup 1
gap> gens :=
> [Matrix(IsBooleanMat, [[00010], [01111], [11110],
>       [10111], [01011]]),
>   Matrix(IsBooleanMat, [[10111], [11001], [00111],
>       [11000], [00101]]),
>   Matrix(IsBooleanMat, [[00001], [10111], [10101],
>       [10101], [11110]]),
>   Matrix(IsBooleanMat, [[11100], [10100], [01101],
>       [00011], [11100]]),
>   Matrix(IsBooleanMat, [[01010], [10010], [11000],
>       [10110], [00110]])];;
gap> x := Matrix(IsBooleanMat, [[1000], [1000], [1010], 
> [1001]]);;
gap> S := Semigroup(gens);
<semigroup of 5x5 boolean matrices with 5 generators>
gap> ClosureSemigroup(S, [x], SEMIGROUPS.OptionsRec(S));
Error, the 1st argument (a semigroup) and the 2nd argument (a list or coll.) c\
annot be used to generate a semigroup
gap> ClosureSemigroup(S, [IdentityTransformation],
> SEMIGROUPS.OptionsRec(S));
Error, the 1st argument (a semigroup) and the 2nd argument (a list or coll.) c\
annot be used to generate a semigroup

# ClosureSemigroup 2
gap> S := Semigroup(Transformation([2434]),
>                   Transformation([33233]));;
gap> ClosureSemigroup(S, 
>                             [ConstantTransformation(77)], 
>                             SEMIGROUPS.OptionsRec(S));
<transformation semigroup of degree 7 with 3 generators>
gap> Size(S) = Size(Semigroup(S));
true
gap> Size(S);
6

# ClosureSemigroup 3
gap> S := Semigroup(Transformation([2434]),
>                   Transformation([33233]), rec(acting := false));;
gap> S := ClosureSemigroup(S, 
>                                 [ConstantTransformation(77)], 
>                                 SEMIGROUPS.OptionsRec(S));
<transformation semigroup of degree 7 with 3 generators>
gap> Size(S) = Size(Semigroup(S));
true
gap> Size(S);
7

# ClosureSemigroup 3
gap> S := Semigroup(Transformation([2434]),
>                   Transformation([33233]), rec(acting := false));;
gap> S := ClosureSemigroup(S, 
>                                 [Transformation([55544])],
>                                 SEMIGROUPS.OptionsRec(S));
<transformation semigroup of degree 5 with 3 generators>
gap> Size(S) = Size(Semigroup(S));
true
gap> Size(S);
14

# ClosureSemigroup 4
gap> S := FreeBand(3);
<free band on the generators [ x1, x2, x3 ]>
gap> T := Semigroup(S.1, S.2);
<semigroup with 2 generators>
gap> T := ClosureSemigroup(T, [S.3], SEMIGROUPS.OptionsRec(T));
<semigroup with 3 generators>
gap> Size(T);
159
gap> T = S;
true

# ClosureSemigroup 5
gap> S := Semigroup(PartialPerm([1]), rec(acting := false));
<trivial partial perm group of rank 1 with 1 generator>
gap> S := ClosureSemigroup(S, 
>                          [PartialPerm([3])],
>                          SEMIGROUPS.OptionsRec(S));
<partial perm semigroup of rank 1 with 2 generators>
gap> Size(S) = Size(Semigroup(S));
true
gap> Size(S);
3

# IsGeneratorsOfInverseSemigroup for a semigroup 1
gap> S := InverseMonoid(PartialPerm([123569], [846532]),
>  PartialPerm([134589], [584197]),
>  PartialPerm([13568], [37549]),
>  PartialPerm([123567], [1107859]));;
gap> IsGeneratorsOfInverseSemigroup(S);
true

# IsGeneratorsOfInverseSemigroup for a semigroup 2
gap> S := Monoid(
> Bipartition([[1, -8], [2, -4], [3, -6], [4], [5, -5],
>      [6, -3], [7], [8], [9, -2], [10], [-1], [-7], [-9],
>      [-10]]), 
> Bipartition([[1, -5], [2], [3, -8], [4, -4],
>      [5, -1], [6], [7], [8, -9], [9, -7], [10], [-2], [-3],
>      [-6], [-10]]), 
> Bipartition([[1, -3], [2], [3, -7], [4],
>      [5, -5], [6, -4], [7], [8, -9], [9], [10], [-1], [-2],
>      [-6], [-8], [-10]]),
> Bipartition([[1, -1], [2, -10], [3, -7], [4], [5, -8],
>      [6, -5], [7, -9], [8], [9], [10], [-2], [-3], [-4],
>      [-6]]), 
> Bipartition([[1], [2, -9], [3, -6], [4, -2],
>      [5, -5], [6, -3], [7], [8, -1], [9], [10], [-4], [-7],
>      [-8], [-10]]), 
> Bipartition([[1, -5], [2], [3], [4, -4],
>      [5, -1], [6], [7, -9], [8, -3], [9, -8], [10], [-2],
>      [-6], [-7], [-10]]),
> Bipartition([[1], [2], [3, -1], [4, -6], [5, -5], [6],
>      [7, -3], [8], [9, -8], [10], [-2], [-4], [-7], [-9],
>      [-10]]), 
> Bipartition([[1, -1], [2], [3], [4], [5, -6],
>      [6], [7, -3], [8, -5], [9, -7], [10, -2], [-4], [-8],
>      [-9], [-10]]));;
gap> IsInverseActingSemigroupRep(S);
false
gap> IsGeneratorsOfInverseSemigroup(S);
true
gap> S := Semigroup(S);;
gap> IsInverseSemigroup(S);
true
gap> IsInverseActingSemigroupRep(S);
false
gap> IsGeneratorsOfInverseSemigroup(S);
true
gap> S := InverseSemigroup(S);;
gap> IsInverseActingSemigroupRep(S) or not IsActingSemigroup(S);
true

# Generators 1
gap> S := JonesMonoid(5);
<regular bipartition *-monoid of degree 5 with 4 generators>
gap> I := SemigroupIdeal(S, S.4);
<regular bipartition *-semigroup ideal of degree 5 with 1 generator>
gap> Generators(I);
[ <bipartition: [ 1, -1 ], [ 2, -2 ], [ 3, -3 ], [ 45 ], [ -4, -5 ]> ]

# Generators 2
gap> S := Group(IdentityTransformation);;
gap> Generators(S);
[ IdentityTransformation ]

# Generators 3
gap> S := DualSymmetricInverseMonoid(3);
<inverse block bijection monoid of degree 3 with 3 generators>
gap> Generators(S);
[ <block bijection: [ 1, -2 ], [ 2, -3 ], [ 3, -1 ]>, 
  <block bijection: [ 1, -2 ], [ 2, -1 ], [ 3, -3 ]>, 
  <block bijection: [ 12, -3 ], [ 3, -1, -2 ]> ]

# Generators 4
gap> S := DualSymmetricInverseMonoid(3);;
gap> S := InverseSemigroup(S.2, S.3);;
gap> HasGeneratorsOfInverseMonoid(S);
false
gap> Generators(S);
[ <block bijection: [ 1, -2 ], [ 2, -1 ], [ 3, -3 ]>, 
  <block bijection: [ 12, -3 ], [ 3, -1, -2 ]> ]
gap> HasGeneratorsOfMonoid(S);
false

# Generators 5
gap> S := Monoid(Transformation([22]), Transformation([212]));;
gap> Generators(S);
[ Transformation( [ 22 ] ), Transformation( [ 212 ] ) ]
gap> GeneratorsOfSemigroup(S);
[ IdentityTransformation, Transformation( [ 22 ] ), 
  Transformation( [ 212 ] ) ]

# SemigroupByGenerators 1
gap> S := Semigroup(AsSet(FullTransformationMonoid(3)), rec(small := true));
<transformation monoid of degree 3 with 3 generators>

# SemigroupByGenerators 2
gap> S := Semigroup(AsSet(FullBooleanMatMonoid(2)), rec(small := true));
<monoid of 2x2 boolean matrices with 3 generators>

# SemigroupByGenerators 4
gap> SetInfoLevel(InfoSemigroups, 2);
gap> S := Semigroup(AsSet(FullBooleanMatMonoid(2)), rec(small := true));
<monoid of 2x2 boolean matrices with 4 generators>
gap> SetInfoLevel(InfoSemigroups, 0); 

# SemigroupByGenerators 5
gap> S := Semigroup(IdentityTransformation, Transformation([21]),
> Transformation([21]),
> rec(acting := false, small := true));
<commutative transformation monoid of degree 2 with 1 generator>

# SemigroupByGenerators 6
gap> S := Semigroup(BooleanMat([[10], [01]]), 
> AsSet(FullBooleanMatMonoid(2)), 
> rec(acting := false, small := true));
<monoid of 2x2 boolean matrices with 3 generators>

# SemigroupByGenerators 7
gap> S := Semigroup(PartialPerm([12]), PartialPerm([1]));
<partial perm monoid of rank 2 with 2 generators>

# SemigroupByGenerators 8
gap> S := Semigroup(Transformation([21]), Transformation([21]),
> Transformation([112]),
> rec(small := true));
<transformation semigroup of degree 3 with 2 generators>

# SemigroupByGenerators 9
gap> SetInfoLevel(InfoSemigroups, 2);
gap> S := Semigroup(GeneratorsOfMonoid(FullBooleanMatMonoid(2)), 
> rec(small := true));
<semigroup of 2x2 boolean matrices with 3 generators>
gap> SetInfoLevel(InfoSemigroups, 0); 

# SemigroupByGenerators 10
gap> S := Semigroup(GeneratorsOfMonoid(FullTransformationMonoid(2)), 
> rec(regular := true));;
gap> IsRegularSemigroup(S);
true

# RegularSemigroup 1
gap> S := RegularSemigroup(BrauerMonoid(4));;
gap> Size(S);
105

# RegularSemigroup 2
gap> S := RegularSemigroup(BrauerMonoid(4), rec());;
gap> Size(S);
105

# MonoidByGenerators 1
gap> S := Monoid(AsSet(FullTransformationMonoid(3)), rec(small := true));
<transformation monoid of degree 3 with 3 generators>

# MonoidByGenerators 2
gap> S := Monoid(AsSet(FullBooleanMatMonoid(2)), rec(small := true));
<monoid of 2x2 boolean matrices with 4 generators>

# MonoidByGenerators 3
gap> S := Monoid(BrauerMonoid(4), rec(regular := true));;
gap> Size(S);
105

# MonoidByGenerators 4
gap> SetInfoLevel(InfoSemigroups, 2);
gap> S := Monoid(AsSet(FullBooleanMatMonoid(2)), rec(small := true));;
gap> SetInfoLevel(InfoSemigroups, 0); 

# MonoidByGenerators 5
gap> S := Monoid(IdentityTransformation, Transformation([21]));
<commutative transformation monoid of degree 2 with 1 generator>
gap> S := Monoid(IdentityTransformation, Transformation([21]), 
> rec(acting := false));
<commutative transformation monoid of degree 2 with 1 generator>

# MonoidByGenerators 7
gap> S := Monoid(IdentityTransformation, Transformation([21]),
> Transformation([21]),
> rec(acting := false, small := true));
<commutative transformation monoid of degree 2 with 1 generator>

# MonoidByGenerators 8
gap> S := Monoid(PartialPerm([12]), PartialPerm([1]));
<partial perm monoid of rank 2 with 2 generators>

# InverseSemigroupByGenerators 1
gap> InverseSemigroupByGenerators([Transformation([112])], rec());
Error, the 1st argument (a finite mult. elt. coll.) must satisfy IsGeneratorsO\
fInverseSemigroup

# InverseSemigroupByGenerators 2
gap> InverseSemigroup(PartialPerm([123]));
<trivial partial perm group of rank 3 with 1 generator>

# InverseSemigroupGenerators 3
gap> S := InverseSemigroup(PartialPerm([1]),
>                          PartialPerm([1], [2]), 
>                          PartialPerm([21]),
>                          rec(small := true));
<inverse partial perm semigroup of rank 2 with 2 generators>

# InverseSemigroupGenerators 4
gap> SetInfoLevel(InfoSemigroups, 2);
gap> S := InverseSemigroup(PartialPerm([1]),
>                          PartialPerm([1], [2]), 
>                          PartialPerm([21]),
>                          rec(small := true));
<inverse partial perm semigroup of rank 2 with 2 generators>
gap> SetInfoLevel(InfoSemigroups, 0); 

# InverseMonoidByGenerators 1
gap> InverseMonoidByGenerators([Transformation([112])], rec());
Error, the 1st argument (a finite mult. elt. coll.) must satisfy IsGeneratorsO\
fInverseSemigroup

# InverseMonoidByGenerators 2
gap> InverseMonoid(PartialPerm([123]));
<trivial partial perm group of rank 3 with 1 generator>

# InverseMonoidGenerators 3
gap> S := InverseMonoid(PartialPerm([1]),
>                          PartialPerm([1], [2]), 
>                          PartialPerm([21]),
>                          rec(small := true));
<inverse partial perm monoid of rank 2 with 2 generators>

# InverseMonoidGenerators 4
gap> SetInfoLevel(InfoSemigroups, 2);
gap> S := InverseMonoid(PartialPerm([1]),
>                          PartialPerm([1], [2]), 
>                          PartialPerm([21]),
>                          rec(small := true));
<inverse partial perm monoid of rank 2 with 2 generators>
gap> SetInfoLevel(InfoSemigroups, 0); 

# ClosureInverseSemigroup 1
gap> S := InverseSemigroup(Bipartition([[1, -4], [23, -1], [4, -2, -3]]),
> Bipartition([[1, -2, -4], [2, -3], [34, -1]]),
> Bipartition([[1234, -1, -2, -3, -4]]),
> Bipartition([[12, -4], [3, -3], [4, -1, -2]]));
<inverse block bijection semigroup of degree 4 with 4 generators>
gap> Size(S);
64
gap> T := ClosureInverseSemigroup(S, [S.1, S.3 * S.4 ^ -1]);
<inverse block bijection semigroup of size 64, degree 4 with 4 generators>
gap> Size(T);
64
gap> S = T;
true
gap> IsIdenticalObj(S, T);
true
gap> T := ClosureInverseSemigroup(S, 
> [Bipartition([[123, -1, -2, -4], [4, -3]])]);;
gap> T =
> InverseSemigroup(Bipartition([[1, -4], [23, -1], [4, -2, -3]]),
>                  Bipartition([[1, -2, -4], [2, -3], [34, -1]]),
>                  Bipartition([[1234, -1, -2, -3, -4]]),
>                  Bipartition([[12, -4], [3, -3], [4, -1, -2]]),
>                  Bipartition([[123, -1, -2, -4], [4, -3]]));
true
gap> Size(T);
108
gap> S = T;
false

# ClosureInverseSemigroup 2
gap> S := SymmetricInverseMonoid(5);
<symmetric inverse monoid of degree 5>
gap> Size(S);
1546
gap> T := ClosureInverseSemigroup(S, PartialPerm([6]));;
gap> T =
> InverseSemigroup(PartialPerm([12345], [23451]),
>                  PartialPerm([12345], [21345]),
>                  PartialPerm([2345], [1234]),
>                  PartialPerm([12345], [12345]),
>                  PartialPerm([1], [6]));
true
gap> Size(T);
1557
gap> T := ClosureInverseSemigroup(S, PartialPerm([6]), rec());;
gap> T =
> InverseSemigroup(PartialPerm([12345], [23451]),
>                  PartialPerm([12345], [21345]),
>                  PartialPerm([2345], [1234]),
>                  PartialPerm([12345], [12345]),
>                  PartialPerm([1], [6]));
true
gap> Size(T);
1557

# ClosureInverseSemigroup 3
gap> S := InverseSemigroup(Bipartition([[1, -4], [23, -1], [4, -2, -3]]),
> Bipartition([[1, -2, -4], [2, -3], [34, -1]]),
> Bipartition([[1234, -1, -2, -3, -4]]),
> Bipartition([[12, -4], [3, -3], [4, -1, -2]]));
<inverse block bijection semigroup of degree 4 with 4 generators>
gap> Size(S);
64
gap> T := ClosureInverseSemigroup(S, [], rec());
<inverse block bijection semigroup of size 64, degree 4 with 4 generators>
gap> Size(T);
64
gap> S = T;
true
gap> IsIdenticalObj(S, T);
true

# ClosureInverseSemigroup 4
gap> S := InverseSemigroup(Bipartition([[1, -4], [23, -1], [4, -2, -3]]),
> Bipartition([[1, -2, -4], [2, -3], [34, -1]]),
> Bipartition([[1234, -1, -2, -3, -4]]),
> Bipartition([[12, -4], [3, -3], [4, -1, -2]]));
<inverse block bijection semigroup of degree 4 with 4 generators>
gap> Size(S);
64
gap> T := ClosureInverseSemigroup(S, 
> [Bipartition([[12, -2], [3, -1], [-3]])], rec());
Error, the 2nd argument (a finite mult. elt. coll.) must satisfy IsGeneratorsO\
fInverseSemigroup
gap> T := ClosureInverseSemigroup(S, 
> [PartialPerm([])], rec());
Error, the 1st argument (a semigroup) and the 2nd argument (a mult. elt. coll.\
) cannot be used to generate an inverse semigroup
gap> T := ClosureInverseSemigroup(S, 
> [Bipartition([[12, -4], [34, -2], [-1, -3]])], rec());
Error, the 2nd argument (a finite mult. elt. coll.) must satisfy IsGeneratorsO\
fInverseSemigroup

# ClosureInverseSemigroup 5
gap> S := InverseSemigroup(Bipartition([[1, -4], [23, -1], [4, -2, -3]]),
> Bipartition([[1, -2, -4], [2, -3], [34, -1]]),
> Bipartition([[1234, -1, -2, -3, -4]]),
> Bipartition([[12, -4], [3, -3], [4, -1, -2]]));
<inverse block bijection semigroup of degree 4 with 4 generators>
gap> Size(S);
64
gap> T := ClosureInverseSemigroup(S, DualSymmetricInverseMonoid(4), rec());;
gap> IsMonoidAsSemigroup(T);
true
gap> Size(T) = Size(InverseSemigroup(T));
true
gap> Size(T);
339

# ClosureInverseSemigroup 6
gap> S := InverseSemigroup(Bipartition([[1, -1, -3], [23, -2]]),
>                          Bipartition([[1, -3], [2, -2], [3, -1]]));;
gap> T := ClosureInverseSemigroup(S, DClass(PartitionMonoid(3),
> IdentityBipartition(3)));;
gap> Size(T);
25

# ClosureInverseSemigroupOrMonoidNC 1
gap> S := SymmetricInverseMonoid(5);
<symmetric inverse monoid of degree 5>
gap> I := SemigroupIdeal(S, S.3);
<inverse partial perm semigroup ideal of rank 5 with 1 generator>
gap> T := ClosureInverseSemigroup(I, [S.1], rec());;
gap> Size(T);
1431
gap> Size(S);
1546
gap> S.1;
(1,2,3,4,5)

# ClosureSemigroup 1
gap> S := Semigroup(
> [Matrix(IsBooleanMat, [[01001111], [11110101],
>       [11010111], [01111100],
>       [10011111], [00000101],
>       [00001101], [11101011]]),
>   Matrix(IsBooleanMat, [[01011111], [01110010],
>       [10001101], [00011111],
>       [00010101], [00101100],
>       [01011000], [11001000]]),
>   Matrix(IsBooleanMat, [[00100110], [01010011],
>       [11111000], [10001010],
>       [10010100], [10000101],
>       [11101101], [10111101]]),
>   Matrix(IsBooleanMat, [[10100101], [00001101],
>       [00011101], [00011001],
>       [10010101], [01010001],
>       [10001000], [11011001]]),
>   Matrix(IsBooleanMat, [[11111111], [11000100],
>       [11000100], [10011110],
>       [11111111], [01011100],
>       [01001001], [01110001]]),
>   Matrix(IsBooleanMat, [[11100010], [00100100],
>       [00000000], [10110001],
>       [01100000], [11111001],
>       [00110010], [01001011]]),
>   Matrix(IsBooleanMat, [[01000111], [01000100],
>       [00000011], [00101101],
>       [00001111], [10011001],
>       [10010100], [00000110]]),
>   Matrix(IsBooleanMat, [[10010111], [01000101],
>       [10001011], [10100100],
>       [00010100], [01100010],
>       [11111010], [11001100]]),
>   Matrix(IsBooleanMat, [[10001100], [10001100],
>       [10100001], [11111111],
>       [10101111], [10010101],
>       [00111001], [00110101]]),
>   Matrix(IsBooleanMat, [[11011011], [00000111],
>       [11010101], [00100110],
>       [01011001], [01011100],
>       [10111111], [01011000]])]);
<semigroup of 8x8 boolean matrices with 10 generators>
gap> Size(S);
266
gap> x := Matrix(IsBooleanMat, [[00010100], [10001100],
>  [00100011], [01111110],
>  [10011001], [00011010],
>  [10010110], [11110001]]);;
gap> T := ClosureSemigroup(S, [x, S.2]);
<semigroup of 8x8 boolean matrices with 11 generators>
gap> Size(T);
315
gap> Size(T) = Size(Semigroup(T));
true
gap> T := ClosureSemigroup(S, S.2);
<semigroup of size 2668x8 boolean matrices with 10 generators>
gap> Size(T);
266
gap> Size(T) = Size(Semigroup(T));
true
gap> IsIdenticalObj(S, T);
true
gap> T := ClosureSemigroup(S, x);
<semigroup of 8x8 boolean matrices with 11 generators>
gap> Size(T);
315
gap> Size(T) = Size(Semigroup(T));
true
gap> T := ClosureSemigroup(S, x, rec());
<semigroup of 8x8 boolean matrices with 11 generators>
gap> Size(T);
315
gap> Size(T) = Size(Semigroup(T));
true

# ClosureSemigroup 2
gap> S := FullTransformationMonoid(2);
<full transformation monoid of degree 2>
gap> T := ClosureSemigroup(S, FullTransformationMonoid(4));;
gap> Size(T);
256
gap> T = FullTransformationMonoid(4);
true

# ClosureSemigroup 3
gap> S := Semigroup(Bipartition([[13, -3], [2], [-1, -2]]),
>                   Bipartition([[1, -3], [23, -1], [-2]]));;
gap> T := ClosureSemigroup(S, IdentityBipartition(4));
Error, the 1st argument (a semigroup) and the 2nd argument (a list or coll.) c\
annot be used to generate a semigroup

# ClosureSemigroup 4
gap> S := Semigroup(Bipartition([[13, -3], [2], [-1, -2]]),
>                   Bipartition([[1, -3], [23, -1], [-2]]));;
gap> T := ClosureSemigroup(S, DClass(PartitionMonoid(3),
> IdentityBipartition(3)));;
gap> Size(T);
103

# SubsemigroupByProperty 1
gap> func := function(x)
>      local n;
>      n := DegreeOfTransformation(x);
>      return 1 ^ x <> 1 and ForAll([1 .. n], y -> y = 1 or y ^ x = y); 
>    end;;
gap> T := SubsemigroupByProperty(FullTransformationSemigroup(3), func);
<transformation semigroup of size 2, degree 3 with 2 generators>
gap> T := SubsemigroupByProperty(FullTransformationSemigroup(4), func);
<transformation semigroup of size 3, degree 4 with 3 generators>
gap> T := SubsemigroupByProperty(FullTransformationSemigroup(5), func);
<transformation semigroup of size 4, degree 5 with 4 generators>
gap> func := x -> x ^ 2 = x;
function( x ) ... end
gap> T := SubsemigroupByProperty(FreeBand(2), func, 10);
<semigroup of size 6, with 2 generators>

# SubsemigroupByProperty 2
gap> func := function(x)
>      return 1 ^ x > 3
>    end;;
gap> T := SubsemigroupByProperty(FullTransformationSemigroup(3), func);
fail

# InverseSubsemigroupByProperty 1
gap> IsIsometryPP := function(f)
> local n, i, j, k, l;
>  n := RankOfPartialPerm(f);
>  for i in [1 .. n - 1] do
>    k := DomainOfPartialPerm(f)[i];
>    for j in [i + 1 .. n] do
>      l := DomainOfPartialPerm(f)[j];
>      if not AbsInt(k ^ f - l ^ f) = AbsInt(k - l) then
>        return false;
>      fi;
>    od;
>  od;
>  return true;
> end;;
gap> S := InverseSubsemigroupByProperty(SymmetricInverseSemigroup(5),
> IsIsometryPP);;
gap> Size(S);
142

# InverseSubsemigroupByProperty 2
gap> func := function(x)
>      return 1 ^ x > 3
>    end;;
gap> T := InverseSubsemigroupByProperty(SymmetricInverseMonoid(3), func);
fail

# Random (for a semigroup with AsList)
gap> S := FullTransformationMonoid(4);;
gap> AsList(S);;
gap> Random(S);;

# SEMIGROUPS.DefaultRandomInverseSemigroup 1
gap> S := SEMIGROUPS.DefaultRandomInverseSemigroup(IsTransformationSemigroup, 
> [24]);;
gap> IsInverseSemigroup(S) and IsTransformationSemigroup(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseSemigroup(IsTropicalMaxPlusMatrixSemigroup, 
> [2410]);;
gap> IsInverseSemigroup(S) and IsTropicalMaxPlusMatrixSemigroup(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseSemigroup(IsNTPMatrixSemigroup, 
> [2456]);;
gap> IsInverseSemigroup(S) and IsNTPMatrixSemigroup(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseSemigroup(IsNTPMatrixMonoid, 
> [245610]);;
Error, the 2nd argument must have length 23, or 4

# SEMIGROUPS.DefaultRandomInverseMonoid 1
gap> S := SEMIGROUPS.DefaultRandomInverseMonoid(IsTransformationMonoid, 
> [24]);;
gap> IsInverseMonoid(S) and IsTransformationMonoid(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseMonoid(IsTropicalMaxPlusMatrixMonoid, 
> [2410]);;
gap> IsInverseMonoid(S) and IsTropicalMaxPlusMatrixMonoid(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseMonoid(IsNTPMatrixMonoid, 
> [2456]);;
gap> IsInverseMonoid(S) and IsNTPMatrixMonoid(S);
true
gap> S := SEMIGROUPS.DefaultRandomInverseMonoid(IsNTPMatrixMonoid, 
> [245610]);;
Error, the 2nd argument must have length 23, or 4

# RandomSemigroup 1
gap> RandomSemigroup(24);;
gap> RandomSemigroup(IsTransformationSemigroup, 24);;
gap> RandomSemigroup(fail, 24);;
Error, the 1st argument must be a filter
gap> RandomSemigroup(IsTransformationSemigroup);;
gap> RandomSemigroup(IsTropicalMinPlusMatrixSemigroup, 241);;
gap> RandomSemigroup(IsTropicalMinPlusMatrixSemigroup, 24);;
gap> RandomSemigroup(IsNTPMatrixSemigroup, 24);;
gap> RandomSemigroup(IsNTPMatrixSemigroup, 2456);;
gap> RandomSemigroup(IsNTPMatrixSemigroup, 245, "a");;
Error, the 5th argument (semiring period) must be a pos int
gap> RandomSemigroup(IsTransformationSemigroup, "a");;
Error, the 2nd argument (number of generators) must be a pos int
gap> RandomSemigroup(IsReesMatrixSemigroup);;
gap> RandomSemigroup(IsReesMatrixSemigroup, 2);;
gap> RandomSemigroup(IsReesMatrixSemigroup, 23);;
gap> RandomSemigroup(IsReesMatrixSemigroup, 23, SymmetricGroup(3));;
gap> RandomSemigroup(IsReesMatrixSemigroup, 23, SymmetricGroup(3), fail);;
Error, expected at most 3 arguments, found 4
gap> RandomSemigroup(IsReesMatrixSemigroup, 23, DihedralGroup(2));;
Error, the 4th argument must be a permutation group
gap> RandomSemigroup(IsReesMatrixSemigroup, fail, 3, DihedralGroup(2));;
Error, the 2nd argument (number of rows) must be a positive integer

# RandomMonoid 1
gap> RandomMonoid(24);;
gap> RandomMonoid(IsTransformationMonoid, 24);;
gap> RandomMonoid(fail, 24);;
Error, the 1st argument must be a filter
gap> RandomMonoid(IsTransformationMonoid);;
gap> RandomMonoid(IsTropicalMinPlusMatrixMonoid, 241);;
gap> RandomMonoid(IsTropicalMinPlusMatrixMonoid, 24);;
gap> RandomMonoid(IsNTPMatrixMonoid, 24);;
gap> RandomMonoid(IsNTPMatrixMonoid, 2456);;
gap> RandomMonoid(IsNTPMatrixMonoid, 245, "a");;
Error, the 5th argument (semiring period) must be a pos int
gap> RandomMonoid(IsTransformationMonoid, "a");;
Error, the 2nd argument (number of generators) must be a pos int

# RandomInverseSemigroup 1
gap> RandomInverseSemigroup(24);;
gap> RandomInverseSemigroup(IsTransformationSemigroup, 24);;
gap> RandomInverseSemigroup(fail, 24);;
Error, the 1st argument must be a filter
gap> RandomInverseSemigroup(IsTransformationSemigroup);;
gap> RandomInverseSemigroup(IsTropicalMinPlusMatrixSemigroup, 241);;
gap> RandomInverseSemigroup(IsTropicalMinPlusMatrixSemigroup, 24);;
gap> RandomInverseSemigroup(IsNTPMatrixSemigroup, 24);;
gap> RandomInverseSemigroup(IsNTPMatrixSemigroup, 2456);;
gap> RandomInverseSemigroup(IsNTPMatrixSemigroup, 245, "a");;
Error, the 5th argument (semiring period) must be a pos int
gap> RandomInverseSemigroup(IsTransformationSemigroup, "a");;
Error, the 2nd argument (number of generators) must be a pos int

# RandomInverseMonoid 1
gap> RandomInverseMonoid(24);;
gap> RandomInverseMonoid(IsTransformationMonoid, 24);;
gap> RandomInverseMonoid(fail, 24);;
Error, the 1st argument must be a filter
gap> RandomInverseMonoid(IsTransformationMonoid);;
gap> RandomInverseMonoid(IsTropicalMinPlusMatrixMonoid, 241);;
gap> RandomInverseMonoid(IsTropicalMinPlusMatrixMonoid, 24);;
gap> RandomInverseMonoid(IsNTPMatrixMonoid, 24);;
gap> RandomInverseMonoid(IsNTPMatrixMonoid, 2456);;
gap> RandomInverseMonoid(IsNTPMatrixMonoid, 245, "a");;
Error, the 5th argument (semiring period) must be a pos int
gap> RandomInverseMonoid(IsTransformationMonoid, "a");;
Error, the 2nd argument (number of generators) must be a pos int

# AsSemigroup 1
gap> S := Monoid(Transformation([3424]), Transformation([2414]),
>                Transformation([4314]), Transformation([3144]));
<transformation monoid of degree 4 with 4 generators>
gap> T := AsSemigroup(IsTransformationSemigroup, S);
<transformation monoid of degree 4 with 4 generators>
gap> IsIdenticalObj(S, T);
true

# AsSemigroup 2
gap> S := Semigroup(
> [Transformation([712871823112121118781217,
>       223532225274542276211112193553222,
>       32181919182445642274223242423535645,
>      1]), Transformation([81178192412111122787,
>       211732522323542627424512121118535,
>      223222191818192364527422724232324355,
>      4562]), Transformation([9131592025283013283,
>       15915330173336383340434648435030328,
>      135236403833382052522054465048434825,
>       545425403650463]),
>   Transformation([1014161021262931142941610164,
>       31173437393441444749445131429145337,
>       413934392153532155475149444926555526,
>       413751474]), Transformation([121725678178,
>      11121711177171819171922232417242717,
>       12171321732351751722173542174245176,
>      17271745171817235]),
>   Transformation([11817172227112171772171717,
>       1717532171718642171723171717173517,
>       171917171717171745171724171717171717,
>       171717176])]);
<transformation semigroup of degree 56 with 6 generators>
gap> AsSemigroup(IsReesZeroMatrixSemigroup, S);;

# AsMonoid 1
gap> S := Monoid(Transformation([3424]), Transformation([2414]),
>                Transformation([4314]), Transformation([3144]));
<transformation monoid of degree 4 with 4 generators>
gap> T := AsMonoid(IsTransformationMonoid, S);
<transformation monoid of degree 4 with 4 generators>
gap> IsIdenticalObj(S, T);
true
gap> T := AsMonoid(IsPartialPermMonoid, S);;
gap> T := AsMonoid(IsFpMonoid, S);
<fp monoid with 4 generators and 45 relations of length 234>
gap> T := AsMonoid(IsBooleanMatMonoid, S);;

# ClosureSemigroup
gap> S := FullTransformationMonoid(5);;
gap> T := Semigroup(One(S));
<trivial transformation group of degree 0 with 1 generator>
gap> U := ClosureSemigroup(T, AsSet(S));;
gap> Length(GeneratorsOfSemigroup(U)) <= 20;
true
gap> T;
<trivial transformation group of degree 0 with 1 generator>
gap> gens :=
> [Matrix(GF(5 ^ 2), [[Z(5 ^ 2), Z(5 ^ 2) ^ 13],
>                     [0 * Z(5), Z(5 ^ 2) ^ 14]]),
>  Matrix(GF(5 ^ 2), [[Z(5 ^ 2) ^ 21, Z(5) ^ 0],
>                     [Z(5) ^ 00 * Z(5)]]),
>  Matrix(GF(5 ^ 2), [[Z(5 ^ 2) ^ 23, Z(5 ^ 2) ^ 5],
>                     [Z(5 ^ 2) ^ 20, Z(5 ^ 2) ^ 20]])];;
gap> S := Semigroup(gens[1], rec(acting := true));
<commutative semigroup of 2x2 matrices over GF(5^2) with 1 generator>
gap> Size(S);
24
gap> S := ClosureSemigroup(S, gens[2]);
<semigroup of 2x2 matrices over GF(5^2) with 2 generators>
gap> Size(S);
124800
gap> S := ClosureSemigroup(S, gens[3]);
<semigroup of 2x2 matrices over GF(5^2) with 3 generators>
gap> Size(S);
374400

# IsGeneratorsOfInverseSemigroup
gap> S := Semigroup(SymmetricInverseMonoid(3), rec(acting := true));;
gap> IsGeneratorsOfInverseSemigroup(S);
true
gap> S := Semigroup(Transformation([11]));;
gap> IsGeneratorsOfInverseSemigroup(S);
false

# ClosureMonoid
gap> S := Semigroup(PartialPerm([1]));;
gap> T := ClosureMonoid(S, [PartialPerm([2 .. 5])]);
<partial perm monoid of rank 5 with 2 generators>
gap> One(T);
<identity partial perm on [ 12345 ]>
gap> T := ClosureSemigroup(S, [PartialPerm([2 .. 5])]);
<partial perm semigroup of rank 4 with 2 generators>
gap> One(T);
fail
gap> T := ClosureMonoid(SymmetricInverseMonoid(3), PartialPerm([1 .. 4]));
<partial perm monoid of rank 4 with 6 generators>
gap> T := ClosureMonoid(SymmetricInverseMonoid(3), PartialPerm([1 .. 4]),
> rec());
<partial perm monoid of rank 4 with 6 generators>
gap> Size(T);
35
gap> One(T);
<identity partial perm on [ 1234 ]>
gap> M := ClosureMonoid(SymmetricInverseMonoid(2), SymmetricInverseMonoid(3));;
gap> Size(M);
34
gap> M = SymmetricInverseMonoid(3);
true
gap> M := ClosureMonoid(POPI(3), DClass(M, PartialPerm([1 .. 3])));
<partial perm monoid of rank 3 with 4 generators>
gap> Size(M);
34
gap> M = SymmetricInverseMonoid(3);
true
gap> M := ClosureMonoid(OrderEndomorphisms(3),
>                       DClass(M, PartialPerm([1 .. 3])));
Error, the 1st argument (a monoid) and the 2nd argument (a mult. elt. with one\
 coll.) cannot be used to generate a monoid

# IsTrivial immediate method for monoids
gap> S := Monoid(PartialPerm([1]));
<trivial partial perm group of rank 1 with 1 generator>
gap> S := Monoid(IdentityTransformation);
<trivial transformation group of degree 0 with 1 generator>

# InverseSemigroupByGenerators, CanUseFroidurePin semigroup
gap> S := InverseSemigroup(PartialPerm([213]), rec(acting := false));;
gap> S := InverseMonoid(PartialPerm([213]), rec(acting := false));;

# ClosureSemigroup for an empty list
gap> S := Semigroup(Transformation([11]));;
gap> ClosureSemigroup(S, [], rec()) = S;
true
gap> IsIdenticalObj(ClosureSemigroup(S, [], rec()), S);
true
gap> S := Semigroup(Transformation([11]));;
gap> ClosureSemigroupOrMonoidNC(Semigroup, S, [], rec()) = S;
true
gap> IsIdenticalObj(ClosureSemigroupOrMonoidNC(Semigroup, S, [], rec()), S);
true
gap> S := FreeBand(2);
<free band on the generators [ x1, x2 ]>
gap> ClosureSemigroupOrMonoidNC(Semigroup, S, [S.1], rec());
<free band on the generators [ x1, x2 ]>
gap> S := ReesZeroMatrixSemigroup(SymmetricGroup([1 .. 3]),
> [[(), ()], [(12), ()], [(123), ()]]);
<Rees 0-matrix semigroup 2x3 over Sym( [ 1 .. 3 ] )>
gap> GeneratorsOfSemigroup(S);
[ (1,(1,2,3),1), (1,(1,2),1), (1,(),2), (1,(),3), (2,(),1), 0 ]
gap> T := Semigroup(S.1, S.2, rec(acting := false));
<subsemigroup of 2x3 Rees 0-matrix semigroup with 2 generators>
gap> ClosureSemigroupOrMonoidNC(Semigroup, T, [S.1, S.4, S.3], rec());
<subsemigroup of 2x3 Rees 0-matrix semigroup with 4 generators>

# ClosureInverseMonoid
gap> ClosureInverseMonoid(SymmetricInverseMonoid(3), PartialPerm([4 .. 6])) 
> = InverseMonoid(PartialPerm([123], [231]),
>                 PartialPerm([123], [213]), 
>                 PartialPerm([23], [12]),
>                 PartialPerm([123], [123]),
>                 PartialPerm([123], [456]));
true
gap> ClosureInverseMonoid(SymmetricInverseMonoid(3), PartialPerm([4 .. 6]),
> rec())
> = InverseMonoid(PartialPerm([123], [231]),
>                 PartialPerm([123], [213]), 
>                 PartialPerm([23], [12]),
>                 PartialPerm([123], [123]),
>                 PartialPerm([123], [456]));
true
gap> ClosureInverseMonoid(DualSymmetricInverseMonoid(3),
> Bipartition([[12, -2], [3, -1], [-3]]));
Error, the 2nd argument (a finite mult. elt. coll.) must satisfy IsGeneratorsO\
fInverseSemigroup
gap> ClosureInverseMonoid(DualSymmetricInverseMonoid(3),
> DualSymmetricInverseMonoid(4));
Error, the 1st argument (a semigroup) and the 2nd argument (a mult. elt. coll.\
) cannot be used to generate an inverse monoid
gap> ClosureInverseMonoid(DualSymmetricInverseMonoid(3),
> DClass(DualSymmetricInverseMonoid(3), IdentityBipartition(3)));
<inverse block bijection monoid of degree 3 with 3 generators>
gap> S := InverseMonoid(DualSymmetricInverseMonoid(3), rec(acting := false));
<inverse block bijection monoid of degree 3 with 3 generators>
gap> Size(ClosureInverseMonoid(S, DClass(S, IdentityBipartition(3))));
25

# ClosureInverseMonoid for an empty list
gap> S := InverseMonoid(PartialPerm([1]));;
gap> ClosureInverseMonoid(S, [], rec()) = S;
true
gap> IsIdenticalObj(ClosureInverseMonoid(S, [], rec()), S);
true
gap> S := InverseMonoid(PartialPerm([1]));;
gap> ClosureInverseSemigroupOrMonoidNC(InverseMonoid, S, [], rec()) = S;
true
gap> IsIdenticalObj(S,
> ClosureInverseSemigroupOrMonoidNC(InverseMonoid, S, [], rec()));
true
gap> S := GraphInverseSemigroup(Digraph([[2], [], [2]]));
<finite graph inverse semigroup with 3 vertices, 2 edges>
gap> T := InverseSemigroup(S.1, S.2);
<inverse semigroup with 2 generators>
gap> ClosureInverseSemigroupOrMonoidNC(InverseSemigroup, T, [S.2, S.3, S.4], rec());
<inverse semigroup with 3 generators>
gap> G := SymmetricGroup([2 .. 5]);;
gap> x := Digraph([[1], [12], [13], [14], [15]]);;
gap> M := McAlisterTripleSemigroup(G, x, [12]);;
gap> T := InverseSemigroup(M.4, M.5, rec(acting := false));
<McAlister triple subsemigroup over Sym( [ 2 .. 5 ] )>
gap> ClosureInverseSemigroupOrMonoidNC(InverseMonoid, T, [M.2, M.1], rec());
<McAlister triple subsemigroup over Sym( [ 2 .. 5 ] )>

# RandomSemigroup
gap> RandomSemigroup(IsTropicalMaxPlusMatrixSemigroup, 33, "a");
Error, the 4th argument (semiring threshold) must be a pos int
gap> RandomSemigroup(IsSemigroup, 33, "a");
Error, there must be at most 3 arguments
gap> RandomSemigroup(IsSemigroup, 3, "a");
Error, the 3rd argument (degree or dimension) must be a pos int

# AsSemigroup for a filter, ring, and semigroup
gap> S := FullTransformationMonoid(3);;
gap> AsSemigroup(IsMatrixOverFiniteFieldSemigroup, GF(3), S);
<monoid of 3x3 matrices over GF(3) with 3 generators>
gap> AsMonoid(IsMatrixOverFiniteFieldMonoid, GF(3), S);
<monoid of 3x3 matrices over GF(3) with 3 generators>

# MinimalFactorization for too large monoids
gap> S := FullTransformationMonoid(10);;
gap> MinimalFactorization(S, S.3 * S.2);
43 ]

# \<
gap> S := FreeBand(2);
<free band on the generators [ x1, x2 ]>
gap> T := Semigroup(S.1, S.2);
<semigroup with 2 generators>
gap> S < T;
false
gap> T := Semigroup(S.2);
<commutative semigroup with 1 generator>
gap> T < S;
false
gap> S < T;
true
gap> T := Semigroup(S.1);
<commutative semigroup with 1 generator>
gap> T < S;
true
gap> S < T;
false
gap> S := GraphInverseSemigroup(CycleDigraph(2));
<infinite graph inverse semigroup with 2 vertices, 2 edges>
gap> S < S;
false

# Issue 565 - no ClosureSemigroup method for non-libsemigroups types
gap> S := FreeBand(3);
<free band on the generators [ x1, x2, x3 ]>
gap> Size(GeneratorsOfSemigroup(Semigroup(AsList(S), rec(small := true)))) < Size(S);
true

#
gap> SEMIGROUPS.StopTest();
gap> STOP_TEST("Semigroups package: standard/semigroups/semigrp.tst");

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