Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit tester filters from ShowImpliedFilters output #2243

Merged
merged 1 commit into from
Mar 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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