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

Quellverzeichnis  testall.tst   Sprache: unbekannt

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

#############################################################################
##
#A  testall.tst        NumericalSgps package                   Manuel Delgado
##                                                    Pedro A. Garcia-Sanchez
##  (based on the cooresponding file of the 'example' package,
##   by Alexander Konovalov)
##
##  To create a test file, place GAP prompts, input and output exactly as
##  they must appear in the GAP session. Do not remove lines containing
##  START_TEST and STOP_TEST statements.
##
##  The first line starts the test. START_TEST reinitializes the caches and
##  the global random number generator, in order to be independent of the
##  reading order of several test files. Furthermore, the assertion level
##  is set to 2 by START_TEST and set back to the previous value in the
##  subsequent STOP_TEST call.
##
##  The argument of STOP_TEST may be an arbitrary identifier string.
##
gap> START_TEST("NumericalSgps package: testall.tst");

## Set info level to 0 as suggested by Alexander Konovalov

gap> INFO_NSGPS:=InfoLevel(InfoNumSgps);;
gap> SetInfoLevel( InfoNumSgps, 0);

# Note that you may use comments in the test file
# and also separate parts of the test by empty lines

# First load the package without banner (the banner must be suppressed to
# avoid reporting discrepancies in the case when the package is already
# loaded)
gap> LoadPackage("numericalsgps",false);
true

# Check that the data are consistent
gap> ns := NumericalSemigroup([10..30]);
<Numerical semigroup with 10 generators>
gap> IsNumericalSemigroup(ns);
true
gap> MinimalGeneratingSystemOfNumericalSemigroup(ns);
10 .. 19 ]
gap> GapsOfNumericalSemigroup(ns);
123456789 ]

gap> AffineSemigroup([2,3]) = AffineSemigroup([[2,3]]);
true

#############################################################################
# Some more elaborated tests

gap> ls1 := NumericalSemigroupsWithFrobeniusNumberFG(7);
[ <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>, 
  <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>, 
  <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>, 
  <Numerical semigroup>, <Numerical semigroup> ]
gap> ls2 := NumericalSemigroupsWithFrobeniusNumber(7);;
gap> ge1 := List(ls1, s -> MinimalGeneratingSystemOfNumericalSemigroup(s));
[ [ 35 ], [ 4511 ], [ 456 ], [ 5689 ], [ 29 ], 
  [ 3810 ], [ 5891112 ], [ 491011 ], [ 46911 ], 
  [ 689101113 ], [ 8 .. 15 ] ]
gap> ge2 := List(ls2, s -> MinimalGeneratingSystemOfNumericalSemigroup(s));
[ [ 29 ], [ 35 ], [ 3810 ], [ 456 ], [ 4511 ], 
  [ 46911 ], [ 491011 ], [ 5689 ], [ 5891112 ], 
  [ 689101113 ], [ 8 .. 15 ] ]
gap> Set(ge1)=Set(ge2);
true

gap> NumericalSemigroupsWithGenus(5);
[ <Numerical semigroup with 6 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 2 generators> ]
gap> List(last, s -> MinimalGeneratingSystemOfNumericalSemigroup(s));
[ [ 6 .. 11 ], [ 578911 ], [ 5689 ], [ 5679 ],
  [ 5678 ], [ 467 ], [ 47910 ], [ 46911 ],
  [ 4511 ], [ 3810 ], [ 3711 ], [ 211 ] ]

gap> ns := NumericalSemigroup([10..30]);
<Numerical semigroup with 10 generators>
gap> IsNumericalSemigroup(ns);
true
gap> MinimalGeneratingSystemOfNumericalSemigroup(ns);
10 .. 19 ]
gap> GapsOfNumericalSemigroup(ns);
123456789 ]
gap> genus8 := NumericalSemigroupsWithGenus(8);;
gap> List(genus8, s -> Length(GapsOfNumericalSemigroup(s)));
8888888888888888888888888,
  8888888888888888888888888,
  88888888888888888 ]
gap> List(genus8, s -> IsIrreducibleNumericalSemigroup(s));
[ false, false, false, false, false, false, true, true, true, false, false,
  false, false, false, false, false, false, false, false, false, false,
  false, false, false, false, true, false, false, false, false, true, false,
  false, false, false, false, true, false, false, false, false, false, false,
  false, false, false, false, false, true, false, false, false, false, true,
  false, false, false, false, true, false, true, false, true, false, false,
  true, true ]
gap> List(genus8, s -> WilfNumber(s)+EliahouNumber(s));
012152435486380648151828401012213212,
  21322132322940410182948518206203256,
  6641320200620268685126182612616,
  161670100 ]

gap> a := AffineSemigroupByGenerators([5,3,1],[2,7,4],[3,1,5]);
<Affine semigroup in 3 dimensional space, with 3 generators>
gap> MinimalPresentationOfAffineSemigroup(a);
[  ]
gap> BettiElementsOfAffineSemigroup(a);
[  ]

gap> pf := [ 83169173214259 ];;
gap> ns := ANumericalSemigroupWithPseudoFrobeniusNumbers(pf);;
gap> PseudoFrobeniusOfNumericalSemigroup(ns) = pf;
true

gap> s:=NumericalSemigroup(4,5,7);;
gap> Set(MinimalPresentation(s),p->Set(p));
[ [ [ 002 ], [ 120 ] ], [ [ 011 ], [ 300 ] ],
  [ [ 030 ], [ 201 ] ] ]
gap> a:=AsAffineSemigroup(s);;
gap> Set(MinimalPresentation(a),p->Set(p));
[ [ [ 002 ], [ 120 ] ], [ [ 011 ], [ 300 ] ],
  [ [ 030 ], [ 201 ] ] ]
gap> CatenaryDegreeOfAffineSemigroup(a)=CatenaryDegreeOfNumericalSemigroup(s);
true

gap> n := 12;; ns := RandomNumericalSemigroupWithGenus(n);;
gap> Genus(ns) = n;
true

gap> n := 10;;RandomAffineSemigroupWithGenusAndDimension(n,3);;
gap> Length(Gaps(last)) = n;
true

#############################################################################
## tests aiming to improve code coverage

##some tests involving random functions
#
gap> RandomNumericalSemigroup(3,9);;
gap> IsNumericalSemigroup(last);
true
gap> ns := RandomNumericalSemigroup(3,9,55);;
gap> EmbeddingDimension(ns) > 3;
false
gap> Multiplicity(ns) >= 9;
true
gap> l := RandomListForNS(13,1,79);;
gap> Gcd(l);
1
gap> RandomModularNumericalSemigroup(9);;
gap> RandomModularNumericalSemigroup(10,25);;
gap> IsModularNumericalSemigroup(last);IsModularNumericalSemigroup(last2);
true
true
gap> pm1 := RandomProportionallyModularNumericalSemigroup(9);;
gap> pm2 := RandomProportionallyModularNumericalSemigroup(10,25);;
gap> IsProportionallyModularNumericalSemigroup(pm1);IsProportionallyModularNumericalSemigroup(pm2);
true
true
gap> RandomListRepresentingSubAdditiveFunction(7,9);;
gap> RepresentsPeriodicSubAdditiveFunction(last);
true
gap> ns := NumericalSemigroupWithRandomElementsAndFrobenius(5,10,50);;
gap> ns2 := NumericalSemigroupWithRandomElementsAndFrobenius(5,10,9); 
#I  The third argument must not be smaller than the second
fail
gap> FrobeniusNumber(ns) > 50;
false
gap> RandomNumericalSemigroupWithGenus(7);;
gap> Genus(last);
7

gap> RandomAffineSemigroupWithGenusAndDimension(10,3);;
gap> Genus(last);
10
gap> Dimension(last2);
3
gap> RandomAffineSemigroup(5,5);;
gap> RandomAffineSemigroup(5,5,3);;
gap> IsAffineSemigroup(last);IsAffineSemigroup(last2);
true
true

#gap> a := RandomFullAffineSemigroup(5,5,3);;
#gap> IsAffineSemigroup(a);IsFullAffineSemigroup(a);
#true
#true

gap> s:=RandomGoodSemigroupWithFixedMultiplicity([6,7],[30,30]);
<Good semigroup>
gap> Conductor(s) <= [30,30];
true
gap> Multiplicity(s)=[6,7];
true

##
gap> ns := NumericalSemigroup(3,5,7);;
gap> Display(ns);
[ [ 0 ], [ 3 ], [ 5, "->" ] ]
gap> ns := NumericalSemigroup(3,5,7);;
gap> IsProportionallyModularNumericalSemigroup(ns);
true
gap> ns := NumericalSemigroup(3,5,7);;
gap> IsModularNumericalSemigroup(ns);
true
gap> ns := NumericalSemigroup(7,11,19,20);;
gap> IsModularNumericalSemigroup(ns);
false
gap> ns := NumericalSemigroup(7,11,19,20);;
gap> IsProportionallyModularNumericalSemigroup(ns);
false

##
gap> ForcedIntegersForPseudoFrobenius_QV(5,8);
fail
gap> ForcedIntegersForPseudoFrobenius_QV(5,9);
fail
gap> ForcedIntegersForPseudoFrobenius_QV(7,9);
[ [ 123479 ], [ 056810 ] ]
gap> ForcedIntegersForPseudoFrobenius_QV([9]);
[ [ 139 ], [ 010 ] ]
gap> ForcedIntegersForPseudoFrobenius_QV(9);
[ [ 139 ], [ 010 ] ]
gap> ForcedIntegersForPseudoFrobenius(9);
[ [ 139 ], [ 010 ] ]
gap> ForcedIntegersForPseudoFrobenius(8);
[  ]
gap> NumericalSemigroupsWithPseudoFrobeniusNumbers(8);
[  ]
gap> record := rec(pseudo_frobenius := [ 166182269279295 ],
> max_attempts := 25);
rec( max_attempts := 25, pseudo_frobenius := [ 166182269279295 ] )
gap> ANumericalSemigroupWithPseudoFrobeniusNumbers(record);
<Numerical semigroup>

##
# Generators
gap> a:=AffineSemigroup([2,0],[0,2],[1,1],[3,1]);
<Affine semigroup in 2 dimensional space, with 4 generators>
gap> Print(a);
AffineSemigroup( [ [ 02 ], [ 11 ], [ 20 ], [ 31 ] ] )
gap> Generators(a);
[ [ 02 ], [ 11 ], [ 20 ], [ 31 ] ]
gap> MinimalGenerators(a);
[ [ 02 ], [ 11 ], [ 20 ] ]
gap> MinimalGenerators(a);
[ [ 02 ], [ 11 ], [ 20 ] ]
gap> a:=AffineSemigroupByEquations([[1,-1]],[]);
<Affine semigroup>
gap> Print(a);
AffineSemigroupByEquations( [ [ [ 1, -1 ] ], [  ] ] )
gap> Generators(a);
[ [ 11 ] ]

# HasPMInequality
gap> a:=AffineSemigroupByPMInequality([1,1],2,[-1,-1]);
<Affine semigroup>
gap> Generators(a);
[  ]
gap> a:=AffineSemigroupByPMInequality([3,1],5,[1,2]);
<Affine semigroup>
gap> [ 31 ] in a;
true
gap> [ 11 ] in a;
false
gap> Gaps(a);
[ [ 10 ], [ 30 ], [ 11 ] ]

# MinimalGenerators
gap> a:=AffineSemigroupByEquations([[1,-1]],[]);
<Affine semigroup>
gap> Display(a);
<Affine semigroup>
gap> ViewString(a);
"Affine semigroup"
gap> [1,1] in a;
true
gap> [0,2] in a;
false
gap> MinimalGenerators(a);
[ [ 11 ] ]
gap> a:=AffineSemigroupByInequalities([[2,-1],[-1,3]]);
<Affine semigroup>
gap> Print(a);
AffineSemigroupByInequalities( [ [ -13 ], [ 2, -1 ] ] )
gap> ViewString(a);
"Affine semigroup"
gap> Display(a);
<Affine semigroup>
gap> [1,1] in a;
true
gap> [0,20] in a;
false
gap> MinimalGenerators(a);
[ [ 11 ], [ 12 ], [ 21 ], [ 31 ] ]

# Gaps
gap> a:=AffineSemigroup("pminequality",[[3,1],5,[1,2]]);
<Affine semigroup>
gap> Gaps(a);
[ [ 10 ], [ 30 ], [ 11 ] ]
gap> Gaps(a);
[ [ 10 ], [ 30 ], [ 11 ] ]
gap> IsFullAffineSemigroup(a);
false

# factorizations

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> MinimalGenerators(a);
[ [ 02 ], [ 11 ], [ 20 ] ]
gap> Factorizations([10,10],a);
[ [ 0100 ], [ 181 ], [ 262 ], [ 343 ], [ 424 ], 
  [ 505 ] ]
gap> Factorizations(a,[10,10]);
[ [ 0100 ], [ 181 ], [ 262 ], [ 343 ], [ 424 ], 
  [ 505 ] ]
gap> s:=NumericalSemigroup(3,5);
<Numerical semigroup with 2 generators>
gap> DegreesOfMonotonePrimitiveElementsOfNumericalSemigroup(s);
3515 ]
gap> MonotoneCatenaryDegreeOfNumericalSemigroup(s);
5

# presentations

gap> IsUniquelyPresented(a);
true
gap> IsGeneric(a);
true
gap> ShadedSetOfElementInAffineSemigroup([3,1],a);
[ [  ], [ [ 11 ] ], [ [ 11 ], [ 20 ] ], [ [ 20 ] ] ]
gap> MinimalGenerators(LawrenceLiftingOfAffineSemigroup(a));
[ [ 00001 ], [ 00010 ], [ 00100 ], [ 02100 ], [ 11010 ],
  [ 20001 ] ]

# Arf
gap> a:=ArfNumericalSemigroupClosure(3,4);
<Numerical semigroup>
gap> a:=ArfNumericalSemigroupClosure([3,4]);
<Numerical semigroup>
gap> ArfNumericalSemigroupsWithFrobeniusNumber(-1);
[ <The numerical semigroup N> ]
gap> ArfNumericalSemigroupsWithGenusUpTo(0);
[ <The numerical semigroup N> ]
gap> ArfNumericalSemigroupsWithFrobeniusNumberUpTo(-1);
[ <The numerical semigroup N> ]
gap> ArfNumericalSemigroupsWithGenusAndFrobeniusNumber(0,-1);
[ <The numerical semigroup N> ]
gap> ArfNumericalSemigroupsWithGenusAndFrobeniusNumber(2,1);
[  ]
gap> s:=NumericalSemigroup(10,24,25,26,27,28,29,31,32,33);;
gap> ArfSpecialGaps(s);
152223 ]
gap> s:=NumericalSemigroup(6,9,11,13,14,16);;
gap> List(ArfOverSemigroups(s),MinimalGenerators);
[ [ 1 ], [ 23 ], [ 25 ], [ 27 ], [ 29 ], [ 3 .. 5 ], [ 357 ], [ 378 ], [ 3810 ], [ 31011 ],
  [ 31113 ], [ 4 .. 7 ], [ 4679 ], [ 46911 ], [ 5 .. 9 ], [ 6 .. 11 ], [ 689101113 ],
  [ 6910111314 ], [ 6911131416 ] ]
gap> s:=NumericalSemigroup(6,9,11,13,14,16);;
gap> List(DecomposeIntoArfIrreducibles(s),MinimalGenerators);
[ [ 29 ], [ 31113 ] ]
gap> s:=NumericalSemigroupBySmallElements([0,10,17,20]);;
gap> IsArfIrreducible(s);
true
gap> IsIrreducible(s);
false

# MED

gap> MEDNumericalSemigroupClosure(3,4);
<Numerical semigroup>
gap> s:=NumericalSemigroup(2,5);;
gap> MinimalMEDGeneratingSystemOfMEDNumericalSemigroup(s);
25 ]

# Saturated

gap> s:=NumericalSemigroup(2,3);
<Numerical semigroup with 2 generators>
gap> HasMinimalGenerators(s);
true
gap> SaturatedNumericalSemigroupClosure(s);
<Numerical semigroup>
gap> SaturatedNumericalSemigroupClosure(3,7);
<Numerical semigroup>
gap> SaturatedNumericalSemigroupsWithFrobeniusNumber(-1);
[ <The numerical semigroup N> ]
gap> Length(SaturatedNumericalSemigroupsWithFrobeniusNumber(41));
378

# dot

