Skip to content

Commit

Permalink
Merge pull request #1359 from zickgraf/master
Browse files Browse the repository at this point in the history
Refactor InfoStringOfInstalledOperationsOfCategory
  • Loading branch information
zickgraf authored Jun 26, 2023
2 parents 0db711c + 6245090 commit f11a717
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CAP",
Subtitle := "Categories, Algorithms, Programming",
Version := "2023.06-04",
Version := "2023.06-05",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
39 changes: 19 additions & 20 deletions CAP/gap/PrintingFunctions.gi
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ InstallGlobalFunction( InfoStringOfInstalledOperationsOfCategory,

function( category )
local list_of_mathematical_properties, list_of_potential_algorithmic_properties,
list_of_algorithmic_properties, list_of_maximal_algorithmic_properties, property, result;
list_of_algorithmic_properties, list_of_maximal_algorithmic_properties, property, result,
list_of_non_algorithmic_mathematical_properties, list_of_maximal_non_algorithmic_mathematical_properties;

if not IsCapCategory( category ) then
Error( "first argument must be a category" );
return;
fi;

list_of_mathematical_properties := ListKnownCategoricalProperties( category );

list_of_potential_algorithmic_properties := RecNames( CAP_INTERNAL_CONSTRUCTIVE_CATEGORIES_RECORD );

list_of_algorithmic_properties := Intersection( list_of_mathematical_properties, list_of_potential_algorithmic_properties );
list_of_potential_algorithmic_properties := RecNames( CAP_INTERNAL_CONSTRUCTIVE_CATEGORIES_RECORD );

list_of_algorithmic_properties := Filtered( list_of_algorithmic_properties, p -> IsEmpty( CheckConstructivenessOfCategory( category, p ) ) );
list_of_algorithmic_properties := Filtered( list_of_mathematical_properties, p -> p in list_of_potential_algorithmic_properties and IsEmpty( CheckConstructivenessOfCategory( category, p ) ) );

list_of_maximal_algorithmic_properties := MaximalObjects( list_of_algorithmic_properties, { p1, p2 } ->
IsSubset( CAP_INTERNAL_CONSTRUCTIVE_CATEGORIES_RECORD.( p2 ), CAP_INTERNAL_CONSTRUCTIVE_CATEGORIES_RECORD.( p1 ) ) or
Expand All @@ -34,31 +33,31 @@ InstallGlobalFunction( InfoStringOfInstalledOperationsOfCategory,
result := Concatenation( result, " operations for this category" );
if not IsEmpty( list_of_maximal_algorithmic_properties ) then
result := Concatenation( result, " which algorithmically" );
for property in list_of_maximal_algorithmic_properties do
result := Concatenation( result, "\n* " );
result := Concatenation( result, property );
od;
fi;
for property in list_of_maximal_algorithmic_properties do
result := Concatenation( result, "\n* " );
result := Concatenation( result, property );
od;

list_of_mathematical_properties := Difference( list_of_mathematical_properties, list_of_algorithmic_properties );
list_of_non_algorithmic_mathematical_properties := Difference( list_of_mathematical_properties, list_of_algorithmic_properties );

list_of_mathematical_properties := MaximalObjects( list_of_mathematical_properties, { p1, p2 } -> p1 in ListImpliedFilters( ValueGlobal( p2 ) ) );
list_of_maximal_non_algorithmic_mathematical_properties := MaximalObjects( list_of_non_algorithmic_mathematical_properties, { p1, p2 } -> p1 in ListImpliedFilters( ValueGlobal( p2 ) ) );

if not IsEmpty( list_of_mathematical_properties ) then
if not IsEmpty( list_of_algorithmic_properties ) then
if not IsEmpty( list_of_maximal_non_algorithmic_mathematical_properties ) then
if not IsEmpty( list_of_maximal_algorithmic_properties ) then
result := Concatenation( result, "\nand furthermore" );
else
result := Concatenation( result, " which" );
fi;
result := Concatenation( result, " mathematically" );
for property in list_of_maximal_non_algorithmic_mathematical_properties do
result := Concatenation( result, "\n* " );
result := Concatenation( result, property );
if property in list_of_potential_algorithmic_properties then
result := Concatenation( result, " (but not yet algorithmically)" );
fi;
od;
fi;
for property in list_of_mathematical_properties do
result := Concatenation( result, "\n* " );
result := Concatenation( result, property );
if property in Difference( list_of_potential_algorithmic_properties, list_of_algorithmic_properties ) then
result := Concatenation( result, " (but not yet algorithmically)" );
fi;
od;

return result;

Expand Down

0 comments on commit f11a717

Please sign in to comment.