Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement LeftSemigroupIdeal and RightSemigroupIdeal #1009

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
335f388
Adding Free Semilattice constructor
Jun2M Feb 7, 2024
5fb0319
For Transformation and PartialPerm Semigroups
Jun2M Feb 7, 2024
4685a06
Lint
Jun2M Feb 8, 2024
721a464
Update semicons.gd
Jun2M Feb 10, 2024
c4f56d9
Merge branch 'main' into main
Jun2M Feb 10, 2024
1ec0a1a
Add docs and a whole lot of tests
Jun2M Feb 10, 2024
f35961a
Minor test fix
Jun2M Feb 11, 2024
9ae4fd9
Merge branch 'main' into main
Jun2M Feb 14, 2024
432322b
Dial back on the number of tests
Jun2M Feb 14, 2024
708e4c1
Merge branch 'main' into main
james-d-mitchell Mar 11, 2024
917be05
Apply suggestions from code review
james-d-mitchell Mar 11, 2024
7977c3b
Change tst to reflect the new error msg
Jun2M Mar 12, 2024
f7338a2
Merge branch 'main' into main
Jun2M Mar 12, 2024
b2463bb
Add Monoid constructors to FreeSemilatticeCons
Jun2M Mar 13, 2024
19266ad
Unbind _IsXMonoid in semicons.gi
Jun2M Mar 13, 2024
58013b4
Update semicons.xml and semicons.gi files
Jun2M Mar 13, 2024
f430c07
Adding Free Semilattice constructor
Jun2M Feb 7, 2024
6a6fcf9
For Transformation and PartialPerm Semigroups
Jun2M Feb 7, 2024
d952a4a
Lint
Jun2M Feb 8, 2024
a15a713
Update semicons.gd
Jun2M Feb 10, 2024
6bc9989
Add docs and a whole lot of tests
Jun2M Feb 10, 2024
d80fd74
Minor test fix
Jun2M Feb 11, 2024
2e4c7aa
Dial back on the number of tests
Jun2M Feb 14, 2024
1cc19e1
Apply suggestions from code review
james-d-mitchell Mar 11, 2024
c9c2062
Change tst to reflect the new error msg
Jun2M Mar 12, 2024
a36b834
Add Monoid constructors to FreeSemilatticeCons
Jun2M Mar 13, 2024
c583ad6
Unbind _IsXMonoid in semicons.gi
Jun2M Mar 13, 2024
fa9344f
Update semicons.xml and semicons.gi files
Jun2M Mar 13, 2024
0b2d4d4
Merge branch 'semigroups:main' into main
Jun2M Mar 20, 2024
cfda100
Add left and right semigroup ideal support
Jun2M Mar 20, 2024
df1cc98
Edit docs
Jun2M Mar 26, 2024
0880917
Don't destroy the whole thing
Jun2M Mar 26, 2024
61ac68f
bug fix
Jun2M Mar 26, 2024
4f1200b
Fix ideals.gd
Jun2M Mar 26, 2024
eb93dfc
doc update
Jun2M Mar 26, 2024
4aefac6
Linting
Jun2M Mar 26, 2024
1140492
Factor out the input parsing
Jun2M Mar 27, 2024
abdf215
Hide internal functions and make first edits on ideal.tst
Jun2M Mar 27, 2024
eb4bc56
Appearently not a duplicate
Jun2M Mar 27, 2024
6e76d9b
Linting
Jun2M Mar 27, 2024
c74ebcd
Linting for tst file
Jun2M Mar 28, 2024
a538cc8
Linting for tst
Jun2M Mar 28, 2024
0a39a7c
More tests
Jun2M Apr 2, 2024
97eb398
Linting
Jun2M Apr 2, 2024
2f825bd
Lint
Jun2M Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions doc/ideals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,56 @@ gap> I := SemigroupIdeal(S, I, Idempotents(S));
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="LeftSemigroupIdeal">
<ManSection>
<Func Name = "LeftSemigroupIdeal" Arg = "S, obj1, obj2, .. . "/>
<Returns>
A left ideal of a semigroup.
</Returns>
<Description>
If <A>obj1</A>, <A>obj2</A>, .. . are (any combination) of elements of the
semigroup <A>S</A> or collections of elements of <A>S</A> (including
subsemigroups and ideals of <A>S</A>), then <C>LeftSemigroupIdeal</C> returns the
left ideal of the semigroup <A>S</A> generated by the union of
<A>obj1</A>, <A>obj2</A>, .. .. <P/>

The <Ref Func = "Parent" BookName = "ref"/> of the ideal returned by this
function is <A>S</A>.

