Skip to content

Commit

Permalink
Merge pull request #1406 from zickgraf/master
Browse files Browse the repository at this point in the history
More cleanups
  • Loading branch information
zickgraf authored Aug 1, 2023
2 parents b37bc54 + b2764b3 commit 2da4544
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 561 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.08-01",
Version := "2023.08-02",
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
3 changes: 0 additions & 3 deletions CAP/gap/CAP.gd
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ AddCategoricalProperty( [ "IsLocallyOfFiniteInjectiveDimension", "IsLocallyOfFin
DeclareAttribute( "TheoremRecord",
IsCapCategory, "mutable" );

DeclareOperation( "AddCategoryToFamily",
[ IsCapCategory, IsString ] );

###################################
##
#! @Section Constructor
Expand Down
23 changes: 0 additions & 23 deletions CAP/gap/CAP.gi
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ InstallGlobalFunction( "CreateCapCategoryWithDataTypes",

obj!.predicate_logic := true;

AddCategoryToFamily( obj, "general" );

else

obj!.predicate_logic := false;
Expand Down Expand Up @@ -341,27 +339,6 @@ InstallMethod( TheoremRecord,

end );

######################################################
##
## Add functions
##
######################################################

InstallMethod( AddCategoryToFamily,
[ IsCapCategory, IsString ],

function( category, family )

if not IsBound( category!.families ) then

category!.families := [ ];

fi;

Add( category!.families, LowercaseString( family ) );

end );

#######################################
##
## Caching
Expand Down
208 changes: 0 additions & 208 deletions CAP/gap/TheoremParser.gi
Original file line number Diff line number Diff line change
Expand Up @@ -976,214 +976,6 @@ end );

## PARSE_THEOREM_FROM_LATEX( "A:\Obj ~|~ \IsZero( A ) \vdash \IsProjective( A )" );

InstallGlobalFunction( SEARCH_FOR_VARIABLE_NAME_APPEARANCE,

function( tree, names )
local appearance_list, current_result, i, j, name_position, return_list;

## command_case
if IsRecord( tree ) then

return SEARCH_FOR_VARIABLE_NAME_APPEARANCE( tree!.arguments, names );

fi;

if IsString( tree ) then

name_position := Position( names, tree );

return_list := List( names, i -> [ ] );

if name_position <> fail then

return_list[ name_position ] := [ [ ] ];

fi;

return return_list;

fi;

if IsList( tree ) and not IsString( tree ) then

return_list := List( names, i -> [ ] );

for i in [ 1 .. Length( tree ) ] do

current_result := SEARCH_FOR_VARIABLE_NAME_APPEARANCE( tree[ i ], names );

for j in [ 1 .. Length( current_result ) ] do

current_result[ j ] := List( current_result[ j ], k -> Concatenation( [ i ], k ) );

return_list[ j ] := Concatenation( current_result[ j ], return_list[ j ] );

od;

od;

return return_list;

fi;

end );

##
InstallGlobalFunction( REPLACE_VARIABLE,

function( tree, names, replacements )
local return_rec, entry;

if IsString( tree ) and Position( names, tree ) <> fail then

return replacements[ Position( names, tree ) ];

fi;

if IsList( tree ) then

return List( tree, i -> REPLACE_VARIABLE( i, names, replacements ) );

fi;

if IsRecord( tree ) then

return_rec := ShallowCopy( tree );

return_rec.arguments := REPLACE_VARIABLE( tree!.arguments, names, replacements );

return return_rec;

fi;

return tree;

end );

InstallGlobalFunction( REPLACE_INTEGER_VARIABLE,

function( tree )
local int;

if IsString( tree ) then

int := STRING_REPRESENTS_INTEGER( tree );

if int = false then

return tree;

else

return Int( tree );

fi;

fi;

if IsList( tree ) then

return List( tree, REPLACE_INTEGER_VARIABLE );

fi;

if IsRecord( tree ) then

int := ShallowCopy( tree );

int!.arguments := REPLACE_INTEGER_VARIABLE( tree!.arguments );

return int;

fi;

return tree;

end );

InstallGlobalFunction( SEARCH_FOR_INT_VARIABLE_APPEARANCE,

function( tree )
local appearance_list, current_result, i, j, int;

if IsList( tree ) and Length( tree ) = 2 and IsString( tree[ 1 ] ) and IsList( tree[ 2 ] ) and not IsString( tree[ 2 ] ) then

return SEARCH_FOR_INT_VARIABLE_APPEARANCE( tree[ 2 ] );

fi;

if IsList( tree ) then

appearance_list := [ ];

for i in [ 1 .. Length( tree ) ] do

if IsString( tree[ i ] ) then

int := STRING_REPRESENTS_INTEGER( tree[ i ] );

if int <> false then

Add( appearance_list, [ [ i ], Int( tree[ i ] ) ] );

fi;

elif IsList( tree[ i ] ) then

current_result := SEARCH_FOR_INT_VARIABLE_APPEARANCE( tree[ i ] );

for j in current_result do

Add( appearance_list, [ Concatenation( [ i ], j[ 1 ] ), j[ 2 ] ] );

od;

fi;

od;

return appearance_list;

fi;

end );

##
InstallGlobalFunction( FIND_COMMAND_POSITIONS,

function( tree, variable_names )
local current_command, command_list, i, current_return, j, return_list;

command_list := [ ];

if IsList( tree ) and Length( tree ) = 2 and IsString( tree[ 1 ] ) and IsList( tree[ 2 ] ) and Position( variable_names, tree[ 1 ] ) = fail then

command_list := [ [ [ ], tree[ 1 ] ] ];

tree := tree[ 2 ];

fi;

if IsList( tree ) then

for i in [ 1 .. Length( tree ) ] do

current_return := FIND_COMMAND_POSITIONS( tree[ i ], variable_names );

for j in current_return do

Add( command_list, [ Concatenation( [ i ], j[ 1 ] ), j[ 2 ] ] );

od;

od;

fi;

return command_list;

end );

BindGlobal( "FIND_VARIABLE_TYPES",

function( var_list )
Expand Down
2 changes: 1 addition & 1 deletion GradedModulePresentationsForCAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "GradedModulePresentationsForCAP",
Subtitle := "Presentations for graded modules",
Version := "2023.03-01",
Version := "2023.08-01",
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ InstallMethod( GradedLeftPresentations,

ADD_GRADED_FUNCTIONS_FOR_LEFT_PRESENTATION( category );

AddCategoryToFamily( category, "ModuleCategory" );


## TODO: avoid code duplication (see RightPresentations)
# AddTheoremFileToCategory( category,
# Filename(
Expand Down Expand Up @@ -90,8 +87,6 @@ InstallMethod( GradedRightPresentations,

ADD_GRADED_FUNCTIONS_FOR_RIGHT_PRESENTATION( category );

AddCategoryToFamily( category, "ModuleCategory" );

# ## TODO: avoid code duplication (see LeftPresentations)
# AddTheoremFileToCategory( category,
# Filename(
Expand Down
2 changes: 1 addition & 1 deletion HomologicalAlgebraForCAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "HomologicalAlgebraForCAP",
Subtitle := "Homological algebra algorithms for CAP",
Version := "2023.03-01",
Version := "2023.08-01",
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
Loading

0 comments on commit 2da4544

Please sign in to comment.