From d3c6e9fd214b83404b82e5066fcf06b00311652f Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Sun, 25 Nov 2018 18:59:35 +0100 Subject: [PATCH] gprd.gi: preserve properties in DirectProduct more intelligently --- lib/gprd.gi | 6 ++++-- tst/testinstall/gprd.tst | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/gprd.gi b/lib/gprd.gi index a151ba3260..b5289e1d80 100644 --- a/lib/gprd.gi +++ b/lib/gprd.gi @@ -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; diff --git a/tst/testinstall/gprd.tst b/tst/testinstall/gprd.tst index 4baa126746..f05f28d984 100644 --- a/tst/testinstall/gprd.tst +++ b/tst/testinstall/gprd.tst @@ -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");