gap> s:=NumericalSemigroup(4,6,9);
<Numerical semigroup with 3 generators>
gap> IsString(DotTreeOfGluingsOfNumericalSemigroup(s));
true
gap> IsString(DotOverSemigroups(s));
true
gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);
<Affine semigroup in 2 dimensional space, with 3 generators>
gap> DotRosalesGraph([3,3],a);
"graph  NSGraph{\n1 [label=\"[ 02 ]\"];\n2 [label=\"[ 11 ]\"];\n3 [label=\"[ 20 ]\"];\n2 -- 1;\
\n3 -- 1;\n3 -- 2;\n}"


# polynomials

gap> x:=Indeterminate(Rationals,"x");;
gap> IsNumericalSemigroupPolynomial(2*x+1);
false
gap> IsNumericalSemigroupPolynomial(x+1/2);
false
gap> IsNumericalSemigroupPolynomial(x+1);
false
gap> s:=NumericalSemigroup(3,5,7);
<Numerical semigroup with 3 generators>
gap> HilbertSeriesOfNumericalSemigroup(s,x);
(x^5-x^4+x^3-x+1)/(-x+1)
gap> HasAperyList(s);
false
gap> AperyList(s);
075 ]
gap> HilbertSeriesOfNumericalSemigroup(s,x);
(x^5-x^4+x^3-x+1)/(-x+1)
gap> IsCyclotomicPolynomial(CyclotomicPolynomial(Rationals,4));
true
gap> IsCyclotomicPolynomial(2*x+1);
false
gap> IsCyclotomicPolynomial((x-1)*(x+1));
false
gap> IsKroneckerPolynomial(0*x);
false
gap> IsKroneckerPolynomial(0*x);
false
gap> IsKroneckerPolynomial(x^2+x);
true
gap> IsKroneckerPolynomial(x+1);
true
gap> IsKroneckerPolynomial(x-1);
true
gap> IsKroneckerPolynomial(0*x+1);
true
gap> IsKroneckerPolynomial(x^2+1);
true
gap> s:=NumericalSemigroup(6,9,20);
<Numerical semigroup with 3 generators>
gap> IsCyclotomicNumericalSemigroup(s);
true
gap> x:=Indeterminate(Rationals,1);; 
gap> y:=Indeterminate(Rationals,2);; 
gap> f:=((y^3-x^2)^2-x*y^2)^4-(y^3-x^2);;
gap> SemigroupOfValuesOfPlaneCurveWithSinglePlaceAtInfinity(f);
<Numerical semigroup with 4 generators>
gap> IsDeltaSequence([2,4]);
false
gap> IsDeltaSequence([1,2]);
false
gap> DeltaSequencesWithFrobeniusNumber(2);
[  ]
gap> DeltaSequencesWithFrobeniusNumber(-1);
[ [ 1 ] ]
gap> x:=Indeterminate(Rationals,1);; SetName(x,"x");
gap> y:=Indeterminate(Rationals,2);; SetName(y,"y");
gap> CurveAssociatedToDeltaSequence([3,2]);
y^3-x^2
gap> s:=LegendrianGenericNumericalSemigroup(5,11);;
gap> SmallElements(s);
0561011121315 ]

# good semigroups

gap> g:=GoodSemigroup([[2,2]],[3,3]);;
gap> Conductor(g);
33 ]
gap> [1,1] in g;
false
gap> Display(g);
<Good semigroup>
gap> ViewString(g);
"Good semigroup"
gap> g:=GoodSemigroupBySmallElements([[0,0],[2,2],[3,3]]);;
gap> Conductor(g);
33 ]
gap> [1,1] in g;
false
gap> SmallElements(g);
[ [ 00 ], [ 22 ], [ 33 ] ]
gap> s:=NumericalSemigroup(3,4);;
gap> g:=CartesianProductOfNumericalSemigroups(s,s);;
gap> Conductor(g);
66 ]
gap> [2,2] in g;
false
gap> [3,4] in g;
true
gap> SmallElements(g);
[ [ 00 ], [ 03 ], [ 04 ], [ 06 ], [ 30 ], [ 33 ], [ 34 ],
  [ 36 ], [ 40 ], [ 43 ], [ 44 ], [ 46 ], [ 60 ], [ 63 ],
  [ 64 ], [ 66 ] ]

#############################################################################
#############################################################################
# Examples from the manual
# (These examples use at least a funtion from each file)

#Generating_Numerical_Semigroups.xml
gap> s1 := NumericalSemigroup(3,5,7);               
<Numerical semigroup with 3 generators>
gap> s2 := NumericalSemigroup([3,5,7]);
<Numerical semigroup with 3 generators>
gap> s3 := NumericalSemigroupByGenerators(3,5,7);             
<Numerical semigroup with 3 generators>
gap> s4 := NumericalSemigroupByGenerators([3,5,7]);
<Numerical semigroup with 3 generators>
gap> s5 := NumericalSemigroup("generators",3,5,7); 
<Numerical semigroup with 3 generators>
gap> s6 := NumericalSemigroup("generators",[3,5,7]);
<Numerical semigroup with 3 generators>
gap> s1=s2;s2=s3;s3=s4;s4=s5;s5=s6;
true
true
true
true
true

gap> s := NumericalSemigroupBySubAdditiveFunction([5,4,2,0]);
<Numerical semigroup>
gap> t := NumericalSemigroup("subadditive",[5,4,2,0]);;
gap> s=t;
true

gap> s:=NumericalSemigroup(3,11);;
gap> ap := AperyListOfNumericalSemigroupWRTElement(s,20);
021223242562728930111233141536171839 ]
gap> t:=NumericalSemigroupByAperyList(ap);;
gap> r := NumericalSemigroup("apery",ap);;
gap> s=t;t=r;
true
true

gap> s:=NumericalSemigroup(3,11);;
gap> se := SmallElements(s);
036911121415171820 ]
gap> t := NumericalSemigroupBySmallElements(se);;
gap> r := NumericalSemigroup("elements",se);;
gap> s=t;t=r;
true
true

# gap> e := [ 0369111415171820 ];
# [ 0369111415171820 ]
# gap> NumericalSemigroupBySmallElements(e);
# Error, The argument does not represent a numerical semigroup called from
# <function "NumericalSemigroupBySmallElements">( <arguments> )
#  called from read-eval loop at line 35 of *stdin*
# you can 'quit;' to quit to outer loop, or
# you can 'return;' to continue
# brk>

gap> g := [ 124578101316 ];;
gap> s := NumericalSemigroupByGaps(g);;
gap> t := NumericalSemigroup("gaps",g);;
gap> s=t;
true

gap> s:=FiniteComplementIdealExtension([0,2],[1,1],[3,0]);;
gap> MinimalGenerators(s);
[ [ 03 ], [ 11 ], [ 02 ], [ 30 ], [ 21 ], [ 12 ], [ 31 ], [ 50 ], [ 40 ] ]

# gap> h := [ 12578101316 ];;
# gap> NumericalSemigroupByGaps(h);
# Error, The argument does not represent the gaps of a numerical semigroup called
#  from
# <function "NumericalSemigroupByGaps">( <arguments> )
#  called from read-eval loop at line 34 of *stdin*
# you can 'quit;' to quit to outer loop, or
# you can 'return;' to continue
# brk>

gap> fg := [ 111417202326293235 ];;
gap> NumericalSemigroupByFundamentalGaps(fg);
<Numerical semigroup>
gap> NumericalSemigroup("fundamentalgaps",fg);
<Numerical semigroup>
gap> last=last2;
true
gap> gg := [ 111720222326293235 ];; #22 is not fundamental
gap> NumericalSemigroup("fundamentalgaps",fg);
<Numerical semigroup>

gap> s:=NumericalSemigroupByAffineMap(3,1,3);
<Numerical semigroup with 3 generators>
gap> SmallElements(s);
0369101213151618 ]
gap> t:=NumericalSemigroup("affinemap",3,1,3);;
gap> s=t;
true

gap> ModularNumericalSemigroup(3,7);
<Modular numerical semigroup satisfying 3x mod 7 <= x >
gap> NumericalSemigroup("modular",3,7);
<Modular numerical semigroup satisfying 3x mod 7 <= x >

gap> ProportionallyModularNumericalSemigroup(3,7,12);
<Proportionally modular numerical semigroup satisfying 3x mod 7 <= 12x >
gap> NumericalSemigroup("propmodular",3,7,12);
<Proportionally modular numerical semigroup satisfying 3x mod 7 <= 12x >

gap> NumericalSemigroup("propmodular",67,98,1);
<Modular numerical semigroup satisfying 67x mod 98 <= x >

gap> NumericalSemigroupByInterval(7/5,5/3);
<Proportionally modular numerical semigroup satisfying 25x mod 35 <= 4x >
gap> NumericalSemigroup("interval",[7/5,5/3]);
<Proportionally modular numerical semigroup satisfying 25x mod 35 <= 4x >
gap> SmallElements(last);
035 ]

gap> NumericalSemigroupByOpenInterval(7/5,5/3);
<Numerical semigroup>
gap> NumericalSemigroup("openinterval",[7/5,5/3]);
<Numerical semigroup>
gap> SmallElements(last);
0368 ]

##Some_basic_tests.xml

gap> s:=NumericalSemigroup(3,7);
<Numerical semigroup with 2 generators>
gap> AperyListOfNumericalSemigroupWRTElement(s,30);;
gap> t:=NumericalSemigroupByAperyList(last);
<Numerical semigroup>
gap> IsNumericalSemigroupByGenerators(s);
true
gap> IsNumericalSemigroupByGenerators(t);
false
gap> IsNumericalSemigroupByAperyList(s);
false
gap> IsNumericalSemigroupByAperyList(t);
true

gap> L:=[ 036911121415171820 ];
036911121415171820 ]
gap> RepresentsSmallElementsOfNumericalSemigroup(L);
true
gap> L:=[ 6911121415171820 ];
6911121415171820 ]
gap> RepresentsSmallElementsOfNumericalSemigroup(L);
false

gap> s:=NumericalSemigroup(3,7);
<Numerical semigroup with 2 generators>
gap> L:=GapsOfNumericalSemigroup(s);
1245811 ]
gap> RepresentsGapsOfNumericalSemigroup(L);
true

gap> IsAperyListOfNumericalSemigroup([0,21,7,28,14]);
true

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> T:=NumericalSemigroup(2,3);
<Numerical semigroup with 2 generators>
gap> IsSubsemigroupOfNumericalSemigroup(T,S);
true
gap> IsSubsemigroupOfNumericalSemigroup(S,T);
false

gap> ns1 := NumericalSemigroup(5,7);;
gap> ns2 := NumericalSemigroup(5,7,11);;
gap> IsSubset(ns1,ns2);
false
gap> IsSubset(ns2,[5,15]);
true
gap> IsSubset(ns1,[5,11]);
false
gap> IsSubset(ns2,ns1);
true

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> BelongsToNumericalSemigroup(15,S);
false
gap> 15 in S;
false
gap> SmallElementsOfNumericalSemigroup(S);
01112132223242526323334353637383943 ]
gap> BelongsToNumericalSemigroup(13,S);
true
gap> 13 in S;
true

##The_definitions.xml

gap> NumericalSemigroup(3,5);
<Numerical semigroup with 2 generators>
gap> Multiplicity(last);
3
gap> S := NumericalSemigroup("modular", 7,53);
<Modular numerical semigroup satisfying 7x mod 53 <= x >
gap> MultiplicityOfNumericalSemigroup(S);
8

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> Generators(S);
1112133253 ]
gap> S := NumericalSemigroup(3553);
<Numerical semigroup with 3 generators>
gap> GeneratorsOfNumericalSemigroup(S);
3553 ]
gap> MinimalGenerators(S);
35 ]
gap> MinimalGeneratingSystemOfNumericalSemigroup(S);
35 ]
gap> MinimalGeneratingSystem(S)=MinimalGeneratingSystemOfNumericalSemigroup(S);
true
gap> s := NumericalSemigroup(3,5,7,15);
<Numerical semigroup with 4 generators>
gap> HasGenerators(s);
true
gap> HasMinimalGenerators(s);
false
gap> MinimalGenerators(s);
357 ]
gap> Generators(s);
35715 ]

gap> s := NumericalSemigroup(3,5,7,15);
<Numerical semigroup with 4 generators>
gap> EmbeddingDimension(s);
3
gap> EmbeddingDimensionOfNumericalSemigroup(s);
3

gap> SmallElements(NumericalSemigroup(3,5,7));
035 ]
gap> SmallElementsOfNumericalSemigroup(NumericalSemigroup(3,5,7));
035 ]

gap> Length(NumericalSemigroup(3,5,7));
2

gap> FirstElementsOfNumericalSemigroup(2,NumericalSemigroup(3,5,7));
03 ]
gap> FirstElementsOfNumericalSemigroup(10,NumericalSemigroup(3,5,7));
0356789101112 ]

gap> ns := NumericalSemigroup(5,7);;
gap> SmallElements(ns);
05710121415171920212224 ]
gap> ElementsUpTo(ns,18);
0571012141517 ]
gap> ElementsUpTo(ns,27);
05710121415171920212224252627 ]

gap> S := NumericalSemigroup(7,8,17);;
gap> S[53];
68
gap> S := NumericalSemigroup(7,8,17);;
gap> S{[1..5]};
0781415 ]


gap> S := NumericalSemigroup(7,8,17);;
gap> NextElementOfNumericalSemigroup(S,9);
14
gap> NextElementOfNumericalSemigroup(16,S);
17
gap> NextElementOfNumericalSemigroup(S,FrobeniusNumber(S))=Conductor(S);
true

gap> S := NumericalSemigroup(7,8,17);;
gap> ElementNumber_NumericalSemigroup(S,53);
68
gap> RthElementOfNumericalSemigroup(S,53);
68

gap> S := NumericalSemigroup(7,8,17);;
gap> NumberElement_NumericalSemigroup(S,68);
53

gap> S := NumericalSemigroup(7,8,17);;
gap> iter:=Iterator(S);
<iterator>
gap> NextIterator(iter);
0
gap> NextIterator(iter);
7
gap> NextIterator(iter);
8

gap> S := NumericalSemigroup("modular", 5,53);;
gap> AperyList(S,12);
01326395253544332332211 ]
gap> AperyListOfNumericalSemigroupWRTElement(S,12);
01326395253544332332211 ]
gap> First(S,x-> x mod 12 =1);
13

gap> AperyList(NumericalSemigroup(5,7,11));
01171814 ]
gap> S := NumericalSemigroup("modular", 5,53);;
gap> AperyListOfNumericalSemigroup(S);
012132526383951525332 ]

gap> s:=NumericalSemigroup(10,13,19,27);;
gap> AperyList(s,11);
01013192023262729323336394245465255 ]
gap> AperyListOfNumericalSemigroupWRTInteger(s,11);
01013192023262729323336394245465255 ]
gap> Length(last);
18
gap> AperyListOfNumericalSemigroupWRTInteger(s,10);
0131926273238455154 ]
gap> AperyListOfNumericalSemigroupWRTElement(s,10);
0513213544526273819 ]
gap> AperyList(s,10);
0513213544526273819 ]
gap> Length(last);
10

gap> s:=NumericalSemigroup(3,7);;
gap> AperyListOfNumericalSemigroupWRTElement(s,10);
021123141567189 ]
gap> AperyListOfNumericalSemigroupAsGraph(last);
[ ,, [ 36912151821 ],,, [ 6912151821 ], [ 71421 ],,
  [ 912151821 ],,, [ 12151821 ],, [ 1421 ], [ 151821 ],,,
  [ 1821 ],,, [ 21 ] ]

gap> s:=NumericalSemigroup(3,5,7);
<Numerical semigroup with 3 generators>
gap> KunzCoordinates(s);
21 ]
gap> KunzCoordinatesOfNumericalSemigroup(s);
21 ]
gap> KunzCoordinates(s,5);
1101 ]
gap> KunzCoordinatesOfNumericalSemigroup(s,5);
1101 ]

gap> KunzPolytope(3);
[ [ 10, -1 ], [ 01, -1 ], [ 2, -10 ], [ -121 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> CocycleOfNumericalSemigroupWRTElement(s,3);
[ [ 000 ], [ 034 ], [ 041 ] ]

gap> FrobeniusNumber(NumericalSemigroup(3,5,7));
4
gap> FrobeniusNumberOfNumericalSemigroup(NumericalSemigroup(3,5,7));
4

gap> Conductor(NumericalSemigroup(3,5,7));
5
gap> ConductorOfNumericalSemigroup(NumericalSemigroup(3,5,7));
5

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> PseudoFrobenius(S);
21404142 ]
gap> PseudoFrobeniusOfNumericalSemigroup(S);
21404142 ]

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> Type(S);
4
gap> TypeOfNumericalSemigroup(S);
4

gap> Gaps(NumericalSemigroup(5,7,11));
123468913 ]
gap> GapsOfNumericalSemigroup(NumericalSemigroup(3,5,7));
124 ]

gap> Weight(NumericalSemigroup(4,5,6,7));
0
gap> Weight(NumericalSemigroup(4,5));    
9

gap> s:=NumericalSemigroup(3,5,7);;
gap> Deserts(s);
[ [ 12 ], [ 4 ] ]
gap> DesertsOfNumericalSemigroup(s);
[ [ 12 ], [ 4 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsOrdinary(s);
false

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsAcute(s);
true

gap> s:=NumericalSemigroup(3,5);;
gap> Holes(s);
[  ]
gap> s:=NumericalSemigroup(3,5,7);;
gap> HolesOfNumericalSemigroup(s);
2 ]

gap> s:=NumericalSemigroup(16,17,71,72);;
gap> LatticePathAssociatedToNumericalSemigroup(s,16,17);
[ [ 014 ], [ 113 ], [ 212 ], [ 311 ], [ 410 ], [ 59 ], [ 68 ],
  [ 77 ], [ 86 ], [ 95 ], [ 104 ], [ 113 ], [ 122 ], [ 131 ],
  [ 140 ] ]

gap> s:=NumericalSemigroup(16,17,71,72);;
gap> Genus(s);
80
gap> GenusOfNumericalSemigroup(s);
80
gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> Genus(S);
26

gap> FundamentalGaps(NumericalSemigroup(5,7,11));
68913 ]
gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> FundamentalGapsOfNumericalSemigroup(S);
161718192728293031404142 ]
gap> GapsOfNumericalSemigroup(S);
123456789101415161718192021272829,
  3031404142 ]
gap> Gaps(NumericalSemigroup(5,7,11));
123468913 ]
gap> FundamentalGaps(NumericalSemigroup(5,7,11));
68913 ]

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> SpecialGaps(S);
404142 ]
gap> SpecialGapsOfNumericalSemigroup(S);
404142 ]

##Wilf.xml

gap> s := NumericalSemigroup(13,25,37);;
gap> WilfNumber(s);
96
gap> l:=NumericalSemigroupsWithGenus(10);;
gap> Filtered(l, s->WilfNumber(s)<0);
[  ]
gap> Maximum(Set(l, s->WilfNumberOfNumericalSemigroup(s)));
70

gap> s:=NumericalSemigroupWithGivenElementsAndFrobenius([14,22,23],55);;
gap> EliahouNumber(s);
-1
gap> s:=NumericalSemigroup(5,7,9);;
gap> TruncatedWilfNumberOfNumericalSemigroup(s);
4

gap> s:=NumericalSemigroup(5,7,9);;
gap> ProfileOfNumericalSemigroup(s);
21 ]
gap> s:=NumericalSemigroupWithGivenElementsAndFrobenius([14,22,23],55);;
gap> ProfileOfNumericalSemigroup(s);
300 ]

gap> s:=NumericalSemigroup(5,7,9);;
gap> EliahouSlicesOfNumericalSemigroup(s);
[ [ 57 ], [ 91012 ] ]
gap> SmallElements(s);
0579101214 ]

##Presentations_of_Numerical_Semigroups.xml

gap> s:=NumericalSemigroup(3,5,7);;
gap> MinimalPresentation(s);
[ [ [ 002 ], [ 310 ] ], [ [ 011 ], [ 400 ] ], 
  [ [ 020 ], [ 101 ] ] ]
gap> MinimalPresentationOfNumericalSemigroup(s);
[ [ [ 002 ], [ 310 ] ], [ [ 011 ], [ 400 ] ], 
  [ [ 020 ], [ 101 ] ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> GraphAssociatedToElementInNumericalSemigroup(10,s);
[ [ 357 ], [ [ 37 ] ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> BettiElementsOfNumericalSemigroup(s);
101214 ]
gap> BettiElements(s);
101214 ]

gap> s:=NumericalSemigroup(4,6,9);;
gap> MinimalPresentation(s);
[ [ [ 002 ], [ 030 ] ], [ [ 020 ], [ 300 ] ] ]
gap> IsMinimalRelationOfNumericalSemigroup([[2,1,0],[0,0,2]],s);
false
gap> IsMinimalRelationOfNumericalSemigroup([[3,1,0],[0,0,2]],s);
true

gap> s:=NumericalSemigroup(4,6,9);;
gap> MinimalPresentation(s);
[ [ [ 002 ], [ 030 ] ], [ [ 020 ], [ 300 ] ] ]
gap> AllMinimalRelationsOfNumericalSemigroup(s);
[ [ [ 030 ], [ 002 ] ], [ [ 300 ], [ 020 ] ], [ [ 310 ], [ 002 ] ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> DegreesOfPrimitiveElementsOfNumericalSemigroup(s);
35710121415212835 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> ShadedSetOfElementInNumericalSemigroup(10,s);
[ [  ], [ 3 ], [ 37 ], [ 5 ], [ 7 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> BinomialIdealOfNumericalSemigroup(GF(2),s);
<two-sided ideal in GF(2)[x_1,x_2,x_3], (3 generators)>
gap> GeneratorsOfTwoSidedIdeal(last);
[ x_1^3*x_2+x_3^2, x_1^4+x_2*x_3, x_1*x_3+x_2^2 ]
gap> x:=Indeterminate(Rationals,"x");;
gap> y:=Indeterminate(Rationals,"y");;
gap> z:=Indeterminate(Rationals,"z");;
gap> BinomialIdealOfNumericalSemigroup(s);
<two-sided ideal in Rationals[x,y,z], (3 generators)>
gap> GeneratorsOfTwoSidedIdeal(last);
[ -x^3*y+z^2, -x^4+y*z, -x*z+y^2 ]
gap> MinimalPresentation(s);
[ [ [ 002 ], [ 310 ] ], [ [ 011 ], [ 400 ] ], [ [ 020 ], [ 101 ] ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsUniquelyPresented(s);
true
gap> IsUniquelyPresentedNumericalSemigroup(s);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsGeneric(s);
true
gap> IsGenericNumericalSemigroup(s);
true

##Adding_and_removing_elements_of_a_numerical_semigroup.xml

gap> s:=NumericalSemigroup(3,5,7);
<Numerical semigroup with 3 generators>
gap> RemoveMinimalGeneratorFromNumericalSemigroup(7,s);
<Numerical semigroup with 3 generators>
gap> MinimalGeneratingSystemOfNumericalSemigroup(last);
35 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> s2:=RemoveMinimalGeneratorFromNumericalSemigroup(5,s);
<Numerical semigroup with 3 generators>
gap> s3:=AddSpecialGapOfNumericalSemigroup(5,s2);
<Numerical semigroup>
gap> SmallElementsOfNumericalSemigroup(s) =
> SmallElementsOfNumericalSemigroup(s3);
true
gap> s=s3;
true

#Operations_Numerical_Semigroups.xml

gap> S := NumericalSemigroup("modular", 5,53);
<Modular numerical semigroup satisfying 5x mod 53 <= x >
gap> T := NumericalSemigroup(2,17);
<Numerical semigroup with 2 generators>
gap> SmallElements(S);
01112132223242526323334353637383943 ]
gap> SmallElements(T);
0246810121416 ]
gap> Intersection(S,T);
<Numerical semigroup>
gap> SmallElements(last);
0122223242526323334353637383943 ]
gap> IntersectionOfNumericalSemigroups(S,T) = Intersection(S,T);
true

gap> s:=NumericalSemigroup(4,9);;
gap> t:=NumericalSemigroup(6,7);;
gap> MinimalGenerators(s+t);
4679 ]

gap> s:=NumericalSemigroup(3,29);
<Numerical semigroup with 2 generators>
gap> SmallElementsOfNumericalSemigroup(s);
036912151821242729303233353638394142,
  444547485051535456 ]
gap> t:=QuotientOfNumericalSemigroup(s,7);
<Numerical semigroup>
gap> SmallElementsOfNumericalSemigroup(t);
03568 ]
gap> u := s / 7;
<Numerical semigroup>
gap> SmallElementsOfNumericalSemigroup(u);
03568 ]

gap> N:=NumericalSemigroup(1);;
gap> s:=MultipleOfNumericalSemigroup(N,4,20);;
gap> SmallElements(s)=[ 048121620 ];
true

gap> s:=NumericalSemigroup(3,4,5);;
gap> m:=MaximalIdeal(s);;
gap> SmallElements(m-2*m);
[ -3 ]
gap> d:=DilatationOfNumericalSemigroup(s,3);
<Numerical semigroup>
gap> SmallElements(d);
06 ]

gap> ns1 := NumericalSemigroup(5,7);;
gap> ns2 := NumericalSemigroup(7,11,12);;
gap> Difference(ns1,ns2);
51015172027 ]
gap> Difference(ns2,ns1);
111823 ]
gap> DifferenceOfNumericalSemigroups(ns2,ns1);
111823 ]

gap> s:=NumericalSemigroup(3,5,7);
<Numerical semigroup with 3 generators>
gap> e:=6+s;
<Ideal of numerical semigroup>
gap> ndup:=NumericalDuplication(s,e,3);
<Numerical semigroup with 4 generators>
gap> SmallElements(ndup);
0610121415161820212224 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> ndup:=NumericalDuplication(s,6+s,11);;
gap> asdup:=AsNumericalDuplication(ndup);
[ <Numerical semigroup with 3 generators>, <Ideal of numerical semigroup>, 3 ]
gap> ndup = CallFuncList(NumericalDuplication,asdup);
true


gap> s:=InductiveNumericalSemigroup([4,2],[5,23]);;
gap> SmallElements(s);
0816243240424446 ]


##Constructing_sets_of_numerical_semigroups.xml

gap> s := NumericalSemigroup(3,5,7);;
gap> OverSemigroups(s);
[ <The numerical semigroup N>, <Numerical semigroup with 2 generators>, 
  <Numerical semigroup with 3 generators>, 
  <Numerical semigroup with 3 generators> ]
gap> List(last,s->MinimalGenerators(s));
[ [ 1 ], [ 23 ], [ 3 .. 5 ], [ 357 ] ]
gap> OverSemigroupsNumericalSemigroup(s) = OverSemigroups(s);
true

gap> Length(NumericalSemigroupsWithFrobeniusNumberFG(15));
200
gap> Length(NumericalSemigroupsWithFrobeniusNumber(15));
200
gap> Length(NumericalSemigroupsWithFrobeniusNumberPC(15));
200

gap> Length(NumericalSemigroupsWithFrobeniusNumberAndMultiplicity(15,6));
28

gap> NumericalSemigroupsWithMaxPrimitive(5);
[ <Numerical semigroup with 2 generators>, 
  <Numerical semigroup with 2 generators>, 
  <Numerical semigroup with 3 generators>, 
  <Numerical semigroup with 2 generators> ]
gap> Length(NumericalSemigroupsWithMaxPrimitive(15));
194
gap> Length(NumericalSemigroupsWithMaxPrimitivePC(15));
194
gap> Length(NumericalSemigroupsWithMaxPrimitiveAndMultiplicity(15,6));
27


gap> NumericalSemigroupsWithGenus(5);
[ <Numerical semigroup with 6 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 2 generators> ]
gap> List(last,MinimalGeneratingSystemOfNumericalSemigroup);
[ [ 6 .. 11 ], [ 578911 ], [ 5689 ], [ 5679 ],
  [ 5678 ], [ 467 ], [ 47910 ], [ 46911 ],
  [ 4511 ], [ 3810 ], [ 3711 ], [ 211 ] ]
gap> Length(NumericalSemigroupsWithGenusPC(15));
2857

gap> pf := [ 586475 ];
586475 ]
gap> ForcedIntegersForPseudoFrobenius(pf);
[ [ 1234567811151617252932586475 ],
  [ 05960676869707172737476 ] ]

gap> pf := [ 15202735 ];;
gap> fint := ForcedIntegersForPseudoFrobenius(pf);
[ [ 12345678910121516202735 ],
  [ 0192325262829303132333436 ] ]
gap> free := Difference([1..Maximum(pf)],Union(fint));
1113141718212224 ]
gap> SimpleForcedIntegersForPseudoFrobenius(fint[1],Union(fint[2],[free[1]]),pf);
[ [ 123456789101213151620242735 ],
  [ 01119222325262829303132333436 ] ]

gap> pf := [ 586475 ];
586475 ]
gap> Length(NumericalSemigroupsWithPseudoFrobeniusNumbers(pf));
561
gap> pf := [11,19,22];;
gap> NumericalSemigroupsWithPseudoFrobeniusNumbers(pf);
[ <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>,
  <Numerical semigroup>, <Numerical semigroup> ]
gap> List(last,MinimalGeneratingSystemOfNumericalSemigroup);
[ [ 791720 ], [ 710131618 ], [ 9121415161720 ],
  [ 1013141516171821 ],
  [ 12131415161718202123 ] ]
gap> Set(last2,PseudoFrobeniusOfNumericalSemigroup);    
[ [ 111922 ] ]

##Irreducible_numerical_semigroups.xml

gap> IsIrreducible(NumericalSemigroup(4,6,9));
true
gap> IsIrreducibleNumericalSemigroup(NumericalSemigroup(4,6,7,9));
false

gap> IsSymmetricNumericalSemigroup(NumericalSemigroup(10,23));
true
gap> IsSymmetricNumericalSemigroup(NumericalSemigroup(10,11,23));
false

gap> IsPseudoSymmetric(NumericalSemigroup(6,7,8,9,11));
true
gap> IsPseudoSymmetricNumericalSemigroup(NumericalSemigroup(4,6,9));
false

gap> FrobeniusNumber(AnIrreducibleNumericalSemigroupWithFrobeniusNumber(28));
28

gap> Length(IrreducibleNumericalSemigroupsWithFrobeniusNumber(19));
20

gap> Length(IrreducibleNumericalSemigroupsWithFrobeniusNumberAndMultiplicity(31,11));
16

gap> DecomposeIntoIrreducibles(NumericalSemigroup(5,6,8));
[ <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 4 generators> ]

##Complete_Intersections.xml

gap> s := NumericalSemigroup( 101516 );
<Numerical semigroup with 3 generators>
gap> AsGluingOfNumericalSemigroups(s);
[ [ [ 1015 ], [ 16 ] ], [ [ 1016 ], [ 15 ] ] ]
gap> s := NumericalSemigroup( 182434465161748 );
<Numerical semigroup with 8 generators>
gap> AsGluingOfNumericalSemigroups(s);
[  ]

gap> s := NumericalSemigroup( 101516 );
<Numerical semigroup with 3 generators>
gap> IsCompleteIntersection(s);
true
gap> s := NumericalSemigroup( 182434465161748 );
<Numerical semigroup with 8 generators>
gap> IsACompleteIntersectionNumericalSemigroup(s);
false

gap> Length(CompleteIntersectionNumericalSemigroupsWithFrobeniusNumber(57));
34

gap> IsFree(NumericalSemigroup(10,15,16));
true
gap> IsFreeNumericalSemigroup(NumericalSemigroup(3,5,7));
false

gap> Length(FreeNumericalSemigroupsWithFrobeniusNumber(57));
33

gap> IsTelescopic(NumericalSemigroup(4,11,14));
false
gap> IsTelescopicNumericalSemigroup(NumericalSemigroup(4,11,14));
false
gap> IsFree(NumericalSemigroup(4,11,14));
true

gap> Length(TelescopicNumericalSemigroupsWithFrobeniusNumber(57));
20

gap> s:=NumericalSemigroup(10,15,18);;
gap> IsUniversallyFree(s);
true
gap> s:=NumericalSemigroup(4,6,9);;
gap> IsUniversallyFree(s);
false

gap> ns := NumericalSemigroup(4,11,14);;
gap> IsNumericalSemigroupAssociatedIrreduciblePlanarCurveSingularity(ns);
false
gap> ns := NumericalSemigroup(4,11,19);;
gap> IsNumericalSemigroupAssociatedIrreduciblePlanarCurveSingularity(ns);
true