<Example><![CDATA[
gap> S := SymmetricInverseMonoid(10);
<symmetric inverse monoid of degree 10>
gap> I := LeftSemigroupIdeal(S, PartialPerm([1, 2]));
<LeftMagmaIdeal with 1 generator>]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="RightSemigroupIdeal">
<ManSection>
<Func Name = "RightSemigroupIdeal" Arg = "S, obj1, obj2, .. . "/>
<Returns>
A Right ideal of a semigroup.
</Returns>
<Description>
If <A>obj1</A>, <A>obj2</A>, .. . are (any combination) of elements of the
semigroup <A>S</A> or collections of elements of <A>S</A> (including
subsemigroups and ideals of <A>S</A>), then <C>RightSemigroupIdeal</C> returns the
Right ideal of the semigroup <A>S</A> generated by the union of
<A>obj1</A>, <A>obj2</A>, .. .. <P/>

The <Ref Func = "Parent" BookName = "ref"/> of the ideal returned by this
function is <A>S</A>.

<Example><![CDATA[
gap> S := SymmetricInverseMonoid(10);
<symmetric inverse monoid of degree 10>
gap> I := RightSemigroupIdeal(S, PartialPerm([1, 2]));
<RightMagmaIdeal with 1 generator>]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="SupersemigroupOfIdeal">
<ManSection>
<Attr Name = "SupersemigroupOfIdeal" Arg = "I"/>
Expand Down
55 changes: 55 additions & 0 deletions doc/semicons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,61 @@ true]]></Example>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="FreeSemilattice">
<ManSection>
<Func Name="FreeSemilattice" Arg="[filt, ] n"/>
<Returns>
A free semilattice with <A>n</A> generators.
</Returns>
<Description>
If <A>n</A> is a positive integer, then this function returns a free
semilattice with <A>n</A> generators in the representation given by the
filter <A>filt</A>.

The optional argument <A>filt</A> may be one of the following:
<List>
<Item><C>IsTransformationSemigroup</C>
(the default, if <A>filt</A> is not specified),</Item>
<Item><C>IsTransformationMonoid</C>,</Item>
<Item><C>IsPartialPermSemigroup</C>,</Item>
<Item><C>IsPartialPermMonoid</C>,</Item>
<Item><C>IsFpSemigroup</C>,</Item>
<Item><C>IsFpMonoid</C>,</Item>
<Item><C>IsBipartitionSemigroup</C>,</Item>
<Item><C>IsBipartitionMonoid</C>,</Item>
<Item><C>IsPBRSemigroup</C>,</Item>
<Item><C>IsPBRMonoid</C>,</Item>
<Item><C>IsBooleanMatSemigroup</C>,</Item>
<Item><C>IsBooleanMatMonoid</C>,</Item>
<Item><C>IsNTPMatrixSemigroup</C>,</Item>
<Item><C>IsNTPMatrixMonoid</C>,</Item>
<Item><C>IsMaxPlusMatrixSemigroup</C>,</Item>
<Item><C>IsMaxPlusMatrixMonoid</C>,</Item>
<Item><C>IsMinPlusMatrixSemigroup</C>,</Item>
<Item><C>IsMinPlusMatrixMonoid</C>,</Item>
<Item><C>IsTropicalMaxPlusMatrixSemigroup</C>,</Item>
<Item><C>IsTropicalMaxPlusMatrixMonoid</C>,</Item>
<Item><C>IsTropicalMinPlusMatrixSemigroup</C>,</Item>
<Item><C>IsTropicalMinPlusMatrixMonoid</C>,</Item>
<Item><C>IsProjectiveMaxPlusMatrixSemigroup</C>,</Item>
<Item><C>IsProjectiveMaxPlusMatrixMonoid</C>,</Item>
<Item><C>IsIntegerMatrixSemigroup.</C></Item>
<Item><C>IsIntegerMatrixMonoid.</C></Item>
</List>

