diff --git a/PackageInfo.g b/PackageInfo.g
index 7687471..8bfe1cd 100644
--- a/PackageInfo.g
+++ b/PackageInfo.g
@@ -1,18 +1,18 @@
#############################################################################
##
-#W PackageInfo.g Smallsemi - a GAP library of semigroups
-#Y Copyright (C) 2008-2015 Andreas Distler & James D. Mitchell
+## PackageInfo.g Smallsemi - a GAP library of semigroups
+## Copyright (C) 2008-2015 Andreas Distler & James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##
-SetPackageInfo( rec(
+SetPackageInfo(rec(
PackageName := "Smallsemi",
Subtitle := "A library of small semigroups",
Version := "0.6.13",
-Date := "28/02/2022", # this is in dd/mm/yyyy format
+Date := "28/02/2022", # this is in dd/mm/yyyy format
License := "GPL-3.0-or-later",
Persons := [
@@ -21,7 +21,7 @@ Persons := [
IsAuthor := true,
IsMaintainer := false,
Email := "a.distler@tu-bs.de",
- ),
+),
rec(
LastName := "Mitchell",
FirstNames := "James",
@@ -29,26 +29,26 @@ Persons := [
IsMaintainer := true,
Email := "jdm3@st-and.ac.uk",
WWWHome := "http://tinyurl.com/jdmitchell",
- PostalAddress := Concatenation( [
+ PostalAddress := Concatenation([
"Mathematical Institute\n", "North Haugh\n",
- "St Andrews\n", "Fife\n", "KY16 9SS\n", "Scotland"] ),
+ "St Andrews\n", "Fife\n", "KY16 9SS\n", "Scotland"]),
Place := "St Andrews",
Institution := "University of St Andrews"
- )
+)
],
Status := "deposited",
PackageWWWHome := "https://gap-packages.github.io/smallsemi/",
-README_URL := Concatenation( ~.PackageWWWHome, "README" ),
-PackageInfoURL := Concatenation( ~.PackageWWWHome, "PackageInfo.g" ),
+README_URL := Concatenation(~.PackageWWWHome, "README"),
+PackageInfoURL := Concatenation(~.PackageWWWHome, "PackageInfo.g"),
SourceRepository := rec(
Type := "git",
URL := "https://github.com/gap-packages/smallsemi",
),
-IssueTrackerURL := Concatenation( ~.SourceRepository.URL, "/issues" ),
-ArchiveURL := Concatenation( ~.SourceRepository.URL,
+IssueTrackerURL := Concatenation(~.SourceRepository.URL, " / issues"),
+ArchiveURL := Concatenation(~.SourceRepository.URL,
"/releases/download/v", ~.Version,
- "/smallsemi-", ~.Version ),
+ " / smallsemi -", ~.Version),
ArchiveFormats := ".tar.gz",
AbstractHTML :=
@@ -73,25 +73,24 @@ Dependencies := rec(
["gzip is needed in standard location if data files are used uncompressed"]),
AvailabilityTest := ReturnTrue,
BannerString := Concatenation(
- ListWithIdenticalEntries(SizeScreen()[1]-3, '-'), "\n", ~.PackageName,
+ ListWithIdenticalEntries(SizeScreen()[1] - 3, '-'), "\n", ~.PackageName,
" - ", ~.Subtitle, "\n",
"by ", ~.Persons[1].FirstNames, " ", ~.Persons[1].LastName,
- " & " , ~.Persons[2].FirstNames, " ", ~.Persons[2].LastName, "\n",
- "For contents, type: ?Smallsemi:\n" ,
+ " & ", ~.Persons[2].FirstNames, " ", ~.Persons[2].LastName, "\n",
+ "For contents, type: ?Smallsemi:\n",
"Loading ", ~.PackageName, " ", ~.Version, " ...\n",
- ListWithIdenticalEntries(SizeScreen()[1]-3, '-'), "\n" ),
+ ListWithIdenticalEntries(SizeScreen()[1] - 3, '-'), "\n"),
TestFile := "tst/testall.g",
Keywords := ["small semigroups", "data library", "multiplication tables"],
AutoDoc := rec(
entities := rec(
VERSION := ~.Version,
- ARCHIVENAME := Remove( SplitString( ~.ArchiveURL, "/" ) ),
- ),
+ ARCHIVENAME := Remove(SplitString(~.ArchiveURL, " / "))),
TitlePage := rec(
- Version := Concatenation( "Version ", ~.Version ),
+ Version := Concatenation("Version ", ~.Version),
Copyright := """
- ©right; 2008-19 A. Distler & J. D. Mitchell.
+ ©right; 2008-24 A. Distler & J. D. Mitchell.
Smallsemi is free software: you can
redistribute it and/or modify it under the terms of the GNU
@@ -116,7 +115,8 @@ AutoDoc := rec(
Colophon := """
If you find any bugs or have any suggestions or comments, we would
very much appreciate it if you would let us know via our
- issue tracker (see https://github.com/gap-packages/smallsemi/issues).
+ issue tracker (see
+ https://github.com/gap-packages/smallsemi/issues).
""",
Acknowledgements := """
@@ -127,8 +127,6 @@ AutoDoc := rec(
The first author acknowledges financial support of the University
of St Andrews. The second author acknowledges support of EPSRC
grant number GR/S/56085/01.
- """,
- ),
+ """),
),
));
-
diff --git a/gap/enums.gi b/gap/enums.gi
index 821e908..f67c3ee 100644
--- a/gap/enums.gi
+++ b/gap/enums.gi
@@ -686,7 +686,7 @@ function(arg...)
repeat
i := i + 2;
stored := STORED_INFO(sizes[j], NAME_FUNC(enum[i]));
- if not stored = fail then
+ if stored <> fail then
if enum[i + 1] = true then
IntersectSet(positions[j], stored);
elif enum[i + 1] = false then
@@ -903,10 +903,8 @@ function(arg...)
out := [arg[1]];
for i in [2, 4 .. Length(arg) - 1] do
-
pos1 := PositionProperty(SMALLSEMI_EQUIV, x -> [arg[i], arg[i + 1]] = x[1]);
-
- if not pos1 = fail then
+ if pos1 <> fail then
out := Concatenation(out, SMALLSEMI_EQUIV[pos1][2]);
elif not (arg[i] in SMALLSEMI_ALWAYS_FALSE and not arg[i + 1]) then
out := Concatenation(out, [arg[i], arg[i + 1]]);
diff --git a/gap/greensstar.gi b/gap/greensstar.gi
index dc2a484..b05ff69 100644
--- a/gap/greensstar.gi
+++ b/gap/greensstar.gi
@@ -130,44 +130,31 @@ end);
### AD The following methods should probably be installed for ViewString
-# AD This is overwritten by the method for LeftSemigroupCongruence
-InstallMethod(ViewObj, "for Green's R*-relation", [IsRStarRelation],
-16, # to beat IsLeftSemigroupCongruence
-function(obj)
- Print(" ");
end);
+# AD This is overwritten by the method for LeftSemigroupCongruence
+InstallMethod(ViewObj, "for Green's R*-relation", [IsRStarRelation],
+16, # to beat IsLeftSemigroupCongruence
+obj -> SMALLSEMI_ViewStarRelation(obj, "R"));
+
# AD This is overwritten by the method for RightSemigroupCongruence
InstallMethod(ViewObj, "for Green's L*-relation", [IsLStarRelation],
16, # to beat IsRightSemigroupCongruence
-function(obj)
- Print("");
-end);
+obj -> SMALLSEMI_ViewStarRelation(obj, "L"));
InstallMethod(ViewObj, "for Green's J*-relation", [IsJStarRelation],
-function(obj)
- Print("");
-end);
+obj -> SMALLSEMI_ViewStarRelation(obj, "J"));
InstallMethod(ViewObj, "for Green's D*-relation", [IsDStarRelation],
-function(obj)
- Print("");
-end);
+obj -> SMALLSEMI_ViewStarRelation(obj, "D"));
InstallMethod(ViewObj, "for Green's H*-relation", [IsHStarRelation],
-function(obj)
- Print("");
-end);
+obj -> SMALLSEMI_ViewStarRelation(obj, "H"));
InstallMethod(\=, "for starred Green's relations", IsIdenticalObj,
[IsStarRelation and IsEquivalenceRelation,
diff --git a/gap/properties.gd b/gap/properties.gd
index e02eb4c..1b16615 100644
--- a/gap/properties.gd
+++ b/gap/properties.gd
@@ -396,3 +396,6 @@ DeclareProperty("IsSemigroupWithoutClosedIdempotents", IsSmallSemigroup);
#
# <#/GAPDoc>
DeclareGlobalFunction("STORED_INFO");
+
+DeclareGlobalFunction("SMALLSEMI_TableToLiterals");
+DeclareGlobalFunction("SMALLSEMI_OnLiterals");
diff --git a/gap/properties.gi b/gap/properties.gi
index 8fabbb8..ae6e017 100644
--- a/gap/properties.gi
+++ b/gap/properties.gi
@@ -467,6 +467,30 @@ function(S)
return false;
end);
+InstallGlobalFunction(SMALLSEMI_TableToLiterals,
+function(table, n, NumLit)
+ local i, j, literals, val;
+ literals := [];
+ for i in [1 .. n] do
+ for j in [1 .. n] do
+ val := table[i][j];
+ Add(literals, NumLit([i, j, val], n));
+ od;
+ od;
+ return literals;
+end);
+
+InstallGlobalFunction(SMALLSEMI_OnLiterals,
+{n, LitNum, NumLit} -> function(ln, pi)
+ local lit, imlit;
+ lit := LitNum(ln, n);
+ imlit := OnTuples(lit, pi);
+ if (n + 1) ^ pi = n + 2 then
+ imlit := Permuted(imlit, (1, 2));
+ fi;
+ return NumLit(imlit, n);
+end);
+
InstallMethod(IsSelfDualSemigroup, "for a small semigroup",
[IsSmallSemigroup],
function(S)
@@ -484,27 +508,8 @@ function(S)
return val + (row - 1) * n ^ 2 + (col - 1) * n;
end;
- tbl2lits := function(table, n)
- local i, j, literals, val;
- literals := [];
- for i in [1 .. n] do
- for j in [1 .. n] do
- val := table[i][j];
- Add(literals, NumLit([i, j, val], n));
- od;
- od;
- return literals;
- end;
-
- onLiterals := n -> function(ln, pi)
- local lit, imlit;
- lit := LitNum(ln, n);
- imlit := OnTuples(lit, pi);
- if (n + 1) ^ pi = n + 2 then
- imlit := Permuted(imlit, (1, 2));
- fi;
- return NumLit(imlit, n);
- end;
+ tbl2lits := {table, n} -> SMALLSEMI_TableToLiterals(table, n, NumLit);
+ onLiterals := n -> SMALLSEMI_OnLiterals(n, LitNum, NumLit);
n := Size(S);
vals := STORED_INFO(n, "IsSelfDualSemigroup");
diff --git a/gap/small.gi b/gap/small.gi
index 27590d2..4e10290 100644
--- a/gap/small.gi
+++ b/gap/small.gi
@@ -41,37 +41,17 @@ function(S)
QuoInt((ln - 1) mod n ^ 2, n) + 1, (ln - 1) mod n + 1];
end;
- NumLit := {lit, n} -> (lit[1] - 1) * n ^ 2 + (lit[2] - 1) * n + lit[3];
- diag2lits := {diag, n} -> List([1 .. n], i -> NumLit([i, i, diag[i]], n));
-
- tbl2lits := function(table, n)
- local i, j, literals, val;
- literals := [];
- for i in [1 .. n] do
- for j in [1 .. n] do
- val := table[i][j];
- Add(literals, NumLit([i, j, val], n));
- od;
- od;
- return literals;
- end;
-
- onLiterals := n -> function(ln, pi)
- local lit, imlit;
- lit := LitNum(ln, n);
- imlit := OnTuples(lit, pi);
- if (n + 1) ^ pi = n + 2 then
- imlit := Permuted(imlit, (1, 2));
- fi;
- return NumLit(imlit, n);
- end;
+ NumLit := {lit, n} -> (lit[1] - 1) * n ^ 2 + (lit[2] - 1) * n + lit[3];
+ diag2lits := {diag, n} -> List([1 .. n], i -> NumLit([i, i, diag[i]], n));
+ tbl2lits := {table, n} -> SMALLSEMI_TableToLiterals(table, n, NumLit);
+ onLiterals := n -> SMALLSEMI_OnLiterals(n, LitNum, NumLit);
is3nilpotent := function(table)
local n, zero, entries, i;
n := Size(table);
zero := First([1 .. n], i -> table[i] = ListWithIdenticalEntries(n, i)
- and table{[1 .. n]}[i] = ListWithIdenticalEntries(n, i));
+ and table{[1 .. n]}[i] = ListWithIdenticalEntries(n, i));
if zero = fail then
return false;
else
diff --git a/gap/utils.gd b/gap/utils.gd
index fa94d29..e65da68 100644
--- a/gap/utils.gd
+++ b/gap/utils.gd
@@ -1,7 +1,7 @@
#############################################################################
##
-#W utils.gd Smallsemi - a GAP library of semigroups
-#Y Copyright (C) 2008-2012 Andreas Distler & James D. Mitchell
+## utils.gd Smallsemi - a GAP library of semigroups
+## Copyright (C) 2008-2024 Andreas Distler & James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
diff --git a/gap/utils.gi b/gap/utils.gi
index 7dcaeb2..a8c971b 100644
--- a/gap/utils.gi
+++ b/gap/utils.gi
@@ -1,7 +1,7 @@
#############################################################################
##
-#W utils.gi Smallsemi - a GAP library of semigroups
-#Y Copyright (C) 2008-2014 Andreas Distler & James D. Mitchell
+## utils.gi Smallsemi - a GAP library of semigroups
+## Copyright (C) 2008-2024 Andreas Distler & James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
@@ -14,18 +14,20 @@ function()
record := rec();
record.InfoWarningLevel := InfoLevel(InfoWarning);
SetInfoLevel(InfoWarning, 0);
- Read(Filename(DirectoriesPackageLibrary("smallsemi","tst"),"testall.g"));;
+ Read(Filename(DirectoriesPackageLibrary("smallsemi", "tst"), "testall.g"));
SetInfoLevel(InfoWarning, record.InfoWarningLevel);
return;
end);
InstallGlobalFunction(SmallsemiManualExamples,
function()
- return ExtractExamples(DirectoriesPackageLibrary("smallsemi","doc"),
- "smallsemi.xml", [ "data.xml", "examples.xml", "intro.xml",
- "../gap/3nil.gd", "../gap/coclass.gd", "../gap/enums.gd", "../gap/greensstar.gd",
- "../gap/properties.gd", "../gap/small.gd", "../gap/autovars.g",
- "../PackageInfo.g" ], "Single");
+ return ExtractExamples(DirectoriesPackageLibrary("smallsemi", "doc"),
+ "smallsemi.xml",
+ ["data.xml", "examples.xml", "intro.xml",
+ "../gap/3nil.gd", "../gap/coclass.gd",
+ "../gap/enums.gd", "../gap/greensstar.gd",
+ "../gap/properties.gd", "../gap/small.gd",
+ "../gap/autovars.g", "../PackageInfo.g"], "Single");
end);
InstallGlobalFunction(SmallsemiTestManualExamples,