Skip to content

Commit

Permalink
Changed tests in testinstall that did rely on immediate methods
Browse files Browse the repository at this point in the history
Ditto for manual examples, including
some stability (do not test for values of `Random` etc.)

Includes slight modification for DerivedSubgroup of fp group
if subgroup of finite index is cyclic. (This might look overly specialized,
but is apparently of interest for some test examples, in any case it comes
at little cost to other calculations.)

also Further github remarks.

Fixed algmat.ytst in different way:

It seems this test file is run in different configurations, in which a
basis for a 0-dim space in one example is considered SemiEchelon (and thus
prints differently), in the other case not. Thus remove the display.
(Another example why the concept of testing for verbatim output is flawed.)
  • Loading branch information
hulpke committed Apr 26, 2018
1 parent b7428e4 commit 8146011
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 42 deletions.
2 changes: 2 additions & 0 deletions lib/ctbl.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3584,6 +3584,8 @@ DeclareGlobalVariable( "CharacterTableDisplayDefaults" );
## tbl:=rec();
## tbl.Irr:=
## [ [ 1, 1 ], [ 1, -1 ] ];
## tbl.IsFinite:=
## true;
## tbl.NrConjugacyClasses:=
## 2;
## tbl.Size:=
Expand Down
2 changes: 2 additions & 0 deletions lib/grp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ InstallFactorMaintenance( IsSolvableGroup,
InstallTrueMethod( IsSolvableGroup, IsMonomialGroup );
InstallTrueMethod( IsSolvableGroup, IsSupersolvableGroup );

InstallTrueMethod( HasIsPerfectGroup, IsGroup and IsSolvableGroup and IsNonTrivial );


#############################################################################
##
Expand Down
9 changes: 1 addition & 8 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ InstallImmediateMethod( IsFinitelyGeneratedGroup,
#M IsCyclic( <G> ) . . . . . . . . . . . . . . . . test if a group is cyclic
##
# This used to be an immediate method. It was replaced by an ordinary
# method sine the flag is typically set when creating the group.
# method since the flag is typically set when creating the group.
InstallMethod( IsCyclic, true, [IsGroup and HasGeneratorsOfGroup], 0,
function( G )
if Length( GeneratorsOfGroup( G ) ) = 1 then
Expand Down Expand Up @@ -439,13 +439,6 @@ InstallMethod( IsNilpotentGroup,
##
#M IsPerfectGroup( <G> ) . . . . . . . . . . . . test if a group is perfect
##
# This used to be an immediate method. It was replaced by a TrueMethod (in
# the gd file)
#InstallImmediateMethod( IsPerfectGroup,
# IsSolvableGroup and HasIsTrivial,
# 0,
# IsTrivial );

InstallImmediateMethod( IsPerfectGroup,
IsGroup and HasIsAbelian and IsSimpleGroup,
0,
Expand Down
5 changes: 5 additions & 0 deletions lib/grpfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,11 @@ local iso,hom,u;
if HasIsAbelian(G) and IsAbelian(G) then
return TrivialSubgroup(G);
elif Size(Image(hom))=infinity then
# test a special case -- one generator
if Length(GeneratorsOfGroup(G))=1 then
SetIsAbelian(G,true);
return TrivialSubgroup(G);
fi;
Error("Derived subgroup has infinite index, cannot represent");
elif Size(Range(hom))=1 then
return G; # this is needed because the trivial quotient is represented
Expand Down
42 changes: 21 additions & 21 deletions lib/object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ DeclareOperation( "ObjByExtRep", [ IsFamily, IsObject ] );
## gap> KnownAttributesOfObject(g);
## [ "Size", "OneImmutable", "NrMovedPoints", "MovedPoints",
## "GeneratorsOfMagmaWithInverses", "MultiplicativeNeutralElement",
## "HomePcgs", "Pcgs", "GeneralizedPcgs", "StabChainMutable",
## "StabChainOptions" ]
## "HomePcgs", "Pcgs", "StabChainMutable", "StabChainOptions" ]
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -707,28 +706,29 @@ DeclareOperation( "KnownPropertiesOfObject", [ IsObject ] );
## <Example><![CDATA[
## gap> g:=Group((1,2),(1,2,3));;
## gap> KnownPropertiesOfObject(g);
## [ "IsFinite", "CanEasilyCompareElements", "CanEasilySortElements",
## "IsDuplicateFree", "IsGeneratorsOfMagmaWithInverses",
## "IsAssociative", "IsGeneratorsOfSemigroup", "IsSimpleSemigroup",
## "IsRegularSemigroup", "IsInverseSemigroup",
## "IsCompletelyRegularSemigroup", "IsCompletelySimpleSemigroup",
## "IsGroupAsSemigroup", "IsMonoidAsSemigroup", "IsOrthodoxSemigroup",
## "IsFinitelyGeneratedGroup", "IsSubsetLocallyFiniteGroup",
## "KnowsHowToDecompose", "IsInfiniteAbelianizationGroup",
## "IsNilpotentByFinite" ]
## [ "IsEmpty", "IsTrivial", "IsNonTrivial", "IsFinite",
## "CanEasilyCompareElements", "CanEasilySortElements",
## "IsDuplicateFree", "IsGeneratorsOfMagmaWithInverses",
## "IsAssociative", "IsGeneratorsOfSemigroup", "IsSimpleSemigroup",
## "IsRegularSemigroup", "IsInverseSemigroup",
## "IsCompletelyRegularSemigroup", "IsCompletelySimpleSemigroup",
## "IsGroupAsSemigroup", "IsMonoidAsSemigroup", "IsOrthodoxSemigroup",
## "IsFinitelyGeneratedGroup", "IsSubsetLocallyFiniteGroup",
## "KnowsHowToDecompose", "IsInfiniteAbelianizationGroup",
## "IsNilpotentByFinite", "IsTorsionFree", "IsFreeAbelian" ]
## gap> Size(g);
## 6
## gap> KnownPropertiesOfObject(g);
## [ "IsEmpty", "IsTrivial", "IsNonTrivial", "IsFinite",
## "CanEasilyCompareElements", "CanEasilySortElements",
## "IsDuplicateFree", "IsGeneratorsOfMagmaWithInverses",
## "IsAssociative", "IsGeneratorsOfSemigroup", "IsSimpleSemigroup",
## "IsRegularSemigroup", "IsInverseSemigroup",
## "IsCompletelyRegularSemigroup", "IsCompletelySimpleSemigroup",
## "IsGroupAsSemigroup", "IsMonoidAsSemigroup", "IsOrthodoxSemigroup",
## "IsFinitelyGeneratedGroup", "IsSubsetLocallyFiniteGroup",
## "KnowsHowToDecompose", "IsPerfectGroup", "IsSolvableGroup",
## "IsPolycyclicGroup", "IsInfiniteAbelianizationGroup",
## [ "IsEmpty", "IsTrivial", "IsNonTrivial", "IsFinite",
## "CanEasilyCompareElements", "CanEasilySortElements",
## "IsDuplicateFree", "IsGeneratorsOfMagmaWithInverses",
## "IsAssociative", "IsGeneratorsOfSemigroup", "IsSimpleSemigroup",
## "IsRegularSemigroup", "IsInverseSemigroup",
## "IsCompletelyRegularSemigroup", "IsCompletelySimpleSemigroup",
## "IsGroupAsSemigroup", "IsMonoidAsSemigroup", "IsOrthodoxSemigroup",
## "IsFinitelyGeneratedGroup", "IsSubsetLocallyFiniteGroup",
## "KnowsHowToDecompose", "IsPerfectGroup", "IsSolvableGroup",
## "IsPolycyclicGroup", "IsInfiniteAbelianizationGroup",
## "IsNilpotentByFinite", "IsTorsionFree", "IsFreeAbelian" ]
## gap> KnownTruePropertiesOfObject(g);
## [ "IsNonTrivial", "IsFinite", "CanEasilyCompareElements",
Expand Down
2 changes: 1 addition & 1 deletion tst/testbugfix/00005.tst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ gap> G:=GroupByGenerators( [ [ [ 0, -1, 0, 0 ], [ 1, 0, 0, 0 ],
Group([ [ [ 0, -1, 0, 0 ], [ 1, 0, 0, 0 ], [ 0, 0, 0, -1 ], [ 0, 0, 1, 0 ] ]
])
gap> Centralizer(N,G);
<matrix group of size infinity with 6 generators>
<matrix group with 6 generators>
3 changes: 1 addition & 2 deletions tst/testinstall/algmat.tst
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ gap> n:= NullAlgebra( GF(3) );
<algebra over GF(3)>
gap> Dimension( n );
0
gap> b:= Basis( n );
SemiEchelonBasis( <algebra of dimension 0 over GF(3)>, [ ] )
gap> b:= Basis( n );;
gap> BasisVectors( b );
[ ]
gap> zero:= Zero( n );
Expand Down
4 changes: 1 addition & 3 deletions tst/testinstall/coll.tst
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ Error, cannot test whether <C> contains the family of its elements
# Size
#

# immediate method for collections knowing they are infinite
## method for collections knowing they are infinite
gap> c2:=ConjugacyClass(F, F.1);;
gap> HasSize(c2);
false
gap> SetIsFinite(c2, false);
gap> HasSize(c2);
true
gap> Size(c2);
infinity

Expand Down
11 changes: 5 additions & 6 deletions tst/testinstall/semigrp.tst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ gap> GeneratorsOfInverseSemigroup(S);
gap> GeneratorsOfInverseMonoid(S);
[ <identity partial perm on [ 1 ]> ]
gap> S := Group(IdentityTransformation);
<transformation group of degree 0 with 1 generator>
<trivial transformation group of degree 0 with 1 generator>
gap> GeneratorsOfSemigroup(S);
[ IdentityTransformation ]
gap> GeneratorsOfMonoid(S);
Expand Down Expand Up @@ -474,12 +474,11 @@ true
gap> Semigroup(Idempotents(S)) = S;
true

# test the methods for Random
# test the methods for Random, but do not test for the values of random
# elements
gap> S := FreeSemigroup(3);;
gap> Random(S);
s1*s2
gap> Random(GlobalRandomSource, S);
s3*s2^2
gap> Random(S);;
gap> Random(GlobalRandomSource, S);;

#T# Test DisplaySemigroup
gap> DisplaySemigroup(FullTransformationSemigroup(1));
Expand Down
2 changes: 1 addition & 1 deletion tst/testinstall/semitran.tst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ gap> S := Group(Transformation([2,1,3]));
gap> DegreeOfTransformationSemigroup(S);
2
gap> S := Group(IdentityTransformation);
<transformation group of degree 0 with 1 generator>
<trivial transformation group of degree 0 with 1 generator>
gap> GeneratorsOfGroup(S);
[ IdentityTransformation ]
gap> S := Semigroup(IdentityTransformation);
Expand Down

0 comments on commit 8146011

Please sign in to comment.