From a8c32bc617b4f149912ee2b269bc39e8ced4ea7e Mon Sep 17 00:00:00 2001 From: cdwensley Date: Sat, 6 Jan 2024 21:15:54 +0000 Subject: [PATCH] avoid trivial function wrappers --- lib/apps.gi | 18 +++++++++--------- lib/gp2ind.gi | 18 +++++++++--------- lib/gp2obj.gi | 6 +++--- lib/gp2up.gi | 4 ++-- lib/gpgpd.gi | 6 +++--- lib/gpnmap.gi | 20 ++++++++++---------- lib/util.gi | 15 ++++++++------- 7 files changed, 44 insertions(+), 43 deletions(-) diff --git a/lib/apps.gi b/lib/apps.gi index 45ea1e5..966241d 100644 --- a/lib/apps.gi +++ b/lib/apps.gi @@ -2,7 +2,7 @@ ## #W apps.gi GAP4 package `XMod' Chris Wensley ## -#Y Copyright (C) 2001-2020, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ############################################################################## @@ -197,7 +197,7 @@ function( X0 ) bdy0 := Boundary( X0 ); Q0 := Image( bdy0 ); if IsAbelian( P0 ) then - return List( RightCosets( P0, Q0 ), c -> Representative(c) ); + return List( RightCosets( P0, Q0 ), Representative ); fi; iterM0 := Iterator( M0 ); ## elM0 := Elements( M0 ); @@ -230,7 +230,7 @@ function( X0 ) fi; od; if not IsAbelian( P0 ) then - conj := List( ConjugacyClasses( P0 ), c -> Elements( c ) ); + conj := List( ConjugacyClasses( P0 ), Elements ); numj := Length( conj ); pos := ListWithIdenticalEntries( numj, 0 ); for i in [1..numj] do @@ -264,7 +264,7 @@ function( X0 ) bdy0 := Boundary( X0 ); Q0 := Image( bdy0 ); if IsAbelian( P0 ) then - return List( RightCosets( P0, Q0 ), c -> Representative(c) ); + return List( RightCosets( P0, Q0 ), Representative ); fi; iterM0 := Iterator( M0 ); ## elM0 := Elements( M0 ); @@ -315,9 +315,9 @@ function( X0, a ) Error( "element a not in the range group P0" ); fi; Info( InfoXMod, 3, "M0: ", Elements(M0) ); - Info( InfoXMod, 3, List( Elements(M0), g -> Order(g) ) ); + Info( InfoXMod, 3, List( Elements(M0), Order ) ); Info( InfoXMod, 3, "P0: ", Elements(P0) ); - Info( InfoXMod, 3, List( Elements(P0), g -> Order(g) ) ); + Info( InfoXMod, 3, List( Elements(P0), Order ) ); bdy0 := Boundary( X0 ); act0 := XModAction( X0 ); aut0 := Range( act0 ); @@ -422,15 +422,15 @@ function( X0 ) imbdy0 := ImagesSource( bdy0 ); Q0 := P0/imbdy0; conjP0 := ConjugacyClasses( P0 ); - repsP0 := List( conjP0, c -> Representative( c ) ); - eltsP0 := List( conjP0, c -> Elements(c) ); + repsP0 := List( conjP0, Representative ); + eltsP0 := List( conjP0, Elements ); nclP0 := Length( conjP0 ); if ( InfoLevel( InfoXMod ) > 1 ) then Print( "#I Size(P0) = ", Size(P0), "\n" ); Print( "#I imgenM0 = ", imgenM0, "\n" ); #? this is not used Print( "#I cokernel of boundary has IdGroup ", IdGroup(Q0), "\n" ); Print( "#I conjugacy class sizes, reps and orders:classes for P :-\n" ); - Print( "#I ", List( conjP0, c -> Size(c) ), "\n" ); + Print( "#I ", List( conjP0, Size ), "\n" ); Print( "#I repsP0 = ", repsP0, "\n" ); fi; if ( InfoLevel( InfoXMod ) > 2 ) then diff --git a/lib/gp2ind.gi b/lib/gp2ind.gi index 7053488..a0d836c 100644 --- a/lib/gp2ind.gi +++ b/lib/gp2ind.gi @@ -2,7 +2,7 @@ ## #W gp2ind.gi XMOD Package Chris Wensley ## -#Y Copyright (C) 2001-2023, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ## ## This file implements functions for induced crossed modules. @@ -748,9 +748,9 @@ function( X0, iota, trans ) ## (21/01/10, 06/07/10) changed this condition - also changed below if ( Size( series[1] ) < 2000 ) then if ( RemInt( Size(series[1]), 128 ) <> 0 ) then - idseries := List( series, g -> StructureDescription( g ) ); + idseries := List( series, StructureDescription ); else - idseries := List( series, g -> IdGroup( g ) ); + idseries := List( series, IdGroup ); fi; Info( InfoXMod, 2, "CompositionSeries for induced group:" ); Info( InfoXMod, 2, idseries, "\n" ); @@ -896,7 +896,7 @@ function( X0, iota ) genQ := GeneratorsOfGroup( Q ); preQ := List( genQ, q -> PreImagesRepresentativeNC( iota, q ) ); rcos := RightCosets( S, H ); - reps := List( rcos, r -> Representative( r ) ); + reps := List( rcos, Representative ); Info( InfoXMod, 2, "reps = ", reps ); imb := List( genS, r -> ImageElm( iota, ImageElm( bdy, r ) ) ); PI := Action( S, rcos, OnRight ); @@ -974,8 +974,8 @@ InstallGlobalFunction( AllInducedXMods, function( arg ) L := LatticeSubgroups( Q ); norm := NormalSubgroups( Q ); Info( InfoXMod, 2, "normal subgroups of Q: ", norm ); - reps := Reversed( List( ConjugacyClassesSubgroups( L ), - c -> Representative( c ) ) ); + reps := Reversed( List( ConjugacyClassesSubgroups( L ), + Representative ) ); nreps := Length( reps ); Info( InfoXMod, 2, "non-trivial reps = ", [2..nreps-1] ); for r in [ 1 .. nreps-1 ] do @@ -1000,7 +1000,7 @@ InstallGlobalFunction( AllInducedXMods, function( arg ) Psd := StructureDescription( P ); norm := NormalSubgroups( P ); # find representatives of conjugacy classes in Q - sizes := List( norm, n -> Size( n ) ); + sizes := List( norm, Size ); coll := Collected( sizes ); keep := List( norm, n -> true ); k := 1; @@ -1411,7 +1411,7 @@ InstallGlobalFunction( AllInducedCat1Groups, function( args ) Q := args[1]; L := LatticeSubgroups( Q ); reps := Reversed( List( ConjugacyClassesSubgroups(L), - c -> Representative( c ) ) ); + Representative ) ); nreps := Length( reps ); Print( "non-trivial reps = ", [2..nreps-1], "\n" ); for r in [ 2 .. nreps-1 ] do @@ -1432,7 +1432,7 @@ InstallGlobalFunction( AllInducedCat1Groups, function( args ) P := reps[r]; norm := NormalSubgroups( P ); # find representatives of conjugacy classes in Q - sizes := List( norm, n -> Size( n ) ); + sizes := List( norm, Size ); coll := Collected( sizes ); keep := List( norm, n -> true ); k := 1; diff --git a/lib/gp2obj.gi b/lib/gp2obj.gi index a7e55cc..c2f4ae2 100644 --- a/lib/gp2obj.gi +++ b/lib/gp2obj.gi @@ -2,7 +2,7 @@ ## #W gp2obj.gi GAP4 package `XMod' Chris Wensley #W & Murat Alp -#Y Copyright (C) 2001-2023, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ## ## This file contains generic methods for (pre-)crossed modules and @@ -17,7 +17,7 @@ CAT1_LIST_MAX_SIZE := 60; ## reduced from 70 (10/06/20) CAT1_LIST_CLASS_SIZES := - List( [1..CAT1_LIST_MAX_SIZE], n -> NumberSmallGroups(n) ); + List( [1..CAT1_LIST_MAX_SIZE], NumberSmallGroups ); CAT1_LIST_NUMBERS := [ [ 1 ], [ 2 ], [ 2 ], [ 2, 4 ], [ 2 ], [ 2, 4 ], [ 2 ], [ 2, 6, 3, 1, 6 ], [ 2, 4 ], [ 2, 4 ], [ 2 ], [ 2, 4, 2, 4, 8 ], [ 2 ], [ 2, 4 ], [ 4 ], @@ -2775,7 +2775,7 @@ function( G ) od; if not IsBound( CatnGroupNumbers( G ).idem ) then images := IdempotentEndomorphismsData( G ).images; - lens := List( images, L -> Length( L ) ); + lens := List( images, Length ); CatnGroupNumbers( G ).idem := Sum( lens ); fi; if not IsBound( CatnGroupNumbers( G ).cat1 ) then diff --git a/lib/gp2up.gi b/lib/gp2up.gi index 5903d58..ef3c7d9 100644 --- a/lib/gp2up.gi +++ b/lib/gp2up.gi @@ -5,7 +5,7 @@ ## ## This file contains implementations of UpMappings, Derivations & Sections ## -#Y Copyright (C) 2001-2023, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ############################################################################## @@ -1077,7 +1077,7 @@ function( XM ) reg := RegularDerivations( XM ); tab := WhiteheadGroupTable( XM ); im := ImagesList( reg ); - gens := List( tab, row -> PermList( row ) ); + gens := List( tab, PermList ); grp := Group( gens ); strgens := StrongGeneratorsStabChain( StabChain( grp ) ); pos := List( strgens, g -> Position( gens, g ) ); diff --git a/lib/gpgpd.gi b/lib/gpgpd.gi index f84d9a1..dd87f15 100644 --- a/lib/gpgpd.gi +++ b/lib/gpgpd.gi @@ -2,7 +2,7 @@ ## #W gpgpd.gi GAP4 package `XMod' Chris Wensley ## -#Y Copyright (C) 2001-2020, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ############################################################################# @@ -129,7 +129,7 @@ function( C ) bdy := RestrictedMapping( h, kert ); imbdy := Image( bdy ); cosbdy := RightCosets( R, imbdy ); - repbdy := List( cosbdy, c -> Representative(c) ); + repbdy := List( cosbdy, Representative ); np := Length( repbdy ); Info( InfoXMod, 1, "repbdy = ", repbdy ); eR := Image( e, R ); @@ -141,7 +141,7 @@ function( C ) Info( InfoXMod, 1, "loopgp generators: ", loopgp ); loopgp := GroupWithGenerators( loopgp ); cosgp := RightCosets( kert, kerth ); - repsgp := List( cosgp, c -> Representative(c) ); + repsgp := List( cosgp, Representative ); L1 := List( repsgp, g -> g*eroot ); obs := List( repsgp, g -> ImageElm( h, g ) ); rays1 := List( L1, g -> GroupGroupoidElement( C, root, g ) ); diff --git a/lib/gpnmap.gi b/lib/gpnmap.gi index c4f490c..7dd2f1b 100644 --- a/lib/gpnmap.gi +++ b/lib/gpnmap.gi @@ -5,7 +5,7 @@ ## This file implements functions for Higher Dimensional Mappings for ## (pre-)catn-groups. ## -#Y Copyright (C) 2001-2020, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ############################################################################## @@ -93,12 +93,12 @@ function( mor ) fi; genPC := GeneratingCat1Groups( PC ); genQC := GeneratingCat1Groups( QC ); - srcPC := List( genPC, x -> Source(x) ); - srcQC := List( genQC, x -> Source(x) ); - rngPC := List( genPC, x -> Range(x) ); - rngQC := List( genQC, x -> Range(x) ); - rnghoms := List( 2dmor, x -> RangeHom(x) ); - srchoms := List( 2dmor, x -> SourceHom(x) ); + srcPC := List( genPC, Source ); + srcQC := List( genQC, Source ); + rngPC := List( genPC, Range ); + rngQC := List( genQC, Range ); + rnghoms := List( 2dmor, RangeHom ); + srchoms := List( 2dmor, SourceHom ); for x in [1..Length(genPC)] do if ( Source( srchoms[x] ) <> srcPC[x] ) then Info( InfoXMod, 1, x, "a : ", Source(rnghoms[x]), @@ -196,7 +196,7 @@ function( map ) local mors, imors; mors := ListOf2DimensionalMappings( map ); - imors := List( mors, f -> MappingGeneratorsImages(f) ); + imors := List( mors, MappingGeneratorsImages ); return imors; end ); @@ -282,7 +282,7 @@ function( obj ) if ( dim < 4 ) then Error( "should be using method for low dimensions" ); else - idmaps := List( GeneratingCat1Groups( obj ), C -> IdentityMapping(C) ); + idmaps := List( GeneratingCat1Groups( obj ), IdentityMapping ); return PreCatnGroupMorphismByMorphisms( obj, obj, idmaps ); fi; end ); @@ -410,7 +410,7 @@ function( mor ) Info( InfoXMod, 2, "Parameter is not an automorphism" ); return fail; fi; - return Lcm( List(2d_maps, f -> Order(f) ) ); + return Lcm( List(2d_maps, Order ) ); end ); ############################################################################## diff --git a/lib/util.gi b/lib/util.gi index 611e37d..c65d7cb 100644 --- a/lib/util.gi +++ b/lib/util.gi @@ -2,7 +2,7 @@ ## #W util.gi GAP4 package `XMod' Chris Wensley #W & Murat Alp -#Y Copyright (C) 2001-2020, Chris Wensley et al, +#Y Copyright (C) 2001-2024, Chris Wensley et al, #Y School of Computer Science, Bangor University, U.K. ############################################################################## @@ -237,7 +237,7 @@ InstallGlobalFunction( TzPartition, function( T ) fi; fi; od; - commpairs := List( commpairs, L -> Set( L ) ); + commpairs := List( commpairs, Set ); if ( ( TzOptions(T).printLevel > 1 ) and ( comm2 > 0 ) ) then Print( "There were ", comm2, " commutators found in phase 1\n" ); fi; @@ -249,7 +249,7 @@ InstallGlobalFunction( TzPartition, function( T ) r := rels[j]; lr := Length( r ); if ( lr > 1 ) then - freq := Collected( List( r, x -> AbsInt( x ) ) ); + freq := Collected( List( r, AbsInt ) ); fnum := Length( freq ); for x in [1..fnum] do L := freq[x]; @@ -270,7 +270,7 @@ InstallGlobalFunction( TzPartition, function( T ) od; fi; od; - comm2 := Sum( List( commpairs, L -> Length( L ) ) )/2; + comm2 := Sum( List( commpairs, Length ) )/2; if ( ( TzOptions(T).printLevel > 1 ) and ( comm2 > comm1 ) ) then Print( "There were ", comm2 - comm1 ); Print( " commutators found in phase 2\n" ); @@ -430,7 +430,7 @@ InstallGlobalFunction( FactorsPresentation, function( arg ) posn := Filtered( [1..len], k -> fac[k]=i ); Add( subrels, rel{posn} ); od; - sublen := List( subrels, L -> Length( L ) ); + sublen := List( subrels, Length ); subflags := List( chosen[i], k -> flags[k] ); F[i].printLevel := printlevel; subT := F[i].tietze; @@ -697,7 +697,7 @@ function( G, H ) subG := Subgroup( autG, gensub ); while not stop do stop := true; - reps := List( RightCosets( autG, subG ), c -> Representative(c) ); + reps := List( RightCosets( autG, subG ), Representative ); numrep := Length( reps ); i := 1; found := false; @@ -705,7 +705,8 @@ function( G, H ) i := i+1; r := reps[i]; ok := ForAll( H, J -> - ForAll( List(GeneratorsOfGroup(J),j->j^r in J), x->x=true) ); + ForAll( List( GeneratorsOfGroup(J), j->j^r in J ), + x -> x=true ) ); if ok then found := true; stop := false;