From cc93123387ea3681e8213e184082f9d815b3aca7 Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Thu, 26 Apr 2018 18:24:49 -0600 Subject: [PATCH] FIX: (partial) for #2400 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) --- lib/addmagma.gi | 2 +- lib/magma.gi | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/addmagma.gi b/lib/addmagma.gi index 72f692d91b..ab653cbf46 100644 --- a/lib/addmagma.gi +++ b/lib/addmagma.gi @@ -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, [] ); diff --git a/lib/magma.gi b/lib/magma.gi index 6c1eac9b3a..69a8f92851 100644 --- a/lib/magma.gi +++ b/lib/magma.gi @@ -1213,6 +1213,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] );