Skip to content

Commit cc42169

Browse files
authored
Merge pull request #1247 from mohamed-barakat/AttributeCategoryForCAP
fix and complete commit 3956135
2 parents c59ac17 + 0ad3bf7 commit cc42169

File tree

4 files changed

+61
-6
lines changed

4 files changed

+61
-6
lines changed

AttributeCategoryForCAP/PackageInfo.g

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "AttributeCategoryForCAP",
1212
Subtitle := "Automatic enhancement with attributes of a CAP category",
13-
Version := "2023.02-01",
13+
Version := "2023.02-03",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

@@ -81,7 +81,7 @@ PackageDoc := rec(
8181
Dependencies := rec(
8282
GAP := ">= 4.12.1",
8383
NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ],
84-
[ "CAP", ">= 2021.07-02" ],
84+
[ "CAP", ">= 2023.02-04" ],
8585
[ "MonoidalCategories", ">= 2019.01.16" ],
8686
],
8787
SuggestedOtherPackages := [ ],

AttributeCategoryForCAP/gap/AttributeCategory.gi

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ InstallGlobalFunction( CAP_INTERNAL_INSTALL_ADDS_FOR_CATEGORY_WITH_ATTRIBUTES,
127127
create_function_morphism_no_new_object, create_function_morphism_new_source,
128128
create_function_morphism_new_range, attributes, recnames, name, func, pos, function_to_add, add_function,
129129
create_function_object_no_arguments, create_function_morphism_or_fail, with_given_object_name, entry,
130-
no_install_list, installed_operations_of_underlying_category;
130+
no_install_list, functorial, installed_operations_of_underlying_category;
131131

132132
category_with_attributes := structure_record.category_with_attributes;
133133

@@ -341,6 +341,43 @@ InstallGlobalFunction( CAP_INTERNAL_INSTALL_ADDS_FOR_CATEGORY_WITH_ATTRIBUTES,
341341

342342
fi;
343343

344+
## add *WithGiven* to no_install_list if object-part-operation is not supported by AttributeCategory
345+
for name in RecNames( CAP_INTERNAL_METHOD_NAME_RECORD ) do
346+
347+
if CAP_INTERNAL_METHOD_NAME_RECORD.(name).return_type = "object" and IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(name).functorial ) then
348+
349+
functorial := CAP_INTERNAL_METHOD_NAME_RECORD.(name).functorial;
350+
351+
if IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(functorial).with_given_without_given_name_pair ) then
352+
353+
functorial := CAP_INTERNAL_METHOD_NAME_RECORD.(functorial).with_given_without_given_name_pair;
354+
355+
if IsList( functorial ) and Length( functorial ) = 2 then
356+
357+
if not IsBound( structure_record.(name) ) and functorial[2] in recnames then
358+
359+
Add( no_install_list, functorial[2] );
360+
361+
fi;
362+
363+
fi;
364+
365+
fi;
366+
367+
elif CAP_INTERNAL_METHOD_NAME_RECORD.(name).return_type = "morphism" and IsBound( CAP_INTERNAL_METHOD_NAME_RECORD.(name).with_given_object_name ) then
368+
369+
with_given_object_name := CAP_INTERNAL_METHOD_NAME_RECORD.(name).with_given_object_name;
370+
371+
if not IsBound( structure_record.(with_given_object_name) ) and name in recnames then
372+
373+
Add( no_install_list, name );
374+
375+
fi;
376+
377+
fi;
378+
379+
od;
380+
344381
for func in no_install_list do
345382

346383
pos := Position( recnames, func );
@@ -488,7 +525,7 @@ InstallGlobalFunction( CAP_INTERNAL_DERIVE_STRUCTURE_FUNCTIONS_OF_UNIVERSAL_OBJE
488525
end );
489526

490527
derivation_record.FiberProduct := rec(
491-
uses := [ "FiberProductEmbeddingInDirectSum", "DirectSum" ],
528+
uses := Concatenation( List( CAP_INTERNAL_METHOD_RECORD_REPLACEMENTS.FiberProductEmbeddingInDirectSum, a -> a[1] ), [ "DirectSum" ] ),
492529
derivation := function( diagram, fiber_product )
493530
local underlying_diagram, direct_sum_diagram;
494531

@@ -532,7 +569,7 @@ InstallGlobalFunction( CAP_INTERNAL_DERIVE_STRUCTURE_FUNCTIONS_OF_UNIVERSAL_OBJE
532569
end );
533570

534571
derivation_record.Pushout := rec(
535-
uses := [ "PushoutProjectionFromDirectSum", "DirectSum" ],
572+
uses := Concatenation( List( CAP_INTERNAL_METHOD_RECORD_REPLACEMENTS.PushoutProjectionFromDirectSum, a -> a[1] ), [ "DirectSum" ] ),
536573
derivation := function( diagram, pushout )
537574
local underlying_diagram, direct_sum_diagram;
538575

CAP/PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "CAP",
1212
Subtitle := "Categories, Algorithms, Programming",
13-
Version := "2023.02-03",
13+
Version := "2023.02-04",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

CAP/gap/UniversalObjects.gi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,15 @@ InstallOtherMethod( FiberProductEmbeddingInDirectSum,
553553

554554
end );
555555

556+
CAP_INTERNAL_ADD_REPLACEMENTS_FOR_METHOD_RECORD(
557+
rec(
558+
FiberProductEmbeddingInDirectSum :=
559+
[ [ "ProjectionInFactorOfFiberProduct", 2 ],
560+
[ "UniversalMorphismIntoDirectSum", 1 ],
561+
[ "FiberProduct", 1 ] ],
562+
)
563+
);
564+
556565
####################################
557566
##
558567
## Coequalizer
@@ -882,6 +891,15 @@ InstallOtherMethod( PushoutProjectionFromDirectSum,
882891

883892
end );
884893

894+
CAP_INTERNAL_ADD_REPLACEMENTS_FOR_METHOD_RECORD(
895+
rec(
896+
PushoutProjectionFromDirectSum :=
897+
[ [ "InjectionOfCofactorOfPushout", 2 ],
898+
[ "UniversalMorphismFromDirectSum", 1 ],
899+
[ "Pushout", 1 ] ],
900+
)
901+
);
902+
885903
####################################
886904
##
887905
## Coimage

0 commit comments

Comments
 (0)