Skip to content

Commit 80ad939

Browse files
Merge pull request #703 from zickgraf/MonoidalCategories
Turn WithoutGiven monoidal operations into proper CAP operations
2 parents a91c7e1 + ec87fc8 commit 80ad939

39 files changed

+3058
-2593
lines changed

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 := "2021.08-02",
13+
Version := "2021.08-03",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

CAP/gap/MethodRecord.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ DeclareGlobalFunction( "CAP_INTERNAL_ADD_REPLACEMENTS_FOR_METHOD_RECORD" );
2626
DeclareGlobalFunction( "CAP_INTERNAL_ENHANCE_NAME_RECORD" );
2727

2828
DeclareGlobalFunction( "CAP_INTERNAL_REVERSE_LISTS_IN_ARGUMENTS_FOR_OPPOSITE" );
29+
30+
DeclareGlobalFunction( "CAP_INTERNAL_GENERATE_DOCUMENTATION_FROM_METHOD_NAME_RECORD" );

CAP/gap/MethodRecord.gi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4884,3 +4884,97 @@ InstallGlobalFunction( CAP_INTERNAL_REVERSE_LISTS_IN_ARGUMENTS_FOR_OPPOSITE,
48844884
end );
48854885

48864886
end );
4887+
4888+
##
4889+
InstallGlobalFunction( CAP_INTERNAL_GENERATE_DOCUMENTATION_FROM_METHOD_NAME_RECORD,
4890+
function ( record, package_name, filename, chapter_name, section_name )
4891+
local recnames, output_string, package_info, current_string, current_recname, current_rec, output_path;
4892+
4893+
recnames := SortedList( RecNames( record ) );
4894+
4895+
output_string := "";
4896+
4897+
package_info := First( PackageInfo( package_name ) );
4898+
4899+
if package_info = fail then
4900+
4901+
Error( "could not find package info" );
4902+
4903+
fi;
4904+
4905+
current_string := ReplacedStringViaRecord(
4906+
"""# SPDX-License-Identifier: GPL-2.0-or-later
4907+
# package_name: package_subtitle
4908+
#
4909+
# Declarations
4910+
#
4911+
# THIS FILE IS AUTOMATICALLY GENERATED, SEE CAP_project/CAP/gap/MethodRecord.gi
4912+
4913+
#! @Chapter chapter_name
4914+
4915+
#! @Section section_name
4916+
""",
4917+
rec(
4918+
package_name := package_name,
4919+
package_subtitle := package_info.Subtitle,
4920+
chapter_name := chapter_name,
4921+
section_name := section_name,
4922+
)
4923+
);
4924+
output_string := Concatenation( output_string, current_string );
4925+
4926+
for current_recname in recnames do
4927+
4928+
current_rec := record.(current_recname);
4929+
4930+
if current_rec.filter_list[1] <> "category" then
4931+
4932+
Error( "The first filter is not the category. This is not supported." );
4933+
4934+
fi;
4935+
4936+
current_string := ReplacedStringViaRecord(
4937+
"""
4938+
#! @Description
4939+
#! The arguments are a category $C$ and a function $F$.
4940+
#! This operation adds the given function $F$
4941+
#! to the category for the basic operation `function_name`.
4942+
#! $F: ( input_arguments ) \mapsto \mathtt{function_name}(input_arguments)$.
4943+
#! @Returns nothing
4944+
#! @Arguments C, F
4945+
DeclareOperation( "Addfunction_name",
4946+
[ IsCapCategory, IsFunction ] );
4947+
4948+
DeclareOperation( "Addfunction_name",
4949+
[ IsCapCategory, IsFunction, IsInt ] );
4950+
4951+
DeclareOperation( "Addfunction_name",
4952+
[ IsCapCategory, IsList, IsInt ] );
4953+
4954+
DeclareOperation( "Addfunction_name",
4955+
[ IsCapCategory, IsList ] );
4956+
""",
4957+
rec(
4958+
function_name := current_recname,
4959+
input_arguments := current_rec.input_arguments_names{[ 2 .. Length( current_rec.input_arguments_names ) ]},
4960+
)
4961+
);
4962+
output_string := Concatenation( output_string, current_string );
4963+
4964+
od;
4965+
4966+
if not IsExistingFileInPackageForHomalg( package_name, filename ) or output_string <> ReadFileFromPackageForHomalg( package_name, filename ) then
4967+
4968+
output_path := Filename( DirectoryTemporary( ), filename );
4969+
4970+
WriteFileForHomalg( output_path, output_string );
4971+
4972+
Display( Concatenation(
4973+
"WARNING: The file ", filename, " in package ", package_name, " differs from the automatically generated one. ",
4974+
"You can view the automatically generated file at the following path: ",
4975+
output_path
4976+
) );
4977+
4978+
fi;
4979+
4980+
end );

