Skip to content

Commit

Permalink
Merge pull request #140 from gap-packages/avoid
Browse files Browse the repository at this point in the history
avoid trivial function wrappers with ForAll
  • Loading branch information
cdwensley authored Jan 8, 2024
2 parents c7de56e + 5fe662f commit 3f210cc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions lib/gp3map.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## This file implements functions for 3Dimensional Mappings for
## (pre-)crossed squares and (pre-)cat2-groups.
##
#Y Copyright (C) 2001-2022, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

#############################################################################
Expand Down Expand Up @@ -261,20 +261,20 @@ InstallGlobalFunction( CrossedSquareMorphism, function( arg )
if ok and IsList( list ) and ( Length( list ) = 4 ) then
f := list[1];
if HasIsGroupHomomorphism(f) and IsGroupHomomorphism(f) then
if ForAll( list, m -> IsGroupHomomorphism(m) ) then
if ForAll( list, IsGroupHomomorphism ) then
ishom := true;
else
ok := false;
fi;
elif isxs and HasIsXModMorphism( f ) and IsXModMorphism( f ) then
if ForAll( list, m -> IsXModMorphism(m) ) then
if ForAll( list, IsXModMorphism ) then
ishom := false;
else
ok := false;
fi;
elif (not isxs) and HasIsCat1GroupMorphism( f )
and IsCat1GroupMorphism( f ) then
if ForAll( list, m -> IsCat1GroupMorphism(m) ) then
if ForAll( list, IsCat1GroupMorphism ) then
ishom := false;
else
ok := false;
Expand Down Expand Up @@ -313,7 +313,7 @@ function( src, rng, list )
local mor, ok;

if not ( Length( list ) = 4 ) and
ForAll( list, m -> IsPreXModMorphism(m) ) then
ForAll( list, IsPreXModMorphism ) then
Error( "third argument should be a list of 4 pre-xmod-morphisms" );
fi;
mor := MakeHigherDimensionalGroupMorphism( src, rng, list );
Expand All @@ -338,7 +338,7 @@ function( xs1, xs2, list )
L2, M2, N2, P2, l, m, n, p, upmor, ltmor, dnmor, rtmor, mor, ok;

if not ( Length( list ) = 4 ) and
ForAll( list, m -> IsGroupHomomorphism(m) ) then
ForAll( list, IsGroupHomomorphism ) then
Error( "third argument should be a list of 4 group homomorphisms" );
fi;
up1 := Up2DimensionalGroup( xs1 );
Expand Down Expand Up @@ -399,7 +399,7 @@ function( src, rng, list )
local mor, ok;

if not ( Length( list ) = 4 ) and
ForAll( list, m -> IsXModMorphism(m) ) then
ForAll( list, IsXModMorphism ) then
Error( "third argument should be a list of xmod morphisms" );
fi;
mor := PreCrossedSquareMorphismByPreXModMorphisms( src, rng, list );
Expand All @@ -422,7 +422,7 @@ function( src, rng, list )
local mor, ok;

if not ( Length( list ) = 4 ) and
ForAll( list, m -> IsGroupHomomorphism(m) ) then
ForAll( list, IsGroupHomomorphism ) then
Error( "third argument should be a list of xmod morphisms" );
fi;
mor := PreCrossedSquareMorphismByGroupHomomorphisms( src, rng, list );
Expand Down Expand Up @@ -564,7 +564,7 @@ function( C1, C2, homs )
if not ( Length( homs ) = 4 ) then
Error( "expecting 4 group homomorphisms" );
fi;
if not ForAll( homs, h -> IsGroupHomomorphism( h ) ) then
if not ForAll( homs, IsGroupHomomorphism ) then
Error( "expecting 4 group homomorphisms" );
fi;
gamma := homs[1];
Expand Down
6 changes: 3 additions & 3 deletions lib/gp3obj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## This file implements generic methods for (pre-)crossed squares
## and (pre-)cat2-groups.
##
#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.

#############################################################################
Expand Down Expand Up @@ -123,7 +123,7 @@ function( innM )
local gens, M, map, xp;

gens := GeneratorsOfGroup( innM );
if not ForAll( gens, g -> HasConjugatorOfConjugatorIsomorphism(g) ) then
if not ForAll( gens, HasConjugatorOfConjugatorIsomorphism ) then
Error( "innM is not a group of inner automorphisms" );
fi;
M := Source( gens[1] );
Expand Down Expand Up @@ -533,7 +533,7 @@ InstallGlobalFunction( CrossedSquare, function( arg )
else
ok := false;
fi;
elif ( nargs = 4 ) and ForAll( arg, a -> IsGroup(a) ) then
elif ( nargs = 4 ) and ForAll( arg, IsGroup ) then
XS := CrossedSquareByNormalSubgroups(arg[1],arg[2],arg[3],arg[4]);
elif ( nargs = 6 ) then
XS := CrossedSquareByXMods(arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
Expand Down
4 changes: 2 additions & 2 deletions lib/gp4obj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## This file implements generic methods for (pre-)crossed cubes
## and (pre-)cat3-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.

##############################################################################
Expand Down Expand Up @@ -155,7 +155,7 @@ InstallGlobalFunction( PreCat3Group, function( arg )
Print( " or: (Pre)Cat3Group( Xcube );\n" );
return fail;
fi;
if not ForAll( arg, C -> HasHigherDimension(C) ) then
if not ForAll( arg, HasHigherDimension ) then
Error( "each argument should have a higher dimension" );
fi;
if ( nargs = 1 ) then
Expand Down
4 changes: 2 additions & 2 deletions lib/gpd2obj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W gpd2obj.gi GAP4 package `XMod' Chris Wensley
##
#Y Copyright (C) 2001-2022, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

#############################################################################
Expand All @@ -28,7 +28,7 @@ InstallGlobalFunction( PreXModWithObjects, function( arg )
nargs := Length( arg );
# list of pieces
if ( ( nargs = 1 ) and IsList( arg[1] )
and ForAll( arg[1], G -> IsPreXModWithObjects(G) ) ) then
and ForAll( arg[1], IsPreXModWithObjects ) ) then
Info( InfoXMod, 2, "ByUnion" );
return UnionOfPiecesOp( arg[1], arg[1][1] );
# prexmod plus single object
Expand Down
12 changes: 6 additions & 6 deletions lib/gpnmap.gi
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsInjective(f) );
ok := ForAll( 2d_maps, IsInjective );
if not ok then
return false;
fi;
Expand All @@ -456,7 +456,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsSurjective(f) );
ok := ForAll( 2d_maps, IsSurjective );
if not ok then
return false;
fi;
Expand All @@ -481,7 +481,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsSingleValued(f) );
ok := ForAll( 2d_maps, IsSingleValued );
if not ok then
return false;
fi;
Expand All @@ -506,7 +506,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsTotal(f) );
ok := ForAll( 2d_maps, IsTotal );
if not ok then
return false;
fi;
Expand All @@ -531,7 +531,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsBijective(f) );
ok := ForAll( 2d_maps, IsBijective );
if not ok then
return false;
fi;
Expand All @@ -558,7 +558,7 @@ function( map )
else
2d_maps := ListOf2DimensionalMappings(map);
fi;
ok := ForAll( 2d_maps, f -> IsEndomorphism2DimensionalDomain( f ) );
ok := ForAll( 2d_maps, IsEndomorphism2DimensionalDomain );
if not ok then
return false;
fi;
Expand Down
6 changes: 3 additions & 3 deletions lib/isoclinic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W isoclinic.gi GAP4 package `XMod' Alper Odabas
#W & Enver Uslu
#Y Copyright (C) 2001-2023, Chris Wensley et al
#Y Copyright (C) 2001-2024, Chris Wensley et al
#Y
## This file contains generic methods for finding isoclinism classes
## of crossed modules.
Expand Down Expand Up @@ -1076,11 +1076,11 @@ function( L )
fi;
isxmod := IsPreXMod( ob1 );
if isxmod then
if not ForAll( L, ob -> IsPreXMod( ob ) ) then
if not ForAll( L, IsPreXMod ) then
return fail;
fi;
else
if not ForAll( L, ob -> IsPreCat1Group( ob ) ) then
if not ForAll( L, IsPreCat1Group ) then
return fail;
fi;
fi;
Expand Down

0 comments on commit 3f210cc

Please sign in to comment.