Skip to content

Commit 5859fbe

Browse files
committed
Tweak ShowImpliedFilters some more
Now for "May imply with", we also hide implications which already follow from the other filter. For example, before: gap> ShowImpliedFilters(IsFinitelyGeneratedGroup); ... +IsNilpotentGroup IsSupersolvableGroup IsSolvableGroup IsPolycyclicGroup IsNilpotentByFinite After this change: gap> ShowImpliedFilters(IsFinitelyGeneratedGroup); ... +IsNilpotentGroup IsPolycyclicGroup Indeed, IsNilpotentGroup already implies IsSolvableGroup and IsNilpotentByFinite on its own.
1 parent dd60f28 commit 5859fbe

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

lib/methwhy.g

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,19 +301,30 @@ BIND_GLOBAL("ShowImpliedFilters",function(filter)
301301
flags:=FLAGS_FILTER(filter);
302302
implied := WITH_IMPS_FLAGS(flags);
303303
atomic readonly IMPLICATIONS_SIMPLE do
304+
# select all implications which involved <filter> in the requirements
304305
f:=Filtered(IMPLICATIONS_SIMPLE, x->IS_SUBSET_FLAGS(x[2],flags));
305306
Append(f, Filtered(IMPLICATIONS_COMPOSED, x->IS_SUBSET_FLAGS(x[2],flags)));
306-
extra_implications:=[];
307-
for implication in f do
308-
diff_reqs:=SUB_FLAGS(implication[2],flags); # the additional requirements
309-
diff_impls:=SUB_FLAGS(implication[1],implied); # the additional implications
310-
diff_impls:=SUB_FLAGS(diff_impls,diff_reqs);
311-
if SIZE_FLAGS(diff_reqs) > 0 and SIZE_FLAGS(diff_impls) > 0 then
312-
Add(extra_implications, [diff_reqs, diff_impls]);
313-
fi;
314-
od;
315307
od; # end atomic
316308

309+
extra_implications:=[];
310+
for implication in f do
311+
# the additional requirements
312+
diff_reqs:=SUB_FLAGS(implication[2],flags);
313+
if SIZE_FLAGS(diff_reqs) = 0 then
314+
Assert(0, IS_SUBSET_FLAGS(implied,implication[1]));
315+
continue;
316+
fi;
317+
# the combined implications...
318+
diff_impls:=implication[1];
319+
# ... minus those implications that already follow from <filter>
320+
diff_impls:=SUB_FLAGS(diff_impls,implied);
321+
# ... minus those implications that already follow from diff_reqs
322+
diff_impls:=SUB_FLAGS(diff_impls,WITH_IMPS_FLAGS(diff_reqs));
323+
if SIZE_FLAGS(diff_impls) > 0 then
324+
Add(extra_implications, [diff_reqs, diff_impls]);
325+
fi;
326+
od;
327+
317328
# remove "obvious" implications
318329
if IS_ELEMENTARY_FILTER(filter) then
319330
implied := SUB_FLAGS(implied, flags);

0 commit comments

Comments
 (0)