Skip to content

Commit

Permalink
Do not pluralise "1 generator"
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Apr 28, 2020
1 parent 552d635 commit e44d9a0
Show file tree
Hide file tree
Showing 36 changed files with 194 additions and 108 deletions.
2 changes: 1 addition & 1 deletion doc/ref/arith.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ hence the generic methods for such domains will have a chance to succeed.
gap> a:= MyObject( Z(7) );
<Z(7)>
gap> m:= Magma( a );
<magma with 1 generators>
<magma with 1 generator>
gap> e:= MultiplicativeNeutralElement( m );
<Z(7)^2>
gap> elms:= AsList( m );
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/fldabnum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ over a non-cyclotomic field.
<P/>
<Example><![CDATA[
gap> g:= GaloisGroup( AsField( Field( [ Sqrt(5) ] ), CF(5) ) );
<group of size 2 with 1 generators>
<group of size 2 with 1 generator>
gap> gens:= GeneratorsOfGroup( g );
[ ANFAutomorphism( AsField( NF(5,[ 1, 4 ]), CF(5) ), 4 ) ]
gap> x:= last[1];; x^2;
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/methsel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ gap> InstallMethod(XCons, [IsGroup, IsInt], function(t,x) return CyclicGroup(x);
gap> InstallMethod(XCons, [IsPermGroup, IsInt], function(t,x) return SymmetricGroup(x); end);
gap> InstallMethod(XCons, [IsSemigroup, IsInt], function(t,x) return FullTransformationMonoid(x); end);
gap> XCons(IsGroup,3);
<pc group of size 3 with 1 generators>
<pc group of size 3 with 1 generator>
gap> XCons(IsPermGroup,3);
Sym( [ 1 .. 3 ] )
gap> XCons(IsSemigroup,4);
Expand Down
4 changes: 2 additions & 2 deletions doc/ref/reesmat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ gap> mat:=[[(), 0, 0], [0, (), 0], [0, 0, ()],
> [(), (), ()], [0, 0, ()]];;
gap> R:=ReesZeroMatrixSemigroup(G, mat);
<Rees 0-matrix semigroup 3x5 over
<permutation group of size 1007 with 1 generators>>
<permutation group of size 1007 with 1 generator>>
gap> ReesZeroMatrixSubsemigroup(R, [1,3], G, [1..5]);
<Rees 0-matrix semigroup 2x5 over
<permutation group of size 1007 with 1 generators>>
<permutation group of size 1007 with 1 generator>>
]]></Example>
</Description>
</ManSection>
Expand Down
2 changes: 1 addition & 1 deletion doc/tut/algvspc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ into one line.
gap> m:= [ [ 1, 2, 3 ], [ 0, 1, 6 ], [ 0, 0, 1 ] ];;
gap> A:= Algebra( Rationals, [ m ] );;
gap> subA:= Subalgebra( A, [ m-m^2 ] );
<algebra over Rationals, with 1 generators>
<algebra over Rationals, with 1 generator>
gap> Dimension( subA );
2
gap> idA:= Ideal( A, [ m-m^3 ] );
Expand Down
4 changes: 2 additions & 2 deletions grp/basic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ DeclareConstructor( "CyclicGroupCons", [ IsGroup, IsInt ] );
## gap> CyclicGroup(IsPermGroup,12);
## Group([ (1,2,3,4,5,6,7,8,9,10,11,12) ])
## gap> matgrp1:= CyclicGroup( IsMatrixGroup, 12 );
## <matrix group of size 12 with 1 generators>
## <matrix group of size 12 with 1 generator>
## gap> FieldOfMatrixGroup( matgrp1 );
## Rationals
## gap> matgrp2:= CyclicGroup( IsMatrixGroup, GF(2), 12 );
## <matrix group of size 12 with 1 generators>
## <matrix group of size 12 with 1 generator>
## gap> FieldOfMatrixGroup( matgrp2 );
## GF(2)
## ]]></Example>
Expand Down
9 changes: 8 additions & 1 deletion lib/addmagma.gi
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ InstallMethod( ViewObj,
"for an add. magma with generators",
[ IsAdditiveMagma and HasGeneratorsOfAdditiveMagma ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfAdditiveMagma( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<additive magma with ",
Length( GeneratorsOfAdditiveMagma( A ) ), " generators>" );
nrgens, " generator", plural, ">" );
end );

InstallMethod( ViewObj,
Expand Down
28 changes: 14 additions & 14 deletions lib/algebra.gd
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ DeclareAttribute( "GeneratorsOfLeftOperatorRingWithOne",
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> GeneratorsOfAlgebra( A );
## [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ],
## [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
Expand Down Expand Up @@ -287,7 +287,7 @@ DeclareSynonymAttr( "GeneratorsOfFLMLOR", GeneratorsOfLeftOperatorRing );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> GeneratorsOfAlgebraWithOne( A );
## [ [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
## ]]></Example>
Expand Down Expand Up @@ -408,7 +408,7 @@ DeclareAttribute( "IndicesOfAdjointBasis", IsBasis );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOneByGenerators( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> RadicalOfAlgebra( A );
## <algebra of dimension 2 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -543,7 +543,7 @@ DeclareAttribute( "NullAlgebra", IsRing );
## gap> A:= QuaternionAlgebra( Rationals );;
## gap> b:= BasisVectors( Basis( A ) );;
## gap> B:= Subalgebra( A, [ b[4] ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> ProductSpace( A, B );
## <vector space of dimension 4 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -662,7 +662,7 @@ DeclareSynonym( "AsAlgebra", AsFLMLOR );
## gap> V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;
## gap> A:= AsAlgebra( Rationals, V );;
## gap> AsAlgebraWithOne( Rationals, A );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -721,7 +721,7 @@ DeclareSynonym( "AsSubalgebra", AsSubFLMLOR );
## gap> B:= AsAlgebra( Rationals, V );;
## gap> C:= AsAlgebraWithOne( Rationals, B );;
## gap> AC:= AsSubalgebraWithOne( A, C );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -1189,7 +1189,7 @@ DeclareSynonym( "AlgebraByGenerators", FLMLORByGenerators );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> Dimension( A );
## 2
## ]]></Example>
Expand Down Expand Up @@ -1226,9 +1226,9 @@ DeclareSynonym( "Algebra", FLMLOR );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> B:= Subalgebra( A, [ m^2 ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand All @@ -1254,7 +1254,7 @@ DeclareSynonym( "Subalgebra", SubFLMLOR );
## <Example><![CDATA[
## gap> m:= RandomMat( 3, 3 );;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> SubalgebraNC( A, [ IdentityMat( 3, 3 ) ], "basis" );
## <algebra of dimension 1 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -1308,7 +1308,7 @@ DeclareSynonym( "AlgebraWithOneByGenerators", FLMLORWithOneByGenerators );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> Dimension( A );
## 3
## gap> One(A);
Expand Down Expand Up @@ -1342,7 +1342,7 @@ DeclareSynonym( "AlgebraWithOne", FLMLORWithOne );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> B1:= SubalgebraWithOne( A, [ m ] );;
## gap> B2:= Subalgebra( A, [ m ] );;
## gap> Dimension( B1 );
Expand Down Expand Up @@ -1374,7 +1374,7 @@ DeclareSynonym( "SubalgebraWithOne", SubFLMLORWithOne );
## <Example><![CDATA[
## gap> m:= RandomMat( 3, 3 );; A:= Algebra( Rationals, [ m ] );;
## gap> SubalgebraWithOneNC( A, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -2168,7 +2168,7 @@ DeclareSynonym( "IsLieNilpotentElement", IsNilpotentElement);
## rec( hom_components := function( d ) ... end, max_degree := 9,
## min_degree := 1, source := Integers )
## gap> g.hom_components( 3 );
## <vector space over GF(3), with 1 generators>
## <vector space over GF(3), with 1 generator>
## gap> g.hom_components( 14 );
## <vector space of dimension 0 over GF(3)>
## ]]></Example>
Expand Down
45 changes: 40 additions & 5 deletions lib/algebra.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1887,9 +1887,16 @@ InstallMethod( ViewObj,
"for a FLMLOR with known generators",
[ IsFLMLOR and HasGeneratorsOfAlgebra ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfFLMLOR( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<free left module over ", LeftActingDomain( A ),
", and ring, with ",
Length( GeneratorsOfFLMLOR( A ) ), " generators>" );
nrgens, " generator", plural, ">" );
end );


Expand Down Expand Up @@ -1943,9 +1950,16 @@ InstallMethod( ViewObj,
"for a FLMLOR-with-one with known generators",
[ IsFLMLORWithOne and HasGeneratorsOfFLMLORWithOne ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfAlgebraWithOne( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<free left module over ", LeftActingDomain( A ),
", and ring-with-one, with ",
Length( GeneratorsOfAlgebraWithOne( A ) ), " generators>" );
nrgens, " generator", plural, ">" );

end );

Expand Down Expand Up @@ -2000,8 +2014,15 @@ InstallMethod( ViewObj,
"for an algebra with known generators",
[ IsAlgebra and HasGeneratorsOfAlgebra ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfAlgebra( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<algebra over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebra( A ) ), " generators>" );
nrgens, " generator", plural, ">" );
end );


Expand Down Expand Up @@ -2056,8 +2077,15 @@ InstallMethod( ViewObj,
"for an algebra-with-one with known generators",
[ IsAlgebraWithOne and HasGeneratorsOfAlgebraWithOne ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfAlgebraWithOne( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<algebra-with-one over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebraWithOne( A ) ), " generators>" );
nrgens, " generator", plural, ">" );
end );


Expand Down Expand Up @@ -2111,8 +2139,15 @@ InstallMethod( ViewObj,
"for a Lie algebra with known generators",
[ IsLieAlgebra and HasGeneratorsOfAlgebra ],
function( A )
local nrgens, plural;
nrgens := Length( GeneratorsOfAlgebra( A ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
Print( "<Lie algebra over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebra( A ) ), " generators>" );
nrgens, " generator", plural, ">" );
end );


Expand Down
4 changes: 2 additions & 2 deletions lib/alglie.gd
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ DeclareOperation( "PthPowerImage", [ IsJacobianElement, IsInt ] );
## gap> L := JenningsLieAlgebra(SmallGroup(4,1)); # group C_4
## <Lie algebra of dimension 2 over GF(2)>
## gap> L0 := Subalgebra(L,GeneratorsOfAlgebra(L){[1]});
## <Lie algebra over GF(2), with 1 generators>
## <Lie algebra over GF(2), with 1 generator>
## gap> Dimension(L0);
## 1
## gap> PClosureSubalgebra(L0); last=L;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ DeclareAttribute( "JenningsLieAlgebra", IsGroup );
## gap> List( [1,2,3], g.hom_components );
## [ <vector space over GF(3), with 3 generators>,
## <vector space over GF(3), with 2 generators>,
## <vector space over GF(3), with 1 generators> ]
## <vector space over GF(3), with 1 generator> ]
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
4 changes: 2 additions & 2 deletions lib/algrep.gd
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,9 @@ DeclareAttribute( "FaithfulModule", IsAlgebra );
## gap> A:= Rationals^[3,3];;
## gap> V:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;
## gap> B:= Subalgebra( A, [ Basis(A)[1] ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> W:= ModuleByRestriction( V, B );
## <left-module over <algebra over Rationals, with 1 generators>>
## <left-module over <algebra over Rationals, with 1 generator>>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
2 changes: 1 addition & 1 deletion lib/gprd.gd
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ DeclareGlobalFunction("SubdirectDiagonalPerms");
## gap> au:=AutomorphismGroup(n);;
## gap> au:=First(AsSet(au),i->Order(i)=3);;
## gap> au:=Group(au);
## <group with 1 generators>
## <group with 1 generator>
## gap> IsGroupOfAutomorphisms(au);
## true
## gap> SemidirectProduct(au,n);
Expand Down
21 changes: 17 additions & 4 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -4396,25 +4396,38 @@ InstallMethod( ViewString,
"for a group with generators",
[ IsGroup and HasGeneratorsOfMagmaWithInverses ],
function( G )
local nrgens, plural;
if IsEmpty( GeneratorsOfMagmaWithInverses( G ) ) then
return "<trivial group>";
else
nrgens := Length( GeneratorsOfMagmaWithInverses( G ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
return Concatenation("<group with ",
String( Length( GeneratorsOfMagmaWithInverses( G ) ) ),
" generators>");
String( nrgens ),
" generator", plural, ">");
fi;
end );

InstallMethod( ViewString,
"for a group with generators and size",
[ IsGroup and HasGeneratorsOfMagmaWithInverses and HasSize],
function( G )
local nrgens, plural;
if IsEmpty( GeneratorsOfMagmaWithInverses( G ) ) then
return "<trivial group>";
else
nrgens := Length( GeneratorsOfMagmaWithInverses( G ) );
if nrgens = 1 then
plural := "";
else
plural := "s";
fi;
return Concatenation("<group of size ", String(Size(G))," with ",
String(Length( GeneratorsOfMagmaWithInverses( G ) )),
" generators>");
String(nrgens), " generator", plural, ">");
fi;
end );

Expand Down
2 changes: 1 addition & 1 deletion lib/grpfp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ InstallTrueMethod(CanEasilyTestMembership, IsSubgroupFgGroup and IsWholeFamily);
## gap> IsFpGroup(g);
## true
## gap> h:=CyclicGroup(2);
## <pc group of size 2 with 1 generators>
## <pc group of size 2 with 1 generator>
## gap> IsFpGroup(h);
## false
## ]]></Example>
Expand Down
Loading

0 comments on commit e44d9a0

Please sign in to comment.