<Example><![CDATA[
gap> S := FreeSemilattice(IsTransformationSemigroup, 5);
<inverse transformation semigroup of size 31, degree 6 with 5
generators>
gap> T := FreeSemilattice(IsPartialPermSemigroup, 3);
<inverse partial perm semigroup of size 7, rank 3 with 3 generators>
gap> U := FreeSemilattice(IsBooleanMatSemigroup, 4);
<inverse semigroup of size 15, 5x5 boolean matrices with 4 generators>
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="ZeroSemigroup">
<ManSection>
<Func Name="ZeroSemigroup" Arg="[filt, ]n"/>
Expand Down
1 change: 1 addition & 0 deletions doc/z-chap07.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<#Include Label = "TrivialSemigroup">
<#Include Label = "MonogenicSemigroup">
<#Include Label = "RectangularBand">
<#Include Label = "FreeSemilattice">
<#Include Label = "ZeroSemigroup">
<#Include Label = "LeftZeroSemigroup">
<#Include Label = "BrandtSemigroup">
Expand Down
2 changes: 2 additions & 0 deletions doc/z-chap09.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
</Heading>

<#Include Label = "SemigroupIdeal">
<#Include Label = "LeftSemigroupIdeal">
<#Include Label = "RightSemigroupIdeal">
<#Include Label = "Ideals">
</Section>

Expand Down
2 changes: 2 additions & 0 deletions gap/ideals/froidure-pin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
##

DeclareAttribute("PositionsInSupersemigroup", IsSemigroupIdeal);
DeclareAttribute("PositionsInSupersemigroup", IsLeftSemigroupIdeal);
DeclareAttribute("PositionsInSupersemigroup", IsRightSemigroupIdeal);
42 changes: 42 additions & 0 deletions gap/ideals/froidure-pin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,48 @@ function(I)
return result;
end);

InstallMethod(PositionsInSupersemigroup,
"for a left semigroup ideal with known generators",
[IsLeftSemigroupIdeal and HasGeneratorsOfSemigroupIdeal and
CanUseFroidurePin],
function(I)
local S, L, result, pos, x;
S := SupersemigroupOfIdeal(I);
L := LeftCayleyDigraph(S);

result := [];
for x in GeneratorsOfSemigroupIdeal(I) do
pos := PositionCanonical(S, x);
if not pos in result then
AddSet(result, pos);
UniteSet(result, VerticesReachableFrom(L, pos));
fi;
od;

return result;
end);

InstallMethod(PositionsInSupersemigroup,
"for a right semigroup ideal with known generators",
[IsRightSemigroupIdeal and HasGeneratorsOfSemigroupIdeal and
CanUseFroidurePin],
function(I)
local S, R, result, pos, x;
S := SupersemigroupOfIdeal(I);
R := RightCayleyDigraph(S);

result := [];
for x in GeneratorsOfSemigroupIdeal(I) do
pos := PositionCanonical(S, x);
if not pos in result then
AddSet(result, pos);
UniteSet(result, VerticesReachableFrom(R, pos));
fi;
od;

return result;
end);

InstallMethod(GeneratorsOfInverseSemigroup,
"for an inverse semigroup ideal with inverse op and generators",
[IsSemigroupIdeal and IsInverseSemigroup
Expand Down
15 changes: 14 additions & 1 deletion gap/ideals/ideals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@
#############################################################################

DeclareSynonymAttr("GeneratorsOfSemigroupIdeal", GeneratorsOfMagmaIdeal);

DeclareGlobalFunction("SemigroupIdeal");
DeclareGlobalFunction("LeftSemigroupIdeal");
DeclareGlobalFunction("RightSemigroupIdeal");
DeclareGlobalFunction("AnySemigroupIdealInputParsing");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DeclareGlobalFunction("AnySemigroupIdealInputParsing");
DeclareGlobalFunction("AnySemigroupIdealInputParsing");

I'd suggest removing this from here, and instead doing

BindGlobal("_AnySemigroupIdealInputParsing", ...)

in the .gi file instead. Note also the _ in the name (either do this or just put the function into the record SEMIGROUPS, by doing:

SEMIGROUPS.AnySemigroupIdealInputParsing := function(...

again in the .gi file. Same goes for all of the "internal" functions that start with "Any"


DeclareOperation("AnySemigroupIdealByGenerators",
[IsSemigroup, IsOperation, IsListOrCollection]);

DeclareOperation("AnySemigroupIdealByGenerators",
[IsSemigroup, IsOperation, IsListOrCollection, IsRecord]);

DeclareOperation("AnySemigroupIdealByGeneratorsNC",
[IsSemigroup, IsOperation, IsListOrCollection, IsRecord]);

DeclareOperation("SemigroupIdealByGenerators",
[IsSemigroup, IsListOrCollection]);
Expand Down Expand Up @@ -40,6 +53,6 @@ DeclareAttribute("MinimalIdealGeneratingSet", IsSemigroupIdeal);

DeclareAttribute("SupersemigroupOfIdeal", IsSemigroupIdeal);

InstallTrueMethod(IsSemigroup, IsSemigroupIdeal);
InstallTrueMethod(IsSemigroup, IsSemigroupIdeal); # Duplicate with ideal.gi?
Jun2M marked this conversation as resolved.
Show resolved Hide resolved

DeclareAttribute("Ideals", IsSemigroup);
Loading
Loading