Skip to content

Narrow declarations of Factorization and WreathProduct#1156

Merged
james-d-mitchell merged 3 commits into
semigroups:stable-5.6from
james-d-mitchell:narrow-decls
Mar 30, 2026
Merged

Narrow declarations of Factorization and WreathProduct#1156
james-d-mitchell merged 3 commits into
semigroups:stable-5.6from
james-d-mitchell:narrow-decls

Conversation

@james-d-mitchell

Copy link
Copy Markdown
Collaborator

This PR partially resolves:

gap-system/gap#6282

The part not resolved is that for StructureDescription, it seems that IsRcwaGroup and IsRcwaGroupOverZ imply IsGroupAsSemigroup (which make sense and is fine), but then the methods installed for StructureDescription for IsGroupAsSemigroup and something else (maybe IsGroup) collide. I'm not sure how to resolve this. Any suggestions @fingolfin ?

Comment thread gap/attributes/factor.gd
DeclareOperation("NonTrivialFactorization",
[IsSemigroup, IsMultiplicativeElement]);
DeclareOperation("Factorization", [IsLambdaOrb, IsPosInt, IsPerm]);
DeclareOperation("Factorization", [IsSemigroup, IsMultiplicativeElement]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alternatively we could also widen the declaration in GAP itself, which currently is

DeclareOperation( "Factorization",
                  [ IsGroup, IsMultiplicativeElementWithInverse ] );

The drawback of that would be that if GAP did that, loading any older Semigroups versions would produce a warning

#I  equal requirements in multiple declarations for operation `Factorization'

and the new semigroups would either only work on the new GAP; or would have to have code to the effect of "if GAp does not declare this operation for IsSemigroup then declare it for semigroups".

So I am not sure it would be worth that hassle.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed I'll just merge this for now (when updated) and then we can think about what to do later.

@fingolfin

Copy link
Copy Markdown
Contributor

For StructureDescription my suggestion would be that you drop

DeclareAttribute("StructureDescription", IsGroupAsSemigroup);

and then change

InstallMethod(StructureDescription, "for a group as semigroup",

to

InstallOtherMethod(StructureDescription, "for a group as semigroup",

@james-d-mitchell

Copy link
Copy Markdown
Collaborator Author

For StructureDescription my suggestion would be that you drop

DeclareAttribute("StructureDescription", IsGroupAsSemigroup);

and then change

InstallMethod(StructureDescription, "for a group as semigroup",

to

InstallOtherMethod(StructureDescription, "for a group as semigroup",

Aha, right, I forgot about InstallOtherMethod, I'll do that. Thanks @fingolfin

@james-d-mitchell james-d-mitchell merged commit bd9707d into semigroups:stable-5.6 Mar 30, 2026
33 of 34 checks passed
@james-d-mitchell james-d-mitchell deleted the narrow-decls branch March 30, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants