Skip to content

Commit

Permalink
semipperm: fix GeneratorsOfSemigroup for some trivial groups
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson authored and james-d-mitchell committed Nov 26, 2018
1 parent d887a51 commit d641245
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gap/semigroups/semipperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ end);

InstallImmediateMethod(GeneratorsOfSemigroup,
IsPartialPermSemigroup and IsGroup and HasGeneratorsOfGroup,
0, GeneratorsOfGroup);
0,
function(G)
if IsEmpty(GeneratorsOfGroup(G)) then
# WW: really this should be `return [One(G)];`, but this fails when running
# GAP's `tst/testinstall.g` for some reason that I can't figure out.
TryNextMethod();
fi;
return GeneratorsOfGroup(G);
end);

InstallMethod(RankOfPartialPermSemigroup,
"for a partial perm semigroup",
Expand Down
7 changes: 7 additions & 0 deletions tst/standard/semipperm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,13 @@ gap> y := Iterator(S);
<iterator>
gap> for x in y do od;

#T# GeneratorsOfGroup
gap> S := Group([], PartialPerm([1, 2]));;
gap> GeneratorsOfGroup(S);
[ ]
gap> GeneratorsOfSemigroup(S);
[ <identity partial perm on [ 1, 2 ]> ]

# SEMIGROUPS_UnbindVariables
gap> Unbind(F);
gap> Unbind(H1);
Expand Down

0 comments on commit d641245

Please sign in to comment.