gap> Length(NumericalSemigroupsPlanarSingularityWithFrobeniusNumber(57));
7

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsAperySetGammaRectangular(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsAperySetGammaRectangular(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsAperySetBetaRectangular(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsAperySetBetaRectangular(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsAperySetAlphaRectangular(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsAperySetAlphaRectangular(s);
true

##Almost_symmetric.xml

gap> AlmostSymmetricNumericalSemigroupsFromIrreducible(NumericalSemigroup(5,8,9,11));
[ <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 5 generators>,
  <Numerical semigroup with 5 generators> ]
gap> List(last,MinimalGeneratingSystemOfNumericalSemigroup);
[ [ 58911 ], [ 58111417 ], [ 59111317 ] ]

gap> ns := NumericalSemigroup(5,8,9,11);;
gap> AlmostSymmetricNumericalSemigroupsFromIrreducibleAndGivenType(ns,4);
[ <Numerical semigroup with 5 generators>, 
  <Numerical semigroup with 5 generators> ]
gap> List(last,MinimalGenerators);
[ [ 58111417 ], [ 59111317 ] ]

gap> IsAlmostSymmetric(NumericalSemigroup(5,8,11,14,17));
true
gap> IsAlmostSymmetricNumericalSemigroup(NumericalSemigroup(5,8,11,14,17));
true

gap> Length(AlmostSymmetricNumericalSemigroupsWithFrobeniusNumber(12));
15
gap> Length(IrreducibleNumericalSemigroupsWithFrobeniusNumber(12));
2
gap> List(AlmostSymmetricNumericalSemigroupsWithFrobeniusNumber(12,4),Type);
121088666644444 ]

gap> Length(AlmostSymmetricNumericalSemigroupsWithFrobeniusNumberAndType(12,4)); 
5

gap> s:=NumericalSemigroup(3,7,8);;
gap> IsAlmostSymmetric(s);
false
gap> IsGeneralizedGorenstein(s);
true

gap> s:=NumericalSemigroup(10,11,12,25);;
gap> IsAlmostSymmetric(s);
false
gap> IsNearlyGorenstein(s);
true
gap> s:=NumericalSemigroup(3,7,8);;
gap> IsNearlyGorenstein(s);
false

gap> s:=NumericalSemigroup(3,5,7);;
gap> NearlyGorensteinVectors(s);
[ [ 4 ], [ 24 ], [ 24 ] ]
gap> s:=NumericalSemigroup(4,6,9);;
gap> NearlyGorensteinVectors(s);
[ [ 11 ], [ 11 ], [ 11 ] ]


gap> s:=NumericalSemigroup(924394377);;
gap> IsGeneralizedAlmostSymmetric(s);
true
gap> IsAlmostSymmetric(s);
false

##Ideals_of_numerical_semigroups.xml

gap> IdealOfNumericalSemigroup([3,5],NumericalSemigroup(9,11));
<Ideal of numerical semigroup>
gap> [3,5]+NumericalSemigroup(9,11);
<Ideal of numerical semigroup>
gap> last=last2;
true
gap> 3+NumericalSemigroup(5,9);
<Ideal of numerical semigroup>

gap> I:=[1..7]+NumericalSemigroup(7,19);;
gap> IsIdealOfNumericalSemigroup(I);
true
gap> IsIdealOfNumericalSemigroup(2);
false

gap> MinimalGenerators([3,5]+NumericalSemigroup(2,11));
3 ]
gap> I:=[3,5,9]+NumericalSemigroup(2,11);;
gap> MinimalGeneratingSystem(I);
3 ]
gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(I);
3 ]

gap> I:=[3,5,9]+NumericalSemigroup(2,11);;
gap> Generators(I);
359 ]
gap> GeneratorsOfIdealOfNumericalSemigroup(I);
359 ]
gap> MinimalGenerators(I);
3 ]

gap> I:=[3,5,9]+NumericalSemigroup(2,11);;
gap> AmbientNumericalSemigroupOfIdeal(I);
<Numerical semigroup with 2 generators>

gap> s:=NumericalSemigroup(3,7,5);;
gap> IsIntegral(10+s);
true
gap> IsIntegral(4+s);
false
gap> IsIntegralIdealOfNumericalSemigroup(10+s);
true

gap> s:=NumericalSemigroup(10,11,15,19);;
gap> i:=[20,21,25]+s;;
gap> d:=Difference(0+s,i);;
gap> IsComplementOfIntegralIdeal(d,s);
true
gap> i=IdealByDivisorClosedSet(d,s);
true

gap> I:=[3,5,9]+NumericalSemigroup(2,11);;
gap> SmallElements(I)=[ 35791113 ];
true
gap> SmallElements(I) = SmallElementsOfIdealOfNumericalSemigroup(I);
true
gap> J:=[2,11]+NumericalSemigroup(2,11);;
gap> SmallElements(J);
246810 ]

gap> s:=NumericalSemigroup(3,7,5);;
gap> Conductor(10+s);
15
gap> ConductorOfIdealOfNumericalSemigroup(10+s);
15
gap> FrobeniusNumber(0+s);
4

gap> s:=NumericalSemigroup(3,5,7);;
gap> i:=4+s;;
gap> PseudoFrobenius(i);
68 ]
gap> PseudoFrobenius(s)=PseudoFrobenius(0+s);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> k:=CanonicalIdeal(s);;
gap> Type(k);
1

gap> s:=NumericalSemigroup(3,5,7);;
gap> MinimalGenerators(TraceIdeal(s));
357 ]

gap> J:=[2,11]+NumericalSemigroup(2,11);;
gap> Minimum(J);
2

gap> J:=[2,11]+NumericalSemigroup(2,11);;
gap> BelongsToIdealOfNumericalSemigroup(9,J);
false
gap> 9 in J;
false
gap> BelongsToIdealOfNumericalSemigroup(10,J);
true
gap> 10 in J;
true

gap> I := [2,5]+ NumericalSemigroup(7,8,17);;
gap> ElementNumber_IdealOfNumericalSemigroup(I,10);
19

gap> I := [2,5]+ NumericalSemigroup(7,8,17);;
gap> NumberElement_IdealOfNumericalSemigroup(I,19);
10

gap> I:=[3,5,9]+NumericalSemigroup(2,11);;
gap> J:=[2,11]+NumericalSemigroup(2,11);;
gap> I+J;
<Ideal of numerical semigroup>
gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);
514 ]
gap> SumIdealsOfNumericalSemigroup(I,J);
<Ideal of numerical semigroup>
gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(last);
514 ]

gap> I:=[0,1]+NumericalSemigroup(3,5,7);;
gap> MultipleOfIdealOfNumericalSemigroup(2,I) = 2*I;
true
gap> MinimalGeneratingSystemOfIdealOfNumericalSemigroup(2*I);
012 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> I:=2+s;;
gap> J:=3+s;;
gap> Generators(Union(I,J));
23 ]
gap> Generators(Intersection(I,J));
891011 ]


gap> S:=NumericalSemigroup(1415202125);;
gap> I:=[0,1]+S;;
gap> II:=S-I;;
gap> MinimalGenerators(I);
01 ]
gap> MinimalGenerators(II);
1420 ]
gap> MinimalGenerators(I+II);
14152021 ]

gap> S:=NumericalSemigroup(1415202125);;
gap> I:=[0,1]+S;
<Ideal of numerical semigroup>
gap> 2*I-2*I;
<Ideal of numerical semigroup>
gap> I-I;
<Ideal of numerical semigroup>
gap> ii := 2*I-2*I;
<Ideal of numerical semigroup>
gap> i := I-I;
<Ideal of numerical semigroup>
gap>  Difference(last2,last);
26273738 ]
gap> DifferenceOfIdealsOfNumericalSemigroup(ii,i);
26273738 ]
gap> Difference(i,ii);
[  ]

gap> s:=NumericalSemigroup(13,23);;
gap> l:=List([1..6], _ -> Random([8..34]));;
gap> I:=IdealOfNumericalSemigroup(l, s);;
gap> It:=TranslationOfIdealOfNumericalSemigroup(7,I);
<Ideal of numerical semigroup>
gap> It2:=7+I;
<Ideal of numerical semigroup>
gap> It2=It;
true

gap> i:=IdealOfNumericalSemigroup([75,89],s);;
gap> j:=IdealOfNumericalSemigroup([115,289],s);;
gap> Intersection(i,j);
<Ideal of numerical semigroup>
gap> IntersectionIdealsOfNumericalSemigroup(i,j) = Intersection(i,j);
true

gap> s := NumericalSemigroup(3,7);;                   
gap> MaximalIdeal(s);
<Ideal of numerical semigroup>
gap> MaximalIdealOfNumericalSemigroup(s) = MaximalIdeal(s);
true

gap> s:=NumericalSemigroup(4,6,11);;
gap> m:=MaximalIdeal(s);;
gap> c:=CanonicalIdeal(s);
<Ideal of numerical semigroup>
gap> c-(c-m)=m;
true
gap> id:=3+s;
<Ideal of numerical semigroup>
gap> c-(c-id)=id;
true
gap> CanonicalIdealOfNumericalSemigroup(s) = c;
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> c:=3+CanonicalIdeal(s);;
gap> c-(c-(3+s))=3+s;
true
gap> IsCanonicalIdeal(c);
true
gap> IsCanonicalIdealOfNumericalSemigroup(c);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsAlmostSymmetric(s);
true
gap> IsAlmostCanonical(MaximalIdeal(s));
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> TypeSequence(s);
13344733322233243213211221,
  1122131111221111111211111,
  111 ]
gap> s:=NumericalSemigroup(4,6,11);;
gap> TypeSequenceOfNumericalSemigroup(s);
1111111 ]


gap> s:=NumericalSemigroup(3,5,7);;
gap> i:=[4,5]+s;;
gap> zc:=IrreducibleZComponents(i);
[ <Ideal of numerical semigroup>, <Ideal of numerical semigroup> ]
gap> List(zc,MinimalGenerators);
[ [ 24 ], [ -20 ] ]
gap> i=Intersection(zc);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> i:=10+s;;
gap> di:=DecomposeIntegralIdealIntoIrreducibles(i);
[ <Ideal of numerical semigroup>, <Ideal of numerical semigroup> ]
gap> List(di,MinimalGenerators);
[ [ 810 ], [ 1012 ] ]
gap> i=Intersection(di);
true

gap> I:=[6,9,11]+NumericalSemigroup(6,9,11);;
gap> List([1..7],n->HilbertFunctionOfIdealOfNumericalSemigroup(n,I));
3566666 ]

gap> I:=[0,2]+NumericalSemigroup(6,9,11);;
gap> BlowUp(I);
<Ideal of numerical semigroup>
gap> SmallElements(last);
02468 ]
gap> BlowUpIdealOfNumericalSemigroup(I);;
gap> SmallElementsOfIdealOfNumericalSemigroup(last);
02468 ]

gap> I:=[0,2]+NumericalSemigroup(6,9,11);;
gap> ReductionNumber(I);
2
gap> ReductionNumberIdealNumericalSemigroup(I);
2

gap> MaximalIdealOfNumericalSemigroup(NumericalSemigroup(3,7));
<Ideal of numerical semigroup>

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> BlowUp(s);
<Numerical semigroup with 10 generators>
gap> SmallElements(last);
051012151720222425272930323435363739,
  40414244 ]
gap> BlowUpOfNumericalSemigroup(s);;
gap> SmallElements(last);
051012151720222425272930323435363739,
  40414244 ]
gap> m:=MaximalIdeal(s);
<Ideal of numerical semigroup>
gap> BlowUp(m);
<Ideal of numerical semigroup>
gap> SmallElements(last);
051012151720222425272930323435363739,
  40414244 ]

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> LipmanSemigroup(s);
<Numerical semigroup with 10 generators>
gap> SmallElementsOfNumericalSemigroup(last);
051012151720222425272930323435363739,
  40414244 ]

gap> s:=NumericalSemigroup([9..17]);;
gap> i:=[9,10,12]+s;;
gap> RatliffRushNumber(i);
3

gap> s:=NumericalSemigroup(4,5,6,7);;
gap> i:=[4,5]+s;;
gap> MinimalGenerators(RatliffRushClosure(i));
4567 ]

gap> i:=[4,5]+NumericalSemigroup([4..7]);;
gap> AsymptoticRatliffRushNumber(i);
3

gap> s:=NumericalSemigroup(3,5);;
gap> MultiplicitySequence(s);
321 ]
gap> MultiplicitySequenceOfNumericalSemigroup(s);
321 ]

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> bu:=BlowUpOfNumericalSemigroup(s);;
gap> ap:=AperyListOfNumericalSemigroupWRTElement(s,30);;
gap> apbu:=AperyListOfNumericalSemigroupWRTElement(bu,30);;
gap> (ap-apbu)/30;
0443213443231443314443242,
  54332 ]
gap> MicroInvariants(s)=last;
true
gap> MicroInvariantsOfNumericalSemigroup(s)=MicroInvariants(s);
true

gap> s:=NumericalSemigroup(10,11,13);;
gap> i:=[12,14]+s;;
gap> AperyList(i,10);
40511223142536273849 ]
gap> AperyListOfIdealOfNumericalSemigroupWRTElement(i,10);
40511223142536273849 ]

gap> s:=NumericalSemigroup(5,7,9);;
gap> i:=[0,1,2]+s;;
gap> AperyList(i);
01289 ]

gap> s:=NumericalSemigroup(10,11,13);;
gap> AperyTable(s);
[ [ 0112213243526374839 ],
  [ 10112213243526374839 ],
  [ 20212223243526374839 ],
  [ 30313233343536374839 ],
  [ 40414243444546474849 ] ]
gap> AperyTableOfNumericalSemigroup(s) = AperyTable(s);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> StarClosureOfIdealOfNumericalSemigroup([0,2]+s,[[0,4]+s]);;
gap> MinimalGenerators(last);
024 ]

gap> IsAdmissiblePattern([1,1,-1]);
true
gap> IsAdmissiblePattern([1,-2]);
false

gap> IsAdmissiblePattern([1,-1]);
true
gap> IsStronglyAdmissiblePattern([1,-1]);
false
gap> IsStronglyAdmissiblePattern([1,1,-1]);
true

gap> s:=NumericalSemigroup(3,7,5);;
gap> t:=NumericalSemigroup(10,11,14);;
gap> AsIdealOfNumericalSemigroup(10+s,t);
fail
gap> AsIdealOfNumericalSemigroup(100+s,t);
<Ideal of numerical semigroup>

gap> BoundForConductorOfImageOfPattern([1,1,-1],10);
10

gap> s:=NumericalSemigroup(3,7,5);;
gap> i:=10+s;;
gap> ApplyPatternToIdeal([1,1,-1],i);
1, <Ideal of numerical semigroup> ]

gap> s:=NumericalSemigroup(3,7,5);;
gap> ApplyPatternToNumericalSemigroup([1,1,-1],s);
1, <Ideal of numerical semigroup> ]
gap> SmallElements(last[2]);
035 ]

gap> s:=NumericalSemigroup(3,7,5);;
gap> i:=[3,5]+s;;
gap> IsAdmittedPatternByIdeal([1,1,-1],i,i);
false
gap> IsAdmittedPatternByIdeal([1,1,-1],i,0+s);
true

gap> IsAdmittedPatternByNumericalSemigroup([1,1,-1],s,s);
true
gap> IsArfNumericalSemigroup(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsGradedAssociatedRingNumericalSemigroupCM(s);
false
gap> MicroInvariantsOfNumericalSemigroup(s);
0443213443231443314443242,
  54332 ]
gap> List(AperyListOfNumericalSemigroupWRTElement(s,30),
> w->MaximumDegreeOfElementWRTNumericalSemigroup (w,s));
0141213143231143314143242,
  54312 ]
