Skip to content

Commit

Permalink
Replace io_types by input_arguments_names etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
zickgraf committed Jul 31, 2023
1 parent f526784 commit 04b757c
Show file tree
Hide file tree
Showing 22 changed files with 1,627 additions and 521 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.07-08",
Version := "2023.07-09",
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
28 changes: 14 additions & 14 deletions CAP/gap/LimitConvenience.gi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

InstallGlobalFunction( "CAP_INTERNAL_GENERATE_CONVENIENCE_METHODS_FOR_LIMITS",
function ( package_name, method_name_record, limits )
local output_string, generate_universal_morphism_convenience, generate_functorial_convenience_method, number_of_diagram_arguments, functorial_record, filter_list, input_type, replaced_filter_list, arguments_string, source_diagram_arguments_string, range_diagram_arguments_string, source_diagram_input_type, range_diagram_input_type, limit, output_path;
local output_string, generate_universal_morphism_convenience, generate_functorial_convenience_method, number_of_diagram_arguments, limit, output_path;

output_string :=
"""# SPDX-License-Identifier: GPL-2.0-or-later
Expand Down Expand Up @@ -165,7 +165,7 @@ end );
with_given_universal_morphism := Concatenation( universal_morphism_name, "WithGiven", object_name ),
diagram_filter_list := List( CAP_INTERNAL_REPLACED_STRINGS_WITH_FILTERS( limit.diagram_filter_list ), NameFunction ),
tau_filter := tau_filter,
diagram_arguments := limit.diagram_input_type,
diagram_arguments := limit.diagram_arguments_names,
test_object_position := test_object_position,
selected_tau := Concatenation( "tau", list_selector ),
)
Expand All @@ -178,7 +178,7 @@ end );
end;

generate_functorial_convenience_method := function( limit, limit_colimit, object_name, functorial_name, functorial_with_given_name )
local functorial_with_given_record, filter_list, input_type, arguments_string, source_diagram_arguments_string, range_diagram_arguments_string, replaced_filter_list, current_string, input_arguments_names, source_argument_name, range_argument_name, source_diagram_arguments_names, range_diagram_arguments_names, equalizer_preprocessing, test_string, additional_preconditions, test_arguments, universal_morphism_with_given_name, call_arguments;
local functorial_with_given_record, filter_list, arguments_names, arguments_string, source_diagram_arguments_string, range_diagram_arguments_string, replaced_filter_list, current_string, input_arguments_names, source_argument_name, range_argument_name, source_diagram_arguments_names, range_diagram_arguments_names, equalizer_preprocessing, test_string, additional_preconditions, test_arguments, universal_morphism_with_given_name, call_arguments;

Assert( 0, limit_colimit in [ "limit", "colimit" ] );

Expand All @@ -188,12 +188,12 @@ end );

# convenience: derive diagrams from arguments
filter_list := limit.diagram_morphism_filter_list;
input_type := limit.diagram_morphism_input_type;
arguments_names := limit.diagram_morphism_arguments_names;

Assert( 0, Length( filter_list ) = 1 );
Assert( 0, Length( input_type ) = 1 );
Assert( 0, Length( arguments_names ) = 1 );

arguments_string := JoinStringsWithSeparator( input_type, ", " );
arguments_string := JoinStringsWithSeparator( arguments_names, ", " );

if limit.number_of_targets = 1 then
source_diagram_arguments_string := Concatenation( "Source( ", arguments_string, " )" );
Expand All @@ -219,7 +219,7 @@ end );
rec(
functorial_name := functorial_name,
filter_list := replaced_filter_list,
input_arguments := input_type,
input_arguments := arguments_names,
source_diagram_arguments := source_diagram_arguments_string,
range_diagram_arguments := range_diagram_arguments_string,
)
Expand All @@ -242,7 +242,7 @@ end );
rec(
functorial_name := functorial_name,
filter_list := replaced_filter_list,
input_arguments := input_type,
input_arguments := arguments_names,
source_diagram_arguments := source_diagram_arguments_string,
range_diagram_arguments := range_diagram_arguments_string,
)
Expand All @@ -264,7 +264,7 @@ end );
rec(
functorial_with_given_name := functorial_with_given_name,
filter_list := replaced_filter_list,
input_arguments := input_type,
input_arguments := arguments_names,
source_diagram_arguments := source_diagram_arguments_string,
range_diagram_arguments := range_diagram_arguments_string,
)
Expand All @@ -287,7 +287,7 @@ end );
rec(
functorial_with_given_name := functorial_with_given_name,
filter_list := replaced_filter_list,
input_arguments := input_type,
input_arguments := arguments_names,
source_diagram_arguments := source_diagram_arguments_string,
range_diagram_arguments := range_diagram_arguments_string,
)
Expand All @@ -299,7 +299,7 @@ end );

# derive functorials from the universality of the limit/colimit
Assert( 0, Length( limit.diagram_morphism_filter_list ) <= 1 );
Assert( 0, Length( limit.diagram_morphism_input_type ) <= 1 );
Assert( 0, Length( limit.diagram_morphism_arguments_names ) <= 1 );

input_arguments_names := functorial_with_given_record.input_arguments_names;

Expand All @@ -317,7 +317,7 @@ end );

if limit.number_of_targets = 1 then

Assert( 0, limit.diagram_morphism_input_type = [ "mu" ] );
Assert( 0, limit.diagram_morphism_arguments_names = [ "mu" ] );

if limit_colimit = "limit" then

Expand Down Expand Up @@ -366,7 +366,7 @@ end );

else

Assert( 0, limit.diagram_morphism_input_type = [ "L" ] );
Assert( 0, limit.diagram_morphism_arguments_names = [ "L" ] );

if limit_colimit = "limit" then

Expand Down Expand Up @@ -406,7 +406,7 @@ end );

else

Assert( 0, limit.diagram_morphism_input_type = [ ] );
Assert( 0, limit.diagram_morphism_arguments_names = [ ] );

test_arguments := [ ];

Expand Down
Loading

0 comments on commit 04b757c

Please sign in to comment.