GradedModulePresentationsForCAP/examples/CohP1.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ S := GradedRing( Q["x,y"] );
1515
Sgrmod := GradedLeftPresentations( S );
1616
#! The category of graded left f.p. modules over Q[x,y] (with weights [ 1, 1 ])
1717
InfoOfInstalledOperationsOfCategory( Sgrmod );
18-
#! 40 primitive operations were used to derive 172 operations for this category which
18+
#! 40 primitive operations were used to derive 185 operations for this category which
1919
#! * IsAbCategory
2020
#! * IsMonoidalCategory
2121
#! * IsAbelianCategoryWithEnoughProjectives

MonoidalCategories/PackageInfo.g

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

1111
PackageName := "MonoidalCategories",
1212
Subtitle := "Monoidal and monoidal (co)closed categories",
13-
Version := Maximum( [
14-
"2021.02-01", ## Mohamed's version
15-
## this line prevents merge conflicts
16-
"2019.06-07", ## Sebas' version
17-
## this line prevents merge conflicts
18-
"2020.04-16", ## Sepp's version
19-
## this line prevents merge conflicts
20-
"2021.06-01", ## Fabian's version
21-
## this line prevents merge conflicts
22-
"2019.03-14", ## Tom's version
23-
] ),
13+
Version := "2021.08-01",
2414

2515
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
2616
License := "GPL-2.0-or-later",
@@ -130,7 +120,7 @@ Dependencies := rec(
130120
NeededOtherPackages := [
131121
[ "GAPDoc", ">= 1.5" ],
132122
[ "ToolsForHomalg", ">= 2018.05.22" ],
133-
[ "CAP", ">= 2021.06-02" ],
123+
[ "CAP", ">= 2021.08-03" ],
134124
],
135125
SuggestedOtherPackages := [ ],
136126
ExternalConditions := [ ],
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
# MonoidalCategories: Monoidal and monoidal (co)closed categories
3+
#
4+
# Declarations
5+
#
6+
# THIS FILE IS AUTOMATICALLY GENERATED, SEE CAP_project/CAP/gap/MethodRecord.gi
7+
8+
#! @Chapter Monoidal Categories
9+
10+
#! @Section Additive Monoidal Categories
11+
12+
#! @Description
13+
#! The arguments are a category $C$ and a function $F$.
14+
#! This operation adds the given function $F$
15+
#! to the category for the basic operation `LeftDistributivityExpanding`.
16+
#! $F: ( a, L ) \mapsto \mathtt{LeftDistributivityExpanding}(a, L)$.
17+
#! @Returns nothing
18+
#! @Arguments C, F
19+
DeclareOperation( "AddLeftDistributivityExpanding",
20+
[ IsCapCategory, IsFunction ] );
21+
22+
DeclareOperation( "AddLeftDistributivityExpanding",
23+
[ IsCapCategory, IsFunction, IsInt ] );
24+
25+
DeclareOperation( "AddLeftDistributivityExpanding",
26+
[ IsCapCategory, IsList, IsInt ] );
27+
28+
DeclareOperation( "AddLeftDistributivityExpanding",
29+
[ IsCapCategory, IsList ] );
30+
31+
#! @Description
32+
#! The arguments are a category $C$ and a function $F$.
33+
#! This operation adds the given function $F$
34+
#! to the category for the basic operation `LeftDistributivityExpandingWithGivenObjects`.
35+
#! $F: ( s, a, L, r ) \mapsto \mathtt{LeftDistributivityExpandingWithGivenObjects}(s, a, L, r)$.
36+
#! @Returns nothing
37+
#! @Arguments C, F
38+
DeclareOperation( "AddLeftDistributivityExpandingWithGivenObjects",
39+
[ IsCapCategory, IsFunction ] );
40+
41+
DeclareOperation( "AddLeftDistributivityExpandingWithGivenObjects",
42+
[ IsCapCategory, IsFunction, IsInt ] );
43+
44+
DeclareOperation( "AddLeftDistributivityExpandingWithGivenObjects",
45+
[ IsCapCategory, IsList, IsInt ] );
46+
47+
DeclareOperation( "AddLeftDistributivityExpandingWithGivenObjects",
48+
[ IsCapCategory, IsList ] );
49+
50+
#! @Description
51+
#! The arguments are a category $C$ and a function $F$.
52+
#! This operation adds the given function $F$
53+
#! to the category for the basic operation `LeftDistributivityFactoring`.
54+
#! $F: ( a, L ) \mapsto \mathtt{LeftDistributivityFactoring}(a, L)$.
55+
#! @Returns nothing
56+
#! @Arguments C, F
57+
DeclareOperation( "AddLeftDistributivityFactoring",
58+
[ IsCapCategory, IsFunction ] );
59+
60+
DeclareOperation( "AddLeftDistributivityFactoring",
61+
[ IsCapCategory, IsFunction, IsInt ] );
62+
63+
DeclareOperation( "AddLeftDistributivityFactoring",
64+
[ IsCapCategory, IsList, IsInt ] );
65+
66+
DeclareOperation( "AddLeftDistributivityFactoring",
67+
[ IsCapCategory, IsList ] );
68+
69+
#! @Description
70+
#! The arguments are a category $C$ and a function $F$.
71+
#! This operation adds the given function $F$
72+
#! to the category for the basic operation `LeftDistributivityFactoringWithGivenObjects`.
73+
#! $F: ( s, a, L, r ) \mapsto \mathtt{LeftDistributivityFactoringWithGivenObjects}(s, a, L, r)$.
74+
#! @Returns nothing
75+
#! @Arguments C, F
76+
DeclareOperation( "AddLeftDistributivityFactoringWithGivenObjects",
77+
[ IsCapCategory, IsFunction ] );
78+
79+
DeclareOperation( "AddLeftDistributivityFactoringWithGivenObjects",
80+
[ IsCapCategory, IsFunction, IsInt ] );
81+
82+
DeclareOperation( "AddLeftDistributivityFactoringWithGivenObjects",
83+
[ IsCapCategory, IsList, IsInt ] );
84+
85+
DeclareOperation( "AddLeftDistributivityFactoringWithGivenObjects",
86+
[ IsCapCategory, IsList ] );
87+
88+
#! @Description
89+
#! The arguments are a category $C$ and a function $F$.
90+
#! This operation adds the given function $F$
91+
#! to the category for the basic operation `RightDistributivityExpanding`.
92+
#! $F: ( L, a ) \mapsto \mathtt{RightDistributivityExpanding}(L, a)$.
93+
#! @Returns nothing
94+
#! @Arguments C, F
95+
DeclareOperation( "AddRightDistributivityExpanding",
96+
[ IsCapCategory, IsFunction ] );
97+
98+
DeclareOperation( "AddRightDistributivityExpanding",
99+
[ IsCapCategory, IsFunction, IsInt ] );
100+
101+
DeclareOperation( "AddRightDistributivityExpanding",
102+
[ IsCapCategory, IsList, IsInt ] );
103+
104+
DeclareOperation( "AddRightDistributivityExpanding",
105+
[ IsCapCategory, IsList ] );
106+
107+
#! @Description
108+
#! The arguments are a category $C$ and a function $F$.
109+
#! This operation adds the given function $F$
110+
#! to the category for the basic operation `RightDistributivityExpandingWithGivenObjects`.
111+
#! $F: ( s, L, a, r ) \mapsto \mathtt{RightDistributivityExpandingWithGivenObjects}(s, L, a, r)$.
112+
#! @Returns nothing
113+
#! @Arguments C, F
114+
DeclareOperation( "AddRightDistributivityExpandingWithGivenObjects",
115+
[ IsCapCategory, IsFunction ] );
116+
117+
DeclareOperation( "AddRightDistributivityExpandingWithGivenObjects",
118+
[ IsCapCategory, IsFunction, IsInt ] );
119+
120+
DeclareOperation( "AddRightDistributivityExpandingWithGivenObjects",
121+
[ IsCapCategory, IsList, IsInt ] );
122+
123+
DeclareOperation( "AddRightDistributivityExpandingWithGivenObjects",
124+
[ IsCapCategory, IsList ] );
125+
126+
#! @Description
127+
#! The arguments are a category $C$ and a function $F$.
128+
#! This operation adds the given function $F$
129+
#! to the category for the basic operation `RightDistributivityFactoring`.
130+
#! $F: ( L, a ) \mapsto \mathtt{RightDistributivityFactoring}(L, a)$.
131+
#! @Returns nothing
132+
#! @Arguments C, F
133+
DeclareOperation( "AddRightDistributivityFactoring",
134+
[ IsCapCategory, IsFunction ] );
135+
136+
DeclareOperation( "AddRightDistributivityFactoring",
137+
[ IsCapCategory, IsFunction, IsInt ] );
138+
139+
DeclareOperation( "AddRightDistributivityFactoring",
140+
[ IsCapCategory, IsList, IsInt ] );
141+
142+
DeclareOperation( "AddRightDistributivityFactoring",
143+
[ IsCapCategory, IsList ] );
144+
145+
#! @Description
146+
#! The arguments are a category $C$ and a function $F$.
147+
#! This operation adds the given function $F$
148+
#! to the category for the basic operation `RightDistributivityFactoringWithGivenObjects`.
149+
#! $F: ( s, L, a, r ) \mapsto \mathtt{RightDistributivityFactoringWithGivenObjects}(s, L, a, r)$.
150+
#! @Returns nothing
151+
#! @Arguments C, F
152+
DeclareOperation( "AddRightDistributivityFactoringWithGivenObjects",
153+
[ IsCapCategory, IsFunction ] );
154+
155+
DeclareOperation( "AddRightDistributivityFactoringWithGivenObjects",
156+
[ IsCapCategory, IsFunction, IsInt ] );
157+
158+
DeclareOperation( "AddRightDistributivityFactoringWithGivenObjects",
159+
[ IsCapCategory, IsList, IsInt ] );
160+
161+
DeclareOperation( "AddRightDistributivityFactoringWithGivenObjects",
162+
[ IsCapCategory, IsList ] );

0 commit comments

Comments
 (0)