gap> last=last2;
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsGradedAssociatedRingNumericalSemigroupCM(s);
true
gap> MicroInvariantsOfNumericalSemigroup(s);
0211 ]
gap> List(AperyListOfNumericalSemigroupWRTElement(s,4),
> w->MaximumDegreeOfElementWRTNumericalSemigroup(w,s));
0211 ]

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsGradedAssociatedRingNumericalSemigroupBuchsbaum(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> TorsionOfAssociatedGradedRingNumericalSemigroup(s);
181153157193169148 ]

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> BuchsbaumNumberOfAssociatedGradedRingNumericalSemigroup(s);
1
gap> IsGradedAssociatedRingNumericalSemigroupBuchsbaum(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsMpure(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsMpureNumericalSemigroup(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsPure(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsPureNumericalSemigroup(s);
true

gap> s:=NumericalSemigroup(10,11,12,25);;
gap> IsHomogeneousNumericalSemigroup(s);
false
gap> s:=NumericalSemigroup(3,5,7);;
gap> IsHomogeneousNumericalSemigroup(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsGradedAssociatedRingNumericalSemigroupGorenstein(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsGradedAssociatedRingNumericalSemigroupGorenstein(s);
true

gap> s:=NumericalSemigroup(30354247148153157169181193);;
gap> IsGradedAssociatedRingNumericalSemigroupCI(s);
false
gap> s:=NumericalSemigroup(4,6,11);;
gap> IsGradedAssociatedRingNumericalSemigroupCI(s);
true

##Numerical_semigroups_with_maximal_embedding_dimension.xml

gap> IsMED(NumericalSemigroup(3,5,7));
true
gap> IsMEDNumericalSemigroup(NumericalSemigroup(3,5));
false

gap> s := MEDClosure(NumericalSemigroup(3,5));
<Numerical semigroup>
gap> MinimalGenerators(s);
357 ]
gap> MEDNumericalSemigroupClosure(NumericalSemigroup(3,5)) = s;
true

gap> MinimalMEDGeneratingSystemOfMEDNumericalSemigroup(
> NumericalSemigroup(3,5,7));
35 ]

gap>  IsArf(NumericalSemigroup(3,5,7));
true
gap>  IsArfNumericalSemigroup(NumericalSemigroup(3,7,11));
false
gap> IsMED(NumericalSemigroup(3,7,11));
true

gap> s := NumericalSemigroup(3,7,11);;
gap> t := ArfClosure(s);
<Numerical semigroup>
gap> MinimalGenerators(t);
378 ]
gap> ArfNumericalSemigroupClosure(s) = t;
true

gap> s := NumericalSemigroup(3,7,8);
<Numerical semigroup with 3 generators>
gap> ArfCharactersOfArfNumericalSemigroup(s);
37 ]
gap> MinimalArfGeneratingSystemOfArfNumericalSemigroup(s);
37 ]

gap> ArfNumericalSemigroupsWithFrobeniusNumber(10);
[ <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>,
  <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>,
  <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup> ]
gap> Set(last,MinimalGenerators);
[ [ 31113 ], [ 4111314 ], [ 6911131416 ],
  [ 61113141516 ], [ 791112131517 ],
  [ 7111213151617 ], [ 811121314151718 ],
  [ 91112131415161719 ], [ 11 .. 21 ] ]

gap> Length(ArfNumericalSemigroupsWithFrobeniusNumberUpTo(10));
46

gap> Length(ArfNumericalSemigroupsWithGenus(10));
21

gap> Length(ArfNumericalSemigroupsWithGenusUpTo(10));
86

gap> ArfNumericalSemigroupsWithGenusAndFrobeniusNumber(10,13);
[ <Numerical semigroup>, <Numerical semigroup>, <Numerical semigroup>,
  <Numerical semigroup>, <Numerical semigroup> ]
gap> List(last,MinimalGenerators);
[ [ 810121415171921 ], [ 61014151719 ],
  [ 512141618 ], [ 6914161719 ], [ 4141517 ] ]

gap> IsSaturated(NumericalSemigroup(4,6,9,11));
true
gap> IsSaturatedNumericalSemigroup(NumericalSemigroup(8912131519 ));
false

gap> s := NumericalSemigroup(89121315);;
gap> SaturatedClosure(s);
<Numerical semigroup>
gap> MinimalGenerators(last);
8 .. 15 ]
gap> SaturatedNumericalSemigroupClosure(s) = SaturatedClosure(s);
true

gap> SaturatedNumericalSemigroupsWithFrobeniusNumber(10);
[ <Numerical semigroup with 3 generators>,
  <Numerical semigroup with 4 generators>,
  <Numerical semigroup with 6 generators>,
  <Numerical semigroup with 6 generators>,
  <Numerical semigroup with 7 generators>,
  <Numerical semigroup with 8 generators>,
  <Numerical semigroup with 9 generators>,
  <Numerical semigroup with 11 generators> ]
gap>  List(last,MinimalGeneratingSystemOfNumericalSemigroup);
[ [ 31113 ], [ 4111314 ], [ 6911131416 ],
  [ 61113141516 ], [ 7111213151617 ],
  [ 811121314151718 ], [ 91112131415161719 ],
  [ 11 .. 21 ] ]

##catenary-tame.xml

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ],
  [ 5201 ], [ 6011 ], [ 0123 ], [ 1104 ] ]

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> Factorizations(1100,s);
[ [ 081000 ], [ 000220 ], [ 511001 ],
  [ 023001 ] ]
gap> Factorizations(s,1100)=Factorizations(1100,s);
true
gap> FactorizationsElementWRTNumericalSemigroup(1100,s)=Factorizations(1100,s);
true

gap> s:=NumericalSemigroup(10,11,13);
<Numerical semigroup with 3 generators>
gap> FactorizationsElementListWRTNumericalSemigroup([100,101,103],s);
[ [ [ 026 ], [ 171 ], [ 342 ], [ 513 ], [ 1000 ] ],
  [ [ 081 ], [ 107 ], [ 252 ], [ 423 ], [ 910 ] ],
  [ [ 072 ], [ 243 ], [ 414 ], [ 730 ], [ 901 ] ] ]

gap> s:=NumericalSemigroup(10,11,19,23);;
gap> BettiElements(s);
3033425769 ]
gap> Factorizations(69,s);
[ [ 5010 ], [ 2120 ], [ 0003 ] ]
gap> RClassesOfSetOfFactorizations(last);
[ [ [ 2120 ], [ 5010 ] ], [ [ 0003 ] ] ]

gap> s:=NumericalSemigroup(4,6,9);;
gap> LShapes(s);
[ [ [ 00 ], [ 10 ], [ 01 ], [ 20 ], [ 11 ], [ 02 ], [ 21 ],
      [ 12 ], [ 22 ] ],
  [ [ 00 ], [ 10 ], [ 01 ], [ 20 ], [ 11 ], [ 30 ], [ 21 ],
      [ 40 ], [ 50 ] ] ]
gap> LShapesOfNumericalSemigroup(s) = LShapes(s);
true

gap> s:=NumericalSemigroup(67910);;
gap> RFMatrices(8,s);
[ [ [ -1200 ], [ 1, -110 ], [ 01, -11 ], [ 300, -1 ] ],
  [ [ -1200 ], [ 1, -110 ], [ 01, -11 ], [ 002, -1 ] ] ]

gap> s:=NumericalSemigroup(101,113,195,272,278,286);;
gap> DenumerantOfElementInNumericalSemigroup(1311,s);
6

gap> s:=NumericalSemigroup(101,113,195,272,278,286);;
gap> DenumerantFunction(s)(1311);
6

gap> s:=NumericalSemigroup(101,113,195,272,278,286);;
gap> 1311 in DenumerantIdeal(6,s);
false
gap> 1311 in DenumerantIdeal(5,s);
true

gap> LengthsOfFactorizationsIntegerWRTList(100,[11,13,15,19]);
68 ]

gap> s:=NumericalSemigroup(101,113,196,272,278,286);
<Numerical semigroup with 6 generators>
gap> LengthsOfFactorizationsElementWRTNumericalSemigroup(1100,s);
4689 ]

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> e := Elasticity(1100,s);
9/4
gap> Elasticity(1100,s) = Elasticity(s,1100);
true
gap> ElasticityOfFactorizationsElementWRTNumericalSemigroup(1100,s)= e;
true

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> Elasticity(s);
286/101
gap> ElasticityOfNumericalSemigroup(s);
286/101

gap> LengthsOfFactorizationsIntegerWRTList(100,[11,13,15,19]);
68 ]
gap> DeltaSet(last);
2 ]
gap> DeltaSetOfSetOfIntegers(last2);
2 ]

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> d := DeltaSet(1100,s);
12 ]
gap> DeltaSet(s,1100) = d;
true
gap> DeltaSetOfFactorizationsElementWRTNumericalSemigroup(1100,s) = d;
true

gap> s:=NumericalSemigroup(5,7,11);;
gap> DeltaSetPeriodicityBoundForNumericalSemigroup(s);
60

gap> s:=NumericalSemigroup(5,7,11);;
gap> DeltaSetPeriodicityStartForNumericalSemigroup(s);
21

gap> s:=NumericalSemigroup(5,7,11);;
gap> DeltaSetListUpToElementWRTNumericalSemigroup(31,s);
[ [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ],
  [  ], [  ], [  ], [  ], [  ], [  ], [  ], [  ], [ 2 ], [  ], [  ], [ 2 ], [  ],
  [ 2 ], [  ], [ 2 ], [ 2 ], [  ] ]

gap> s:=NumericalSemigroup(5,7,11);;
gap> DeltaSetUnionUpToElementWRTNumericalSemigroup(60,s);
2 ]

gap> s:=NumericalSemigroup(5,7,11);;
gap> DeltaSet(s);
2 ]
gap> DeltaSetOfNumericalSemigroup(s);
2 ]

gap> s:=NumericalSemigroup(101,113,196,272,278,286);
<Numerical semigroup with 6 generators>
gap> MaximumDegree(1100,s);
9
gap> MaximumDegreeOfElementWRTNumericalSemigroup(1100,s);
9


gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> MaximalDenumerant(1100,s);
1
gap> MaximalDenumerant(s,1311);
2
gap> MaximalDenumerantOfElementInNumericalSemigroup(1311,s);
2

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ], [ 5201 ],
6011 ], [ 0123 ], [ 1104 ] ]
gap> MaximalDenumerantOfSetOfFactorizations(last);
6

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> MaximalDenumerant(s);
4
gap> MaximalDenumerantOfNumericalSemigroup(s);
4

gap> s:=NumericalSemigroup(101,113,196,272,278,286);;
gap> a := Adjustment(s);
0122436486072849596107108119120131132143,
  144155156167168171177179180183185189190191192,
  195197201203204207209213215216219221225227228,
  231233237239240243245249251252255257261263264,
  266267269273275276279280281285287288292293299,
  300304305311312316317323324328329335336340341,
  342347348352353354356359360361362364365366368,
  370371372374376377378380382383384388389390394,
  395396400401402406407408412413414418419420424,
  425426430431432436437438442444448450451454456,
  460465466472477478484489490496501502508513514,
  519520525526527531532533537539543545549551555,
  561567573579585591597603609615621622627698704,
  710716722 ]
gap> AdjustmentOfNumericalSemigroup(s) = a;
true



gap> l:=IrreducibleNumericalSemigroupsWithFrobeniusNumber(31);;
gap> Length(l);
109
gap> Length(Filtered(l,IsAdditiveNumericalSemigroup));
20

gap> l:=IrreducibleNumericalSemigroupsWithFrobeniusNumber(31);;
gap> Length(l);
109
gap> Length(Filtered(l,IsSuperSymmetricNumericalSemigroup));
7

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ],
  [ 5201 ], [ 6011 ], [ 0123 ], [ 1104 ] ]
gap> CatenaryDegree(last);
5
gap> CatenaryDegreeOfSetOfFactorizations(last2);
5

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ], [ 5201 ],
  [ 6011 ], [ 0123 ], [ 1104 ] ]
gap> AdjacentCatenaryDegreeOfSetOfFactorizations(last);
5

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ], [ 5201 ],
  [ 6011 ], [ 0123 ], [ 1104 ] ]
gap> EqualCatenaryDegreeOfSetOfFactorizations(last);
2

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ], [ 5201 ],
  [ 6011 ], [ 0123 ], [ 1104 ] ]
gap> MonotoneCatenaryDegreeOfSetOfFactorizations(last);
5

gap> CatenaryDegree(157,NumericalSemigroup(13,18));
0
gap> CatenaryDegree(NumericalSemigroup(13,18),1157);
18
gap> CatenaryDegreeOfElementInNumericalSemigroup(1157,NumericalSemigroup(13,18));
18

gap> FactorizationsIntegerWRTList(100,[11,13,15,19]);
[ [ 2600 ], [ 3410 ], [ 4220 ], [ 5030 ],
  [ 5201 ], [ 6011 ], [ 0123 ], [ 1104 ] ]
gap> TameDegree(last);
4
gap> TameDegreeOfSetOfFactorizations(last2);
4

gap> s:=NumericalSemigroup(101,113,196,272,278,286);
<Numerical semigroup with 6 generators>
gap> CatenaryDegree(s);
8
gap> CatenaryDegreeOfNumericalSemigroup(s);
8

# to slow without normaliz or 4ti2
#gap> s:=NumericalSemigroup(3,5,7);;
#gap> DegreesOfEqualPrimitiveElementsOfNumericalSemigroup(s);
#[ 35710 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> EqualCatenaryDegreeOfNumericalSemigroup(s);
2

# to slow without normaliz or 4ti2
# gap> s:=NumericalSemigroup(3,5,7);;
# gap> DegreesOfMonotonePrimitiveElementsOfNumericalSemigroup(s);
# [ 35710121415212835 ]

# to slow without normaliz or 4ti2
#gap> s:=NumericalSemigroup(10,23,31,44);;
#gap> CatenaryDegreeOfNumericalSemigroup(s);
#9
# to slow without normaliz or 4ti2
#gap> MonotoneCatenaryDegreeOfNumericalSemigroup(s);
#21

gap> s:=NumericalSemigroup(101,113,196,272,278,286);
<Numerical semigroup with 6 generators>
gap> TameDegree(s);
14
gap> TameDegreeOfNumericalSemigroup(s);
14

gap> s:=NumericalSemigroup(10,11,13);;
gap> TameDegree(100,s);
5
gap> TameDegree(s,100);
5
gap> TameDegreeOfElementInNumericalSemigroup(100,s);
5

gap> s:=NumericalSemigroup(10,11,13);;
gap> OmegaPrimality(100,s);
13
gap> OmegaPrimality(s,100);
13
gap> OmegaPrimalityOfElementInNumericalSemigroup(100,s);
13

gap> s:=NumericalSemigroup(10,11,13);;
gap> l:=FirstElementsOfNumericalSemigroup(100,s);;
gap> List(l,x->OmegaPrimalityOfElementInNumericalSemigroup(x,s));
0455467666678777778789888,
  888899109999999910111010101010,
  10101011121111111111111111121312121212,
  12121212131413131313131313131415141414,
  141414141415161515151515151515 ]
gap> OmegaPrimalityOfElementListInNumericalSemigroup(l,s);
0455467666678777778789888,
  888899109999999910111010101010,
  10101011121111111111111111121312121212,
  12121212131413131313131313131415141414,
  141414141415161515151515151515 ]

gap> s:=NumericalSemigroup(10,11,13);;
gap> OmegaPrimality(s);
5
gap> OmegaPrimalityOfNumericalSemigroup(s);
5

gap> s:=NumericalSemigroup(10,11,13);;
gap> BelongsToHomogenizationOfNumericalSemigroup([10,23],s);
true
gap> BelongsToHomogenizationOfNumericalSemigroup([1,23],s);
false

gap> s:=NumericalSemigroup(10,11,13);;
gap> FactorizationsInHomogenizationOfNumericalSemigroup([20,230],s);
[ [ 00155 ], [ 02126 ], [ 0497 ], [ 0668 ],
  [ 0839 ], [ 010010 ], [ 11711 ], [ 13412 ],
  [ 15113 ], [ 20216 ] ]
gap> FactorizationsElementWRTNumericalSemigroup(230,s);
[ [ 2300 ], [ 12100 ], [ 1200 ], [ 1471 ], [ 3171 ],
  [ 1642 ], [ 5142 ], [ 1813 ], [ 7113 ], [ 984 ],
  [ 1155 ], [ 0155 ], [ 1326 ], [ 2126 ], [ 497 ],
  [ 668 ], [ 839 ], [ 10010 ], [ 1711 ], [ 3412 ],
  [ 5113 ], [ 0216 ] ]

gap> s:=NumericalSemigroup(10,17,19);;
gap> BettiElements(s);
576870 ]
gap> HomogeneousBettiElementsOfNumericalSemigroup(s);
[ [ 557 ], [ 568 ], [ 695 ], [ 770 ], [ 9153 ] ]

gap> s:=NumericalSemigroup(10,17,19);;
gap> CatenaryDegree(s);
7
gap> HomogeneousCatenaryDegreeOfNumericalSemigroup(s);
9

gap> s:=NumericalSemigroup(3,5,7);;
gap> MoebiusFunctionAssociatedToNumericalSemigroup(s,10);
2
gap> MoebiusFunctionAssociatedToNumericalSemigroup(s,34);
25

