Skip to content

Commit

Permalink
gprd.gi: preserve properties in DirectProduct more intelligently
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Nov 25, 2018
1 parent 3ddd860 commit d3c6e9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gprd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ local d, prop;
for prop in [IsFinite, IsNilpotentGroup, IsAbelian, IsSolvableGroup, IsBand,
IsInverseSemigroup, IsRegularSemigroup, IsIdempotentGenerated,
IsLeftZeroSemigroup, IsRightZeroSemigroup, IsZeroSemigroup] do
if ForAll(arg, Tester(prop)) then
Setter(prop)(d, ForAll(arg, prop));
if ForAny(arg, x -> Tester(prop)(x) and not prop(x)) then
Setter(prop)(d, false);
elif ForAll(arg, x -> Tester(prop)(x) and prop(x)) then
Setter(prop)(d, true);
fi;
od;

Expand Down
4 changes: 4 additions & 0 deletions tst/testinstall/gprd.tst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ true
gap> d3 := DirectProduct(g2, g2);;
gap> HasIsFinite(d3) and not IsFinite(d3);
true
gap> g3 := SymmetricGroup(5);;
gap> d4 := DirectProduct(g1, g2, g3);;
gap> HasIsFinite(d4) and not IsFinite(d4);
true

#
gap> STOP_TEST("gprd.tst");
Expand Down

0 comments on commit d3c6e9f

Please sign in to comment.