Skip to content

Commit

Permalink
FIX: (partial) for gap-system#2400
Browse files Browse the repository at this point in the history
1) Wrong `IsTrivial` set in empty submagma

2) Fix `Submagma` method by replacing the empty submagma with the one-submagma,
if it turns out a group. (Work around bug, not a fix)
  • Loading branch information
hulpke committed Apr 30, 2018
1 parent 3d5fd9f commit 79f4e40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/addmagma.gi
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ InstallGlobalFunction( SubadditiveMagmaNC, function( M, gens )
if IsEmpty( gens ) then
K:= NewType( FamilyObj(M),
IsAdditiveMagma
and IsTrivial
and IsEmpty
and IsAttributeStoringRep );
S:= Objectify( K, rec() );
SetGeneratorsOfAdditiveMagma( S, [] );
Expand Down
3 changes: 3 additions & 0 deletions lib/magma.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,9 @@ InstallMethod( AsMagma,
D := AsSSortedList( D );
L := ShallowCopy( D );
M := Submagma( MagmaByGenerators( D ), [] );
if IsGroup(M) then
M:=Submagma(MagmaByGenerators(D),[One(ElementsFamily(FamilyObj(D)))]);
fi;
SubtractSet( L, AsSSortedList( M ) );
while not IsEmpty(L) do
M := ClosureMagmaDefault( M, L[1] );
Expand Down

0 comments on commit 79f4e40

Please sign in to comment.