Skip to content

Commit 10535fd

Browse files
start compilation
1 parent 4545f90 commit 10535fd

7 files changed

Lines changed: 178 additions & 22 deletions

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Dependencies := rec(
9999
GAP := ">= 4.13.0",
100100
NeededOtherPackages := [
101101
[ "GAPDoc", ">= 1.5" ],
102-
[ "CAP", ">= 2026.05-02" ],
102+
[ "CAP", ">= 2026.05-04" ],
103103
[ "GroupsAsCategoriesForCAP", ">= 2026.04-02" ],
104104
[ "FinSetsForCAP", ">= 2022.05-01" ],
105105
],

doc/Doc.autodoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
@Section Reconstruction Tools
2828
@Section Examples
2929

30+
@Chapter Precompilation
3031

3132
@Chapter Bibliography
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#! @Chapter Precompilation
2+
3+
#! @Section Precompiling the skeletal category of finite left G-sets
4+
5+
#! @Example
6+
7+
#! #@if ValueOption( "no_precompiled_code" ) <> true
8+
9+
LoadPackage( "FinGSetsForCAP", false );
10+
#! true
11+
LoadPackage( "CompilerForCAP", ">= 2026.05-01", false );
12+
#! true
13+
ReadPackageOnce( "FinSetsForCAP", "gap/CompilerLogic.gi" );
14+
#! true
15+
16+
category_constructor :=
17+
G -> SkeletalCategoryOfTransitiveLeftGSets(
18+
GROUP_AS_CATEGORY( G : FinalizeCategory := true ) );;
19+
C2 := CyclicGroup( 2 );; StructureDescription( C2 );; C2;
20+
#! C2
21+
given_arguments := [ C2 ];;
22+
compiled_category_name :=
23+
"SkeletalCategoryOfTransitiveLeftGSets_precompiled";;
24+
package_name := "FinGSetsForCAP";;
25+
#primitive_operations :=
26+
# ListPrimitivelyInstalledOperationsOfCategory(
27+
# category_constructor( given_arguments[1]
28+
# : no_precompiled_code := true ) );;
29+
list_of_operations :=
30+
#SortedList( Concatenation( primitive_operations,
31+
[ "SetOfObjectsOfCategory",
32+
"IsEqualForObjects",
33+
"IsWellDefinedForObjects",
34+
#"IsWellDefinedForMorphisms",
35+
];;
36+
#) );;
37+
38+
CapJitPrecompileCategoryAndCompareResult(
39+
category_constructor,
40+
given_arguments,
41+
package_name,
42+
compiled_category_name
43+
: operations := list_of_operations,
44+
number_of_objectified_objects_in_data_structure_of_object := 1,
45+
number_of_objectified_morphisms_in_data_structure_of_object := 0,
46+
number_of_objectified_objects_in_data_structure_of_morphism := 2,
47+
number_of_objectified_morphisms_in_data_structure_of_morphism := 1
48+
);;
49+
50+
SkeletalCategoryOfTransitiveLeftGSets_precompiled( C2 );
51+
#! SkeletalCategoryOfTransitiveLeftGSets( C2 ) with 2 objects
52+
53+
cat := SkeletalCategoryOfTransitiveLeftGSets( C2 );
54+
#! SkeletalCategoryOfTransitiveLeftGSets( C2 ) with 2 objects
55+
56+
cat!.precompiled_functions_added;
57+
#! true
58+
59+
#! #@fi
60+
61+
#! @EndExample

gap/SkeletalCategoryOfTransitiveLeftGSets.gd

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ DeclareAttribute( "SkeletalCategoryOfTransitiveLeftGSets",
6161
DeclareAttribute( "UnderlyingGroup",
6262
IsSkeletalCategoryOfTransitiveLeftGSets );
6363

64-
#CapJitAddTypeSignature( "UnderlyingGroup", [ IsSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
65-
#
66-
# return CapJitDataTypeOfGroup( UnderlyingGroup( input_types[1].category ) );
67-
#
68-
#end );
64+
CapJitAddTypeSignature( "UnderlyingGroup", [ IsSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
65+
66+
return CapJitDataTypeOfGroup( UnderlyingGroup( input_types[1].category ) );
67+
68+
end );
6969

7070
#! @Description
7171
#! The group $G$ underlying the skeletal category <A>C</A> of transitive left $G$-set, viewed as a category on one object.
@@ -103,11 +103,11 @@ CapJitAddTypeSignature( "NumberOfObjects", [ IsSkeletalCategoryOfTransitiveLeftG
103103
DeclareAttribute( "CardinalitiesOfObjects",
104104
IsSkeletalCategoryOfTransitiveLeftGSets );
105105

106-
#CapJitAddTypeSignature( "CardinalitiesOfObjects", [ IsSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
107-
#
108-
# return CapJitDataTypeOfListOf( IsBigInt );
109-
#
110-
#end );
106+
CapJitAddTypeSignature( "CardinalitiesOfObjects", [ IsSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
107+
108+
return CapJitDataTypeOfListOf( IsBigInt );
109+
110+
end );
111111

112112
#! @Description
113113
#! The list of subgroups up to conjugation of the underlying group.
@@ -116,6 +116,12 @@ DeclareAttribute( "CardinalitiesOfObjects",
116116
DeclareAttribute( "RepresentativesOfSubgroupsUpToConjugation",
117117
IsSkeletalCategoryOfTransitiveLeftGSets );
118118

119+
CapJitAddTypeSignature( "RepresentativesOfSubgroupsUpToConjugation", [ IsSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
120+
121+
return CapJitDataTypeOfListOf( CapJitDataTypeOfSubgroup( UnderlyingGroup( input_types[1].category ) ) );
122+
123+
end );
124+
119125
#! @Description
120126
#! The positive integer $i$ such that the transitive left $G$-set <A>Omega</A> $\cong U_i \backslash G$, i.e.,
121127
#! <C>ObjectNumber( TransitiveGSet( G, i ) ) = i</C>.
@@ -124,7 +130,13 @@ DeclareAttribute( "RepresentativesOfSubgroupsUpToConjugation",
124130
DeclareAttribute( "ObjectNumber",
125131
IsObjectInSkeletalCategoryOfTransitiveLeftGSets );
126132

127-
CapJitAddTypeSignature( "ObjectNumber", [ IsObjectInSkeletalCategoryOfTransitiveLeftGSets ], IsBigInt );
133+
CapJitAddTypeSignature( "ObjectNumber", [ IsObjectInSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
134+
135+
Assert( 0, IsSkeletalCategoryOfTransitiveLeftGSets( input_types[1].category ) );
136+
137+
return ObjectDatumType( input_types[1].category );
138+
139+
end );
128140

129141
#! @Description
130142
#! The group elements $g \in G$ defining the morphism <A>phi</A>: $\cong U_s \backslash G \to U_t \backslash G$
@@ -134,13 +146,13 @@ CapJitAddTypeSignature( "ObjectNumber", [ IsObjectInSkeletalCategoryOfTransitive
134146
DeclareAttribute( "UnderlyingGroupElement",
135147
IsMorphismInSkeletalCategoryOfTransitiveLeftGSets );
136148

137-
#CapJitAddTypeSignature( "UnderlyingGroupElement", [ IsMorphismInSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
138-
#
139-
# Assert( 0, IsSkeletalCategoryOfTransitiveLeftGSets( input_types[1].category ) );
140-
#
141-
# return CapJitDataTypeOfElementOfGroup( UnderlyingGroup( input_types[1].category ) );
142-
#
143-
#end );
149+
CapJitAddTypeSignature( "UnderlyingGroupElement", [ IsMorphismInSkeletalCategoryOfTransitiveLeftGSets ], function ( input_types )
150+
151+
Assert( 0, IsSkeletalCategoryOfTransitiveLeftGSets( input_types[1].category ) );
152+
153+
return MorphismDatumType( input_types[1].category );
154+
155+
end );
144156

145157
#! @Description
146158
#! The cardinality of the transitive left $G$-set <A>Omega</A>.

gap/SkeletalCategoryOfTransitiveLeftGSets.gi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ InstallMethod( SkeletalCategoryOfTransitiveLeftGSets,
4949
morphism_datum_type := CapJitDataTypeOfElementOfGroup( group );
5050

5151
SkeletalTransitiveGSets :=
52-
CreateCapCategoryWithDataTypes( name,
52+
CreateCapCategoryWithDataTypes(
5353
name,
5454
category_filter,
5555
category_object_filter,
@@ -465,6 +465,12 @@ InstallMethod( SkeletalCategoryOfTransitiveLeftGSets,
465465

466466
end );
467467

468+
if CAP_NAMED_ARGUMENTS.no_precompiled_code <> true then
469+
470+
ADD_FUNCTIONS_FOR_SkeletalCategoryOfTransitiveLeftGSets_precompiled( SkeletalTransitiveGSets );
471+
472+
fi;
473+
468474
if CAP_NAMED_ARGUMENTS.FinalizeCategory then
469475
Finalize( SkeletalTransitiveGSets );
470476
fi;
@@ -509,13 +515,13 @@ InstallMethod( \.,
509515
end );
510516

511517
##
512-
InstallMethod( SetOfObjects,
518+
InstallMethodForCompilerForCAP( SetOfObjects,
513519
"for the skeletal category of transitive left G-sets",
514520
[ IsSkeletalCategoryOfTransitiveLeftGSets ],
515521

516522
function ( SkeletalTransitiveGSets )
517523

518-
return SetOfObjectsOfCategory( SkeletalTransitiveGSets );
524+
return SetOfObjectsAsUnresolvableAttribute( SkeletalTransitiveGSets );
519525

520526
end );
521527

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
# FinGSetsForCAP: The (skeletal) elementary topos of finite G-sets
3+
#
4+
# Implementations
5+
#
6+
BindGlobal( "ADD_FUNCTIONS_FOR_SkeletalCategoryOfTransitiveLeftGSets_precompiled", function ( cat )
7+
8+
##
9+
AddSetOfObjectsOfCategory( cat,
10+
11+
########
12+
function ( cat_1 )
13+
return List( [ 1 .. NumberOfObjects( cat_1 ) ], function ( i_2 )
14+
return CreateCapCategoryObjectWithAttributes( cat_1, ObjectNumber, i_2 );
15+
end );
16+
end
17+
########
18+
19+
, 100 );
20+
21+
##
22+
AddIsEqualForObjects( cat,
23+
24+
########
25+
function ( cat_1, arg2_1, arg3_1 )
26+
return ObjectNumber( arg2_1 ) = ObjectNumber( arg3_1 );
27+
end
28+
########
29+
30+
, 100 );
31+
32+
##
33+
AddIsWellDefinedForObjects( cat,
34+
35+
########
36+
function ( cat_1, arg2_1 )
37+
return ObjectNumber( arg2_1 ) in [ 1 .. NumberOfObjects( cat_1 ) ];
38+
end
39+
########
40+
41+
, 100 );
42+
43+
if IsBound( cat!.precompiled_functions_added ) then
44+
45+
# COVERAGE_IGNORE_NEXT_LINE
46+
Error( "precompiled functions have already been added before" );
47+
48+
fi;
49+
50+
cat!.precompiled_functions_added := true;
51+
52+
end );
53+
54+
BindGlobal( "SkeletalCategoryOfTransitiveLeftGSets_precompiled", function ( G )
55+
local category_constructor, cat;
56+
57+
category_constructor :=
58+
59+
60+
function ( G )
61+
return SkeletalCategoryOfTransitiveLeftGSets( GROUP_AS_CATEGORY( G : FinalizeCategory := true ) );
62+
end;
63+
64+
65+
66+
cat := category_constructor( G : FinalizeCategory := false, no_precompiled_code := true );
67+
68+
ADD_FUNCTIONS_FOR_SkeletalCategoryOfTransitiveLeftGSets_precompiled( cat );
69+
70+
Finalize( cat );
71+
72+
return cat;
73+
74+
end );

read.g

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
ReadPackage( "FinGSetsForCAP", "gap/Tools.gi" );
88

9+
ReadPackage( "FinGSetsForCAP", "gap/precompiled_categories/SkeletalCategoryOfTransitiveLeftGSets_precompiled.gi" );
10+
911
ReadPackage( "FinGSetsForCAP", "gap/SkeletalCategoryOfTransitiveLeftGSets.gi" );
1012

1113
ReadPackage( "FinGSetsForCAP", "gap/SkeletalCategoryOfFiniteRightGSets.gi" );

0 commit comments

Comments
 (0)