Skip to content

Commit

Permalink
Omit tester filters from ShowImpliedFilters output
Browse files Browse the repository at this point in the history
This is a follow-up to #2224.  As discussed there,
those property tester filters are omitted from the output
for which the property itself is already shown.
  • Loading branch information
ThomasBreuer authored and fingolfin committed Mar 20, 2018
1 parent 59442b7 commit fdd12d6
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions lib/methwhy.g
Original file line number Diff line number Diff line change
Expand Up @@ -273,34 +273,31 @@ end);
## <Description>
## Displays information about the filters that may be
## implied by <A>filter</A>. They are given by their names.
## <C>ShowImpliedFilters</C> first displays the names of all filters
## <Ref Func="ShowImpliedFilters"/> first displays the names of all filters
## that are unconditionally implied by <A>filter</A>. It then displays
## implications that require further filters to be present (indicating
## by <C>+</C> the required further filters).
## <Example><![CDATA[
## gap> ShowImpliedFilters(IsNilpotentGroup);
## Implies:
## IsSupersolvableGroup
## HasIsSupersolvableGroup
## IsSolvableGroup
## HasIsSolvableGroup
## IsNilpotentByFinite
## HasIsNilpotentByFinite
##
##
## May imply with:
## +IsFinitelyGeneratedGroup
## +HasIsFinitelyGeneratedGroup
## IsPolycyclicGroup
## HasIsPolycyclicGroup
##
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
BIND_GLOBAL("ShowImpliedFilters",function(filter)
local flags, implied, f, extra_implications, implication, name, diff_reqs, diff_impls;
local flags, implied, f, extra_implications, implication, name, diff_reqs,
diff_impls, reduced;

flags:=FLAGS_FILTER(filter);
implied := WITH_IMPS_FLAGS(flags);
atomic readonly IMPLICATIONS_SIMPLE do
Expand All @@ -322,20 +319,28 @@ local flags, implied, f, extra_implications, implication, name, diff_reqs, diff_
implied := SUB_FLAGS(implied, flags);
fi;

reduced:= function( trues )
atomic readonly FILTER_REGION do
return Filtered( trues,
i -> not ( INFO_FILTERS[i] in FNUM_TPRS
and FLAG1_FILTER( FILTERS[i] ) in trues ) );
od;
end;

if SIZE_FLAGS(implied) > 0 then
Print("Implies:\n");
for name in NamesFilter(implied) do
for name in NamesFilter( reduced( TRUES_FLAGS( implied ) ) ) do
Print(" ",name,"\n");
od;
fi;

if Length(extra_implications) > 0 then
Print("\n\nMay imply with:\n");
for implication in extra_implications do
for name in NamesFilter(implication[1]) do
for name in NamesFilter( reduced( TRUES_FLAGS( implication[1] ) ) ) do
Print("+",name,"\n");
od;
for name in NamesFilter(implication[2]) do
for name in NamesFilter( reduced( TRUES_FLAGS( implication[2] ) ) ) do
Print(" ",name,"\n");
od;
Print("\n");
Expand Down Expand Up @@ -393,7 +398,7 @@ BIND_GLOBAL("PageSource", function ( fun, nr... )
f := Filename(List(GAPInfo.RootPaths, Directory), f);
fi;
if f = fail and fun in OPERATIONS then
# for operations we show the location(s) of their operation
# for operations we show the location(s) of their declaration
locs := GET_DECLARATION_LOCATIONS(fun);
if n > Length(locs) then
Print("Operation ", NameFunction(fun), " has only ",
Expand Down

0 comments on commit fdd12d6

Please sign in to comment.