gap> s:=NumericalSemigroup(5,7,11);;
gap> DivisorsOfElementInNumericalSemigroup(s,20);
05101520 ]
gap> DivisorsOfElementInNumericalSemigroup(20,s);
05101520 ]
gap> DivisorsOfElementInNumericalSemigroup(0,s);
0 ]

gap> NuSequence:=S->List([1..2*Conductor(S)-Genus(S)], i->Length(DivisorsOfElementInNumericalSemigroup(S[i],S)));;
gap> s:=NumericalSemigroup(5,7,11);;
gap> NuSequence(s);
12232434464658989101212 ]
gap> s=NumericalSemigroupByNuSequence(last);
true

gap> TauNS := function(i,S)
>    local d, D, si;
>    D:=DivisorsOfElementInNumericalSemigroup(S[i+1],S);
>    si:=S[i+1];
>    d:=Maximum(Intersection(D,[0..Int(si/2)]));
>    return NumberElement_NumericalSemigroup(S,d)-1;
> end;;
gap> TauSequence:=S->List([0..(2*Conductor(S)-Genus(S)+1)], i->TauNS(i,S));;
gap> s:=NumericalSemigroup(6,7,8,17);;
gap> s=NumericalSemigroupByTauSequence(TauSequence(s));
true

gap> S := NumericalSemigroup(7,9,17);;
gap> FengRaoDistance(S,6,100);
86

gap> S := NumericalSemigroup(7,8,17);;
gap> FengRaoNumber(S,209);
224
gap> FengRaoNumber(209,S);
224

##polynomial.xml

gap> x:=X(Rationals,"x");;
gap> s:=NumericalSemigroup(5,7,9);;
gap> NumericalSemigroupPolynomial(s,x);
x^14-x^13+x^12-x^11+x^9-x^8+x^7-x^6+x^5-x+1

gap> x:=X(Rationals,"x");;
gap> s:=NumericalSemigroup(5,6,7,8);;
gap> f:=NumericalSemigroupPolynomial(s,x);
x^10-x^9+x^5-x+1
gap> IsNumericalSemigroupPolynomial(f);
true

gap> x:=X(Rationals,"x");;
gap> s:=NumericalSemigroup(5,6,7,8);;
gap> f:=NumericalSemigroupPolynomial(s,x);
x^10-x^9+x^5-x+1
gap> NumericalSemigroupFromNumericalSemigroupPolynomial(f)=s;
true

gap> x:=X(Rationals,"x");;
gap> s:=NumericalSemigroup(5,7,9);;
gap> HilbertSeriesOfNumericalSemigroup(s,x);
(x^14-x^13+x^12-x^11+x^9-x^8+x^7-x^6+x^5-x+1)/(-x+1)

gap> x:=Indeterminate(Rationals,1);; SetName(x,"x");
gap> GraeffePolynomial(x^2-1);
x^2-2*x+1

gap> CyclotomicPolynomial(Rationals,3);
x^2+x+1
gap> IsCyclotomicPolynomial(last);
true

gap> x:=X(Rationals,"x");;
gap>  s:=NumericalSemigroup(3,5,7);;
gap>  t:=NumericalSemigroup(4,6,9);;
gap> p:=NumericalSemigroupPolynomial(s,x);
x^5-x^4+x^3-x+1
gap> q:=NumericalSemigroupPolynomial(t,x);
x^12-x^11+x^8-x^7+x^6-x^5+x^4-x+1
gap> IsKroneckerPolynomial(p);
false
gap> IsKroneckerPolynomial(q);
true

gap> l:=CompleteIntersectionNumericalSemigroupsWithFrobeniusNumber(21);;
gap> ForAll(l,IsCyclotomicNumericalSemigroup);
true

gap> l:=IrreducibleNumericalSemigroupsWithFrobeniusNumber(13);;
gap> x:=X(Rationals,"x");;
gap> ForAll(l, s->
> IsSelfReciprocalUnivariatePolynomial(NumericalSemigroupPolynomial(s,x)));
true

gap> s:=NumericalSemigroup(3,4);;
gap> CyclotomicExponentSequence(s,20);
10, -1, -100000001 ]
gap> s:=NumericalSemigroup(3,5,7);;
gap> CyclotomicExponentSequence(s,20);
10, -10, -10, -1001010100, -10, -10 ]

gap> s:=NumericalSemigroup(3,4);;
gap> x:=Indeterminate(Rationals,"x");;
gap> p:=NumericalSemigroupPolynomial(s,x);;
gap> WittCoefficients(p,20);
10, -1, -10000000100000000 ]


# Semigroup of values of algebraic curves
gap> x:=Indeterminate(Rationals,1);; SetName(x,"x");
gap> y:=Indeterminate(Rationals,2);; SetName(y,"y");
gap> f:=((y^3-x^2)^2-x*y^2)^4-(y^3-x^2);;
gap> SemigroupOfValuesOfPlaneCurveWithSinglePlaceAtInfinity(f,"all");
[ [ 2416287 ], [ y, y^3-x^2, y^6-2*x^2*y^3+x^4-x*y^2 ] ]

gap> IsDeltaSequence([24,16,28,7]);
true

gap> DeltaSequencesWithFrobeniusNumber(21);
[ [ 8611 ], [ 10415 ], [ 128611 ], [ 14411 ],
  [ 15104 ], [ 232 ] ]

gap> CurveAssociatedToDeltaSequence([24,16,28,7]);
y^24-8*x^2*y^21+28*x^4*y^18-56*x^6*y^15-4*x*y^20+70*x^8*y^12+24*x^3*y^17-56*x^\
10*y^9-60*x^5*y^14+28*x^12*y^6+80*x^7*y^11+6*x^2*y^16-8*x^14*y^3-60*x^9*y^8-24\
*x^4*y^13+x^16+24*x^11*y^5+36*x^6*y^10-4*x^13*y^2-24*x^8*y^7-4*x^3*y^12+6*x^10\
*y^4+8*x^5*y^9-4*x^7*y^6+x^4*y^8-y^3+x^2
gap> SemigroupOfValuesOfPlaneCurveWithSinglePlaceAtInfinity(last,"all");
[ [ 2416287 ], [ y, y^3-x^2, y^6-2*x^2*y^3+x^4-x*y^2 ] ]

# NEEDS singular
# gap> x:=X(Rationals,"x");; y:=X(Rationals,"y");;
# gap> f:= y^4-2*x^3*y^2-4*x^5*y+x^6-x^7;
# -x^7+x^6-4*x^5*y-2*x^3*y^2+y^4
# gap> SemigroupOfValuesOfPlaneCurve(f);
# <Numerical semigroup with 3 generators>
# gap> MinimalGenerators(last);
# [ 4613 ]
# gap> f:=(y^4-2*x^3*y^2-4*x^5*y+x^6-x^7)*(y^2-x^3);;
# gap> SemigroupOfValuesOfPlaneCurve(f);
# <Good semigroup>
# gap> MinimalGenerators(last);
# [ [ 42 ], [ 63 ], [ 1315 ], [ 2913 ] ]

gap> x:=Indeterminate(Rationals,"x");;
gap> SemigroupOfValuesOfCurve_Local([x^4,x^6+x^7,x^13]);
<Numerical semigroup with 4 generators>
gap> MinimalGeneratingSystem(last);
461315 ]
gap> SemigroupOfValuesOfCurve_Local([x^4,x^6+x^7,x^13], "basis");
[ x^4, x^7+x^6, x^13, x^15 ]
gap> SemigroupOfValuesOfCurve_Local([x^4,x^6+x^7,x^13], 20);
x^20

gap> x:=Indeterminate(Rationals,"x");;
gap> SemigroupOfValuesOfCurve_Global([x^4,x^6+x^7,x^13]);
<Numerical semigroup with 3 generators>
gap> MinimalGeneratingSystem(last);
4713 ]
gap> SemigroupOfValuesOfCurve_Global([x^4,x^6+x^7,x^13],"basis");
[ x^4, x^7+x^6, x^13 ]
gap> SemigroupOfValuesOfCurve_Global([x^4,x^6+x^7,x^13],12);
x^12
gap> SemigroupOfValuesOfCurve_Global([x^4,x^6+x^7,x^13],6);
fail

gap> t:=Indeterminate(Rationals,"t");;
gap> A:=[t^6+t,t^4];;
gap> M:=[t^3,t^4];;
gap> GeneratorsModule_Global(A,M);
[ t^3, t^4, t^5, t^6 ]

gap> t:=Indeterminate(Rationals,"t");;
gap> GeneratorsKahlerDifferentials([t^3,t^4]);
[ t^2, t^3 ]

gap> IsMonomialNumericalSemigroup(NumericalSemigroup(4,6,7));
true
gap> IsMonomialNumericalSemigroup(NumericalSemigroup(4,6,11));
false

##affine.xml

gap> s1 := AffineSemigroup([1,3],[7,2],[1,5]);
<Affine semigroup in 2 dimensional space, with 3 generators>
gap> s2 := AffineSemigroup([[1,3],[7,2],[1,5]]);;
gap> s3 := AffineSemigroupByGenerators([1,3],[7,2],[1,5]);;
gap> s4 := AffineSemigroupByGenerators([[1,3],[7,2],[1,5]]);;
gap> s5 := AffineSemigroup("generators",[[1,3],[7,2],[1,5]]);;
gap> Length(Set([s1,s2,s3,s4,s5]));
1

gap> s1 := AffineSemigroup("equations",[[[-2,1]],[3]]);
<Affine semigroup>
gap> s2 := AffineSemigroupByEquations([[[-2,1]],[3]]);
<Affine semigroup>
gap> s1=s2;
true

gap> a1:=AffineSemigroup("inequalities",[[2,-1],[-1,3]]);
<Affine semigroup>
gap> a2:=AffineSemigroupByInequalities([[2,-1],[-1,3]]);
<Affine semigroup>
gap> a1=a2;
true

gap> s:=AffineSemigroupByPMInequality([0110, -1], 4, [10, -2, -31]);
<Affine semigroup>
gap> [ 300412 ] in s;
true
gap> [ 30041 ] in s;
false

gap> gaps := [[1,0,0,0],[1,1,0,0],[2,0,0,0],[2,1,0,0],[5,0,0,0]];;
gap> a1 := AffineSemigroup("gaps", gaps );
<Affine semigroup>
gap> a2 := AffineSemigroupByGaps( gaps );
<Affine semigroup>
gap> a1 = a2;
true
gap> Generators(a1);;
gap> Set(last);
[ [ 0001 ], [ 0010 ], [ 0100 ], [ 1001 ], 
  [ 1010 ], [ 1200 ], [ 2001 ], [ 2010 ], 
  [ 2200 ], [ 3000 ], [ 4000 ], [ 5100 ] ]

gap> a:=AffineSemigroup([[1,0,0,0],[3,1,0,0],[1,2,0,0],[0,0,1,0],
> [0,2,1,0],[0,1,1,0],[0,0,0,1],[0,2,0,1],[0,1,0,1],[0,3,0,0],
> [0,5,0,0],[0,4,0,0]]);
<Affine semigroup in 4 dimensional space, with 12 generators>
gap> Set(Gaps(a));
[ [ 0100 ], [ 0200 ], [ 1100 ], [ 2100 ] ]
gap> n := AffineSemigroup([1,1],[0,1]);;
gap> Gaps(n);
#I  The given affine semigroup has infinitely many gaps
fail

gap> a:=AffineSemigroup([[1,0,0,0],[3,1,0,0],[1,2,0,0],[0,0,1,0],
> [0,2,1,0],[0,1,1,0],[0,0,0,1],[0,2,0,1],[0,1,0,1],[0,3,0,0],
> [0,5,0,0]]);
<Affine semigroup in 4 dimensional space, with 11 generators>
gap> Genus(a);
7
gap> n := AffineSemigroup([1,1],[0,1]);;
gap> Genus(n);
#I  The given affine semigroup has infinitely many gaps
infinity
gap> last > 10^50;
true

gap> a:=AffineSemigroup([[1,0,0,0],[3,1,0,0],[1,2,0,0],[0,0,1,0],
> [0,2,1,0],[0,1,1,0],[0,0,0,1],[0,2,0,1],[0,1,0,1],[0,3,0,0],
> [0,5,0,0],[0,4,0,0]]);
<Affine semigroup in 4 dimensional space, with 12 generators>
gap> PseudoFrobenius(a);
[ [ 0200 ], [ 2100 ] ]

gap> a:=AffineSemigroup([[1,0,0,0],[3,1,0,0],[1,2,0,0],[0,0,1,0],
> [0,2,1,0],[0,1,1,0],[0,0,0,1],[0,2,0,1],[0,1,0,1],[0,3,0,0],
> [0,5,0,0],[0,4,0,0]]);
<Affine semigroup in 4 dimensional space, with 12 generators>
gap> SpecialGaps(a);
[ [ 0200 ], [ 2100 ] ]

gap> a:=AffineSemigroup([[1,0],[0,1],[1,1]]);
<Affine semigroup in 2 dimensional space, with 3 generators>
gap> Generators(a);
[ [ 01 ], [ 10 ], [ 11 ] ]

gap> a:=AffineSemigroup([[1,0],[0,1],[1,1]]);
<Affine semigroup in 2 dimensional space, with 3 generators>
gap> MinimalGenerators(a);
[ [ 01 ], [ 10 ] ]

gap> a:=AffineSemigroup([2,0],[0,4]);
<Affine semigroup in 2 dimensional space, with 2 generators>
gap> b:=RemoveMinimalGeneratorFromAffineSemigroup([2,0],a);Generators(b);
<Affine semigroup in 2 dimensional space, with 4 generators>
[ [ 04 ], [ 24 ], [ 40 ], [ 60 ] ]

gap> s:=AffineSemigroup([[2,0],[3,0],[0,4],[0,5],[1,1]]);
<Affine semigroup in 2 dimensional space, with 5 generators>
gap> t:=AddSpecialGapOfAffineSemigroup([1,12],s);
<Affine semigroup in 2 dimensional space, with 6 generators>
gap> Gaps(s);
[ [ 01 ], [ 02 ], [ 03 ], [ 06 ], [ 07 ], [ 011 ], [ 10 ], [ 12 ], [ 13 ], [ 14 ],
17 ], [ 18 ], [ 112 ], [ 21 ], [ 23 ], [ 32 ], [ 43 ] ]
gap> Gaps(t);
[ [ 01 ], [ 02 ], [ 03 ], [ 06 ], [ 07 ], [ 011 ], [ 10 ], [ 12 ], [ 13 ], [ 14 ],
17 ], [ 18 ], [ 21 ], [ 23 ], [ 32 ], [ 43 ] ]

gap>  s:=NumericalSemigroup(1310,1411,1546,1601);
<Numerical semigroup with 4 generators>
gap> a:=AsAffineSemigroup(s);
<Affine semigroup in 1 dimensional space, with 4 generators>
gap> GeneratorsOfAffineSemigroup(a);
[ [ 1310 ], [ 1411 ], [ 1546 ], [ 1601 ] ]

gap> a1:=AffineSemigroup([[3,0],[2,1],[1,2],[0,3]]);
<Affine semigroup in 2 dimensional space, with 4 generators>
gap> IsAffineSemigroupByEquations(a1);
false
gap> IsAffineSemigroupByGenerators(a1);
true
gap> ns := NumericalSemigroup(3,5);
<Numerical semigroup with 2 generators>
gap> IsAffineSemigroup(ns);
false
gap> as := AsAffineSemigroup(ns);
<Affine semigroup in 1 dimensional space, with 2 generators>
gap> IsAffineSemigroup(as);
true

gap> a:=AffineSemigroup([[2,0],[0,2],[1,1]]);;
gap> BelongsToAffineSemigroup([5,5],a);
true
gap> BelongsToAffineSemigroup([1,2],a);
false
gap> [5,5] in a;
true
gap> [1,2] in a;
false

gap> a:=AffineSemigroup("equations",[[[1,1,1],[0,0,2]],[2,2]]);;
gap> IsFull(a);
true
gap> IsFullAffineSemigroup(a);
true

gap> HilbertBasisOfSystemOfHomogeneousEquations([[1,0,1],[0,1,-1]],[2]);
[ [ 022 ], [ 111 ], [ 200 ] ]

gap> HilbertBasisOfSystemOfHomogeneousInequalities([[2,-3],[0,1]]);
[ [ 10 ], [ 21 ], [ 32 ] ]

gap> EquationsOfGroupGeneratedBy([[1,2,0],[2,-2,2]]);
[ [ [ 00, -1 ], [ -213 ] ], [ 2 ] ]

