Skip to content

Commit

Permalink
Update ViewString for rank-zero free groups/monoids
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Jun 15, 2021
1 parent 2a40975 commit b77fb6e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/grpfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5729,4 +5729,4 @@ InstallMethod( IndependentGeneratorsOfAbelianGroup,
[ IsFpGroup and IsAbelian ],
IndependentGeneratorsOfMaximalAbelianQuotientOfFpGroup );

BindGlobal("TRIVIAL_FP_GROUP",FreeGroup(0,"TrivGp")/[]);
BindGlobal( "TRIVIAL_FP_GROUP", FreeGroup(0) / [] );
4 changes: 3 additions & 1 deletion lib/grpfree.gi
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ InstallMethod( ViewObj,
[ IsFreeGroup ],
function(G)
if IsGroupOfFamily(G) then
if Length(GeneratorsOfGroup(G)) > GAPInfo.ViewLength * 10 then
if IsEmpty(GeneratorsOfGroup(G)) then
Print("<free group of rank zero>");
elif Length(GeneratorsOfGroup(G)) > GAPInfo.ViewLength * 10 then
Print("<free group with ",Length(GeneratorsOfGroup(G))," generators>");
else
Print("<free group on the generators ",GeneratorsOfGroup(G),">");
Expand Down
4 changes: 3 additions & 1 deletion lib/monofree.gi
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ InstallMethod( ViewObj,
"for a free monoid containing the whole family",
[ IsMonoid and IsAssocWordCollection and IsWholeFamily ],
function( M )
if GAPInfo.ViewLength * 10 < Length( GeneratorsOfMagmaWithOne( M ) ) then
if IsEmpty( GeneratorsOfMagmaWithOne( M ) ) then
Print( "<free monoid of rank zero>" );
elif GAPInfo.ViewLength * 10 < Length( GeneratorsOfMagmaWithOne( M ) ) then
Print( "<free monoid with ", Length( GeneratorsOfMagmaWithOne( M ) ),
" generators>" );
else
Expand Down

0 comments on commit b77fb6e

Please sign in to comment.