gap> BasisOfGroupGivenByEquations([[0,0,1],[2,-1,-3]],[2]);
[ [ -1, -20 ], [ -22, -2 ] ]

gap> a1:=AffineSemigroup([[2,0],[0,2]]);
<Affine semigroup in 2 dimensional space, with 2 generators>
gap> a2:=AffineSemigroup([[1,1]]);
<Affine semigroup in 2 dimensional space, with 1 generator>
gap> GluingOfAffineSemigroups(a1,a2);
<Affine semigroup in 2 dimensional space, with 3 generators>
gap> Generators(last);
[ [ 02 ], [ 11 ], [ 20 ] ]

gap> s:=NumericalSemigroup(4,6,9);;
gap> CircuitsOfKernelCongruence([[4],[6],[9]]);
[ [ [ 300 ], [ 020 ] ], [ [ 900 ], [ 004 ] ], [ [ 030 ], [ 002 ] ] ]
gap> MinimalPresentation(s);
[ [ [ 002 ], [ 030 ] ], [ [ 020 ], [ 300 ] ] ]

gap> PrimitiveRelationsOfKernelCongruence([[4],[6],[9]]);
[ [ [ 002 ], [ 030 ] ], [ [ 002 ], [ 310 ] ], 
  [ [ 004 ], [ 900 ] ], [ [ 012 ], [ 600 ] ], 
  [ [ 020 ], [ 300 ] ] ]

gap> M := [[2,0],[0,2],[1,1]];
[ [ 20 ], [ 02 ], [ 11 ] ]
gap> GeneratorsOfKernelCongruence(M);
[ [ [ 002 ], [ 110 ] ] ]

gap> M:=[[3],[5],[7]];;
gap> CanonicalBasisOfKernelCongruence(M,MonomialLexOrdering());
[ [ [ 070 ], [ 005 ] ], [ [ 101 ], [ 020 ] ],
[ [ 150 ], [ 004 ] ], [ [ 230 ], [ 003 ] ],
[ [ 310 ], [ 002 ] ], [ [ 400 ], [ 011 ] ] ]
gap> CanonicalBasisOfKernelCongruence(M,MonomialGrlexOrdering());
[ [ [ 070 ], [ 005 ] ], [ [ 101 ], [ 020 ] ],
[ [ 150 ], [ 004 ] ], [ [ 230 ], [ 003 ] ],
[ [ 310 ], [ 002 ] ], [ [ 400 ], [ 011 ] ] ]
gap> CanonicalBasisOfKernelCongruence(M,MonomialGrevlexOrdering());
[ [ [ 020 ], [ 101 ] ], [ [ 310 ], [ 002 ] ],
[ [ 400 ], [ 011 ] ] ]

gap> gr:=GraverBasis([[3,5,7]]);
[ [ -703 ], [ -530 ], [ -411 ], [ -3, -12 ], [ -2, -33 ],
  [ -1, -54 ], [ -12, -1 ], [ 0, -75 ], [ 07, -5 ], [ 1, -21 ],
  [ 15, -4 ], [ 23, -3 ], [ 31, -2 ], [ 4, -1, -1 ], [ 5, -30 ],
  [ 70, -3 ] ]

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> MinimalPresentation(a);
[ [ [ 020 ], [ 101 ] ] ]
gap> MinimalPresentationOfAffineSemigroup(a);
[ [ [ 020 ], [ 101 ] ] ]

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> BettiElements(a);
[ [ 22 ] ]
gap> BettiElementsOfAffineSemigroup(a);
[ [ 22 ] ]

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> DegreesOfPrimitiveElementsOfAffineSemigroup(a);
[ [ 02 ], [ 11 ], [ 20 ], [ 22 ] ]

gap> Set(FactorizationsVectorWRTList([5,5],[[2,0],[0,2],[1,1]]));
[ [ 005 ], [ 113 ], [ 221 ] ]

gap> Set(FactorizationsVectorWRTList([7000],[[101],[102],[303]]));
[ [ 23112 ], [ 53111 ], [ 83110 ], [ 11319 ], [ 14318 ], 
  [ 17317 ], [ 20316 ], [ 23315 ], [ 26314 ], [ 29313 ], 
  [ 32312 ], [ 35311 ], [ 38310 ] ]

gap> a:=AffineSemigroup([[2,0],[0,2],[1,1]]);;
gap> Elasticity([5,5],a);
1
gap> Elasticity(a,[5,5]);
1
gap> ElasticityOfFactorizationsElementWRTAffineSemigroup([5,5],a);
1

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> Elasticity(a);
1
gap> ElasticityOfAffineSemigroup(a);
1

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> DeltaSet(a);
[  ]
gap> s:=NumericalSemigroup(10,13,15,47);;
gap> a:=AsAffineSemigroup(s);;
gap> DeltaSetOfAffineSemigroup(a);
1235 ]

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> CatenaryDegree(a);
2
gap> CatenaryDegreeOfAffineSemigroup(a);
2

gap> a:=AffineSemigroup("inequalities",[[2,-1],[-1,3]]);
<Affine semigroup>
gap> GeneratorsOfAffineSemigroup(a);
[ [ 11 ], [ 12 ], [ 21 ], [ 31 ] ]
gap> CatenaryDegreeOfAffineSemigroup(a);
3
gap> EqualCatenaryDegreeOfAffineSemigroup(a);
2
gap> HomogeneousCatenaryDegreeOfAffineSemigroup(a);
3
gap> MonotoneCatenaryDegreeOfAffineSemigroup(a);
3

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> TameDegree(a);
2
gap> TameDegreeOfAffineSemigroup(a);
2

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> OmegaPrimality([5,5],a);
6
gap> OmegaPrimalityOfElementInAffineSemigroup([5,5],a);
6

gap> a:=AffineSemigroup([2,0],[0,2],[1,1]);;
gap> OmegaPrimality(a);
2
gap> OmegaPrimalityOfAffineSemigroup(a);
2

# ideals of affine semigroups

gap> a:=AffineSemigroup([2,0],[0,2]);;
gap> i:=IdealOfAffineSemigroup([[1,0],[0,3]],a);
<Ideal of affine semigroup>
gap> [[1,0],[0,3]]+a=i;
true
gap> [0,1]+a;
<Ideal of affine semigroup>
gap> IsSubset(i,[1,0]+a);
true
gap> IsSubset([1,0]+a,i);
false
gap> IsIdealOfAffineSemigroup(i);
true
gap> i:=[[1,0],[3,0]]+AffineSemigroup([2,0],[0,2]);;
gap> Generators(i);
[ [ 10 ], [ 30 ] ]
gap> MinimalGenerators(i);
[ [ 10 ] ]
gap> AmbientAffineSemigroupOfIdeal(i)=a;
true
gap> IsIntegral([1,0]+a);
false
gap> IsIntegral([2,0]+a);
true
gap> i:=[2,0]+a;;
gap> [2,0] in i;
true
gap> [4,4] in i;
true
gap> [1,2] in i;
false
gap> j:=[[1,0],[0,1]]+a;;
gap> MinimalGenerators(i+j);
[ [ 21 ], [ 30 ] ]
gap> j:=[[1,0],[0,1]]+a;;
gap> MinimalGenerators(2*j);
[ [ 02 ], [ 11 ], [ 20 ] ]
gap> j:=[[1,0],[0,1]]+a;;
gap> MinimalGenerators([2,2]+j);
[ [ 23 ], [ 32 ] ]
gap> i:=[2,0]+a;;
gap> j:=[[1,0],[0,1]]+a;;
gap> MinimalGenerators(Union(i,j));
[ [ 01 ], [ 10 ], [ 20 ] ]
gap> a:=AffineSemigroup([1,0],[0,1]);;
gap> i:=[2,0]+a;;
gap> j:=[[1,0],[0,1]]+a;;
gap> MinimalGenerators(Intersection(i,j));
[ [ 20 ] ]
gap> a:=AffineSemigroup([2,0],[0,2]);;
gap> MinimalGenerators(MaximalIdeal(a));
[ [ 02 ], [ 20 ] ]



##good-semigroups.xml

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> l:=Cartesian([1..11],[1..11]);;
gap> Intersection(dup,l);
[ [ 33 ], [ 55 ], [ 66 ], [ 67 ], [ 68 ], [ 69 ], [ 610 ],
  [ 611 ], [ 76 ], [ 77 ], [ 86 ], [ 88 ], [ 96 ], [ 99 ],
  [ 910 ], [ 911 ], [ 106 ], [ 109 ], [ 1010 ], [ 116 ],
  [ 119 ], [ 1111 ] ]
gap> [384938749837,349823749827] in dup;
true

gap> s:=NumericalSemigroup(2,3);;
gap> t:=NumericalSemigroup(3,4);;
gap> e:=3+t;;
gap> dup:=AmalgamationOfNumericalSemigroups(s,e,2);;
gap> [2,3] in dup;
true

gap> s:=NumericalSemigroup(2,3);;
gap> t:=NumericalSemigroup(3,4);;
gap> IsGoodSemigroup(CartesianProductOfNumericalSemigroups(s,t));
true

gap> G:=[[4,3],[7,13],[11,17],[14,27],[15,27],[16,20],[25,12],[25,16]];
[ [ 43 ], [ 713 ], [ 1117 ], [ 1427 ], [ 1527 ], [ 1620 ],
  [ 2512 ], [ 2516 ] ]
gap> C:=[25,27];
2527 ]
gap> GoodSemigroup(G,C);
<Good semigroup>

gap> s:=NumericalSemigroup(2,3);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);;
gap> BelongsToGoodSemigroup([2,2],dup);
true
gap> [2,2] in dup;
true
gap> [3,2] in dup;
false

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> Conductor(dup);
1111 ]
gap> ConductorOfGoodSemigroup(dup);
1111 ]

gap> s:=GoodSemigroup([[2,2],[3,3]],[4,4]);
<Good semigroup>
gap> Multiplicity(s);
22 ]
gap> IsLocal(s);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> SmallElementsOfGoodSemigroup(dup);
[ [ 00 ], [ 33 ], [ 55 ], [ 66 ], [ 67 ], [ 68 ], [ 69 ],
  [ 610 ], [ 611 ], [ 76 ], [ 77 ], [ 86 ], [ 88 ], [ 96 ],
  [ 99 ], [ 910 ], [ 911 ], [ 106 ], [ 109 ], [ 1010 ],
  [ 116 ], [ 119 ], [ 1111 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> SmallElements(dup);
[ [ 00 ], [ 33 ], [ 55 ], [ 66 ], [ 67 ], [ 68 ], [ 69 ],
  [ 610 ], [ 611 ], [ 76 ], [ 77 ], [ 86 ], [ 88 ], [ 96 ],
  [ 99 ], [ 910 ], [ 911 ], [ 106 ], [ 109 ], [ 1010 ],
  [ 116 ], [ 119 ], [ 1111 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> SmallElementsOfGoodSemigroup(dup);
[ [ 00 ], [ 33 ], [ 55 ], [ 66 ], [ 67 ], [ 68 ], [ 69 ], [ 610 ],
  [ 611 ], [ 76 ], [ 77 ], [ 86 ], [ 88 ], [ 96 ], [ 99 ], [ 910 ],
  [ 911 ], [ 106 ], [ 109 ], [ 1010 ], [ 116 ], [ 119 ], [ 1111 ] ]
gap> RepresentsSmallElementsOfGoodSemigroup(last);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> SmallElementsOfGoodSemigroup(dup);
[ [ 00 ], [ 33 ], [ 55 ], [ 66 ], [ 67 ], [ 68 ], [ 69 ], [ 610 ],
  [ 611 ], [ 76 ], [ 77 ], [ 86 ], [ 88 ], [ 96 ], [ 99 ], [ 910 ],
  [ 911 ], [ 106 ], [ 109 ], [ 1010 ], [ 116 ], [ 119 ], [ 1111 ] ]
gap> G:=GoodSemigroupBySmallElements(last);
<Good semigroup>
gap> dup=G;
true

gap> G:=[[4,3],[7,13],[11,17]];;
gap> g:=GoodSemigroup(G,[11,17]);;
gap> mx:=MaximalElementsOfGoodSemigroup(g);
[ [ 00 ], [ 43 ], [ 713 ], [ 86 ] ]

gap> G:=[[4,3],[7,13],[11,17]];;
gap> g:=GoodSemigroup(G,[11,17]);;
gap> IrreducibleMaximalElementsOfGoodSemigroup(g);
[ [ 43 ], [ 713 ] ]

gap> G:=[[4,3],[7,13],[11,17]];;
gap> g:=GoodSemigroup(G,[11,17]);;
gap> sm:=SmallElements(g);;
gap> mx:=MaximalElementsOfGoodSemigroup(g);;
gap> s:=NumericalSemigroupBySmallElements(Set(sm,x->x[1]));;
gap> t:=NumericalSemigroupBySmallElements(Set(sm,x->x[2]));;
gap> Conductor(g);
1115 ]
gap> gg:=GoodSemigroupByMaximalElements(s,t,mx,[11,15]);
<Good semigroup>
gap> gg=g;
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=6+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);
<Good semigroup>
gap> MinimalGoodGeneratingSystemOfGoodSemigroup(dup);
[ [ 33 ], [ 55 ], [ 611 ], [ 77 ], [ 116 ] ]
gap> MinimalGoodGenerators(dup);
[ [ 33 ], [ 55 ], [ 611 ], [ 77 ], [ 116 ] ]

## Nicola's implementations

gap> smalls := [ [ 00 ], [ 45 ], [ 46 ], [ 85 ],
> [ 87 ], [ 88 ], [ 810 ], [ 115 ], [ 117], [ 118 ], [ 1110 ], 
> [ 125 ], [ 127 ], [ 128 ], [ 1210 ], [ 155 ], [ 157 ], [ 158 ],
> [ 1510 ], [ 165 ], [ 167 ], [ 168 ], [ 1610 ], [ 185 ], [ 197 ],
> [ 198 ], [ 1910 ], [ 207 ], [ 208 ], [ 2010 ], [ 227 ], [ 228 ],
> [ 2210 ], [ 237 ], [ 238 ], [ 2310 ], [ 247 ], [ 248 ], [ 2410 ],
> [ 257 ], [ 258 ], [ 267 ], [ 2610 ] ];
[ [ 00 ], [ 45 ], [ 46 ], [ 85 ], [ 87 ], [ 88 ], [ 810 ], 
  [ 115 ], [ 117 ], [ 118 ], [ 1110 ], [ 125 ], [ 127 ], 
  [ 128 ], [ 1210 ], [ 155 ], [ 157 ], [ 158 ], [ 1510 ], 
  [ 165 ], [ 167 ], [ 168 ], [ 1610 ], [ 185 ], [ 197 ], 
  [ 198 ], [ 1910 ], [ 207 ], [ 208 ], [ 2010 ], [ 227 ], 
  [ 228 ], [ 2210 ], [ 237 ], [ 238 ], [ 2310 ], [ 247 ], 
  [ 248 ], [ 2410 ], [ 257 ], [ 258 ], [ 267 ], [ 2610 ] ]
gap> S:=GoodSemigroupBySmallElements(smalls);
<Good semigroup>

gap> S1:=ProjectionOfGoodSemigroup(S,1);;
gap> SmallElements(S1);
0481112151618192022 ]
gap> S2:=ProjectionOfGoodSemigroup(S,2);;
gap> SmallElements(S2);
0567810 ]

gap> GenusOfGoodSemigroup(S);
21

gap> Length(S);
15
gap> LengthOfGoodSemigroup(S);
15

gap> AperySetOfGoodSemigroup(S);
[ [ 00 ], [ 46 ], [ 85 ], [ 87 ], [ 88 ], [ 812 ], [ 813 ], 
  [ 814 ], [ 815 ], [ 115 ], [ 117 ], [ 118 ], [ 1110 ], 
  [ 1111 ], [ 1112 ], [ 1113 ], [ 1114 ], [ 1115 ], [ 125 ], 
  [ 127 ], [ 128 ], [ 1211 ], [ 1214 ], [ 155 ], [ 157 ], 
  [ 158 ], [ 1511 ], [ 1514 ], [ 165 ], [ 167 ], [ 168 ], 
  [ 1611 ], [ 1614 ], [ 185 ], [ 197 ], [ 198 ], [ 1911 ], 
  [ 1914 ], [ 207 ], [ 208 ], [ 2011 ], [ 2014 ], [ 227 ], 
  [ 228 ], [ 2211 ], [ 2212 ], [ 2213 ], [ 2214 ], [ 2215 ], 
  [ 237 ], [ 238 ], [ 2310 ], [ 2311 ], [ 2314 ], [ 247 ], 
  [ 248 ], [ 2410 ], [ 2411 ], [ 2414 ], [ 257 ], [ 258 ], 
  [ 267 ], [ 2610 ], [ 2611 ], [ 2614 ], [ 277 ], [ 2710 ], 
  [ 2711 ], [ 2714 ], [ 287 ], [ 2810 ], [ 2811 ], [ 2814 ], 
  [ 297 ], [ 2910 ], [ 2911 ], [ 2914 ], [ 2915 ], [ 307 ], 
  [ 3010 ], [ 3011 ], [ 3013 ], [ 3014 ] ]

gap> StratifiedAperySetOfGoodSemigroup(S);
[ [ [ 00 ] ], [ [ 46 ], [ 85 ], [ 115 ] ], 
  [ [ 87 ], [ 117 ], [ 125 ], [ 155 ], [ 165 ], [ 185 ] ], 
  [ [ 88 ], [ 118 ], [ 127 ], [ 157 ], [ 167 ], [ 197 ], 
      [ 207 ], [ 227 ], [ 237 ], [ 247 ], [ 257 ] ], 
  [ [ 812 ], [ 813 ], [ 814 ], [ 1110 ], [ 1111 ], [ 128 ], 
      [ 158 ], [ 168 ], [ 198 ], [ 208 ], [ 228 ], [ 238 ], 
      [ 248 ], [ 258 ], [ 267 ], [ 277 ], [ 287 ], [ 297 ], 
      [ 307 ] ], 
  [ [ 815 ], [ 1112 ], [ 1113 ], [ 1114 ], [ 1211 ], [ 1511 ], 
      [ 1611 ], [ 1911 ], [ 2011 ], [ 2211 ], [ 2310 ], [ 2410 ], 
      [ 2610 ], [ 2710 ], [ 2810 ], [ 2910 ], [ 3010 ] ], 
  [ [ 1115 ], [ 1214 ], [ 1514 ], [ 1614 ], [ 1914 ], [ 2014 ], 
      [ 2212 ], [ 2213 ], [ 2214 ], [ 2311 ], [ 2411 ], [ 2611 ], 
      [ 2711 ], [ 2811 ], [ 2911 ], [ 3011 ] ], 
  [ [ 2215 ], [ 2314 ], [ 2414 ], [ 2614 ], [ 2714 ], [ 2814 ], 
  [ 2914 ], [ 3013 ] ], [ [ 2915 ], [ 3014 ] ] ]


gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=CanonicalIdealOfNumericalSemigroup(s);;
gap> e:=15+e;;
gap> dup:=NumericalSemigroupDuplication(s,e);;
gap> IsSymmetricGoodSemigroup(dup);
true

gap> G:=[[3,3],[4,4],[5,4],[4,6]];
[ [ 33 ], [ 44 ], [ 54 ], [ 46 ] ]
gap> C:=[6,6];
66 ]
gap> S:=GoodSemigroup(G,C);
<Good semigroup>
gap> SmallElements(S);
[ [ 00 ], [ 33 ], [ 44 ], [ 46 ], [ 54 ], [ 66 ] ]
gap> A:=ArfClosure(S);
<Good semigroup>
gap> SmallElements(A);
[ [ 00 ], [ 33 ], [ 44 ] ]
gap> ArfGoodSemigroupClosure(S) = ArfClosure(S);
true

#Good ideals

gap> G:=[[4,3],[7,13],[11,17],[14,27],[15,27],[16,20],[25,12],[25,16]];
[ [ 43 ], [ 713 ], [ 1117 ], [ 1427 ], [ 1527 ], [ 1620 ],
2512 ], [ 2516 ] ]
gap> C:=[25,27];
2527 ]
gap> g := GoodSemigroup(G,C);
<Good semigroup>
gap> i:=GoodIdeal([[2,3]],g);
<Good ideal of good semigroup>

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> d:=NumericalSemigroupDuplication(s,e);;
gap> e:=GoodIdeal([[2,3],[3,2],[2,2]],d);;
gap> GoodGeneratingSystemOfGoodIdeal(e);
[ [ 22 ], [ 23 ], [ 32 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> a:=AmalgamationOfNumericalSemigroups(s,e,5);;
gap> e:=GoodIdeal([[2,3],[3,2],[2,2]],a);;
gap> a=AmbientGoodSemigroupOfGoodIdeal(e);
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> d:=NumericalSemigroupDuplication(s,e);;
gap> e:=GoodIdeal([[2,3],[3,2],[2,2]],d);;
gap> MinimalGoodGeneratingSystemOfGoodIdeal(e);
[ [ 23 ], [ 32 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> d:=NumericalSemigroupDuplication(s,e);;
gap> e:=GoodIdeal([[2,3],[3,2]],d);;
gap> [1,1] in e;
false
gap> [2,2] in e;
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> d:=NumericalSemigroupDuplication(s,e);;
gap> e:=GoodIdeal([[2,3],[3,2]],d);;
gap> SmallElements(e);
[ [ 22 ], [ 23 ], [ 32 ], [ 55 ], [ 56 ], [ 65 ], [ 77 ] ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> e:=10+s;;
gap> d:=NumericalSemigroupDuplication(s,e);;
gap> c:=CanonicalIdealOfGoodSemigroup(d);;
gap> MinimalGoodGeneratingSystemOfGoodIdeal(c);
[ [ 00 ], [ 22 ] ]

gap> S:=GoodSemigroupBySmallElements([ [ 00 ], [ 54 ], [ 58 ], [ 511 ],
> [ 512 ], [ 513 ], [ 64 ], [ 78 ], [ 711 ], [ 712 ], [ 714 ],
> [ 88 ], [ 811 ], [ 812 ], [ 815 ], [ 816 ], [ 817 ], [ 818 ], 
> [ 108 ], [ 1011 ], [ 1012 ], [ 1015 ], [ 1016 ], [ 1017 ], 
> [ 1018 ], [ 118 ], [ 1111 ], [ 1112 ], [ 1115 ], [ 1116 ],
> [ 1117 ], [ 128 ], [ 1211 ], [ 1212 ], [ 1215 ], [ 1216 ], 
> [ 1218 ] ]);
<Good semigroup>
gap> AbsoluteIrreduciblesOfGoodSemigroup(S);
[ [ 513 ], [ 64 ], [ 714 ], [ 8, infinity ], [ 10, infinity ], 
  [ 12, infinity ], [ infinity, 8 ], [ infinity, 11 ], [ infinity, 18 ] ]

gap> S:=GoodSemigroupBySmallElements([ [ 00 ], [ 43 ], [ 86 ], [ 87 ],
> [ 126 ], [ 129 ], [ 1210 ], [ 166 ], [ 169 ], [ 1612 ], [ 1613 ],
> [ 1614 ], [ 186 ], [ 209 ], [ 2012 ], [ 2013 ], [ 2015 ], [ 2016 ],
> [ 2017 ], [ 229 ], [ 2412 ], [ 2413 ], [ 2415 ], [ 2416 ], [ 2418 ],
> [ 2612 ], [ 2613 ], [ 2812 ], [ 2815 ], [ 2816 ], [ 2818 ],[ 3012 ], 
> [ 3015 ], [ 3016 ], [ 3018 ] ]);
<Good semigroup>
gap> TracksOfGoodSemigroup(S);
[ [ [ 43 ] ], [ [ 87 ], [ 186 ] ], 
  [ [ 30, infinity ], [ infinity, 16 ] ], 
  [ [ 31, infinity ], [ infinity, 16 ] ], [ [ 31, infinity ] ], 
  [ [ 33, infinity ], [ infinity, 16 ] ], [ [ 33, infinity ] ] ]

##dot.xml
gap> br:=BinaryRelationByElements(Domain([1,2]), [DirectProductElement([1,2])]);;
gap> Print(DotBinaryRelation(br));
digraph  NSGraph{rankdir = TB; edge[dir=back];
1 [label="1"];
2 [label="2"];
2 -> 1;
}

gap> s:=NumericalSemigroup(3,5,7);;
gap> IsHasseDiagram(HasseDiagramOfNumericalSemigroup(s,[1,2,3]));
true

gap> s:=NumericalSemigroup(3,5,7);;
gap> hb:=HasseDiagramOfBettiElementsOfNumericalSemigroup(s);;
gap> List(Source(hb));
101214 ]

gap> s:=NumericalSemigroup(3,5,7);;
gap> h:=HasseDiagramOfAperyListOfNumericalSemigroup(s);;
gap> Source(h)=Set(AperyList(s));
true
gap> h:=HasseDiagramOfAperyListOfNumericalSemigroup(s,10);;
gap> Source(h)=Set(AperyList(s,10));
true

#gap> s:=NumericalSemigroup(4,6,9);;
#gap> Print(DotTreeOfGluingsOfNumericalSemigroup(s));
#digraph  NSGraph{rankdir = TB; 
#0 [label="〈 469 〉"]; 
#0 [label="〈 469 〉", style=filled]; 
#1 [label="〈 4 〉 + 〈 69 〉" , shape=box]; 
#2 [label="〈 1 〉", style=filled]; 
#3 [label="〈 23 〉", style=filled]; 
#4 [label="〈 2 〉 + 〈 3 〉" , shape=box]; 
#5 [label="〈 1 〉", style=filled]; 
#6 [label="〈 1 〉", style=filled]; 
#7 [label="〈 46 〉 + 〈 9 〉" , shape=box]; 
#8 [label="〈 23 〉", style=filled]; 
#10 [label="〈 2 〉 + 〈 3 〉" , shape=box]; 
#11 [label="〈 1 〉", style=filled]; 
#12 [label="〈 1 〉", style=filled]; 
#9 [label="〈 1 〉", style=filled]; 
#0 -> 1
#1 -> 2
#1 -> 3
#3 -> 4
#4 -> 5
#4 -> 6
#0 -> 7
#7 -> 8
#7 -> 9
#8 -> 10
#10 -> 11
#10 -> 12
#}
#
#gap> s:=NumericalSemigroup(4,6,9);;
#gap> Print(DotOverSemigroupsNumericalSemigroup(s));
#digraph  NSGraph{rankdir = TB; edge[dir=back];
#1 [label="〈 1 〉", style=filled];
#2 [label="〈 23 〉", style=filled];
#3 [label="〈 25 〉", style=filled];
#4 [label="〈 27 〉", style=filled];
#5 [label="〈 29 〉", style=filled];
#6 [label="〈 345 〉", style=filled];
#7 [label="〈 34 〉", style=filled];
#8 [label="〈 4567 〉"];
#9 [label="〈 456 〉", style=filled];
#10 [label="〈 4679 〉"];
#11 [label="〈 46911 〉"];
#12 [label="〈 469 〉", style=filled];
#1 -> 2;
#2 -> 3;
#2 -> 6;
#3 -> 4;
#3 -> 8;
#4 -> 5;
#4 -> 10;
#5 -> 11;
#6 -> 7;
#6 -> 8;
#7 -> 10;
#8 -> 9;
#8 -> 10;
#9 -> 11;
#10 -> 11;
#11 -> 12;
#}

gap> s:=NumericalSemigroup(4,6,9);;
gap> Print(DotRosalesGraph(15,s));
graph  NSGraph{
1 [label="6"];
2 [label="9"];
2 -- 1;
}

gap> f:=FactorizationsIntegerWRTList(20,[3,5,7]);
[ [ 510 ], [ 040 ], [ 121 ], [ 202 ] ]
gap> Print(DotFactorizationGraph(f));
graph  NSGraph{
1 [label=" (510)"];
2 [label=" (040)"];
3 [label=" (121)"];
4 [label=" (202)"];
2 -- 3[label="2", color="red"];
3 -- 4[label="2", color="red"];
1 -- 3[label="4", color="red"];
1 -- 4[label="4" ];
2 -- 4[label="4" ];
1 -- 2[label="5" ];
}

gap> f:=FactorizationsIntegerWRTList(20,[3,5,7]);
[ [ 510 ], [ 040 ], [ 121 ], [ 202 ] ]
gap> Print(DotEliahouGraph(f));
graph  NSGraph{
1 [label=" (510)"];
2 [label=" (040)"];
3 [label=" (121)"];
4 [label=" (202)"];
2 -- 3[label="2" ];
3 -- 4[label="2" ];
1 -- 3[label="4" ];
1 -- 4[label="4" ];
1 -- 2[label="5" ];
}

gap> SetDotNSEngine("circo");
true


##generalstuff.xml



gap> BezoutSequence(4/5,53/27);
4/513/25/37/49/511/613/715/817/919/1021/1123/12,
  25/1327/1429/1531/1633/1735/1837/1939/2041/2143/22,
  45/2347/2449/2551/2653/27 ]

gap> IsBezoutSequence([ 4/513/25/37/49/511/6]);
true
gap> IsBezoutSequence([ 4/513/25/37/49/511/3]);
Take the 6 and the 7 elements of the sequence
false

gap> CeilingOfRational(3/5);
1

gap> RepresentsPeriodicSubAdditiveFunction([1,2,3,4,0]);
true

gap> IsListOfIntegersNS([1,-1,0]);
true

gap> IsListOfIntegersNS(2);
false

gap> IsListOfIntegersNS([[2],3]);
false

gap> IsListOfIntegersNS([]);
false

gap> IsListOfIntegersNS([1,1/2]);  
false

##random.xml

# RandomNumericalSemigroup(3,9,55);;
# RandomListForNS(13,1,79);;
# RandomModularNumericalSemigroup(9);;
# RandomModularNumericalSemigroup(10,25);;
# RandomProportionallyModularNumericalSemigroup(9);;
# RandomProportionallyModularNumericalSemigroup(10,25);;
# RandomListRepresentingSubAdditiveFunction(7,9);;
# RepresentsPeriodicSubAdditiveFunction(last);
# ns := NumericalSemigroupWithRandomElementsAndFrobenius(5,10,50);;
# MinimalGeneratingSystem(ns);;
# SmallElements(ns);;
# ns2 := NumericalSemigroupWithRandomElementsAndFrobenius(5,10,9);;
# ns3 := NumericalSemigroupWithRandomElementsAndFrobenius(5,10,10);;
# MinimalGeneratingSystem(ns3);;

#############################################################################
#############################################################################
# Simple examples aiming for a better code coverage

##obsolet
#gap> NumericalSemigroupByMinimalGenerators(3,5,6,7);
#I  The list [ 3567 ] can not be the minimal generating set. The list [ 357 ] will be used instead.
#<Numerical semigroup with 3 generators>

## irreducibles
gap> ns := NumericalSemigroup(5,7);;
gap> RemoveMinimalGeneratorFromNumericalSemigroup(5,ns);
<Numerical semigroup with 7 generators>
gap> SmallElements(last);
0710121415171920212224 ]

gap> IsFreeNumericalSemigroup(NumericalSemigroup(7,8,9,12,13));
false
gap> IsFreeNumericalSemigroup(NumericalSemigroup(8121819));
true

## ideals
gap> ns := NumericalSemigroup(5,7,9);;
gap> i := 3+ns;
<Ideal of numerical semigroup>
gap> Display(i);
[ [ 3 ], [ 8 ], [ 10 ], [ 1213 ], [ 15 ], [ 17, "->" ] ]
gap> j := 2+ns;
<Ideal of numerical semigroup>
gap> i<j;
false
gap> j<i;
true
gap> Generators(i);
3 ]
gap> it := Iterator(i);
<iterator>
gap> l:= [];; for i in [1..20] do Add( l, NextIterator( it ) ); od; l;
381012131517181920212223242526272829
  30 ]

##good
gap> e:=88+s;;
gap> dup:=NumericalSemigroupDuplication(s,e);;
gap> [ 110109 ] in dup;
true
gap> [87,109] in dup;
false



## get info level to the original state
gap> SetInfoLevel( InfoNumSgps, INFO_NSGPS);

gap> STOP_TEST( "testall.tst", 10000 );
## The first argument of STOP_TEST should be the name of the test file.
## The number is a proportionality factor that is used to output a
## "GAPstone" speed ranking after the file has been completely processed.
## For the files provided with the distribution this scaling is roughly
## equalized to yield the same numbers as produced by the test file
## tst/combinat.tst. For package tests, you may leave it unchnaged.

#############################################################################
##

[0.85QuellennavigatorsProjekt 2026-06-17]