Skip to content

Commit 0593a4e

Browse files
mohamed-barakatzickgraf
authored andcommitted
precompiled SkeletalFinSets :-)
Thanks Fabian
1 parent 701ae16 commit 0593a4e

File tree

7 files changed

+1009
-137
lines changed

7 files changed

+1009
-137
lines changed

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 := "FinSetsForCAP",
1212
Subtitle := "The elementary topos of (skeletal) finite sets",
13-
Version := "2021.11-16",
13+
Version := "2021.12-01",
1414

1515
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1616
License := "GPL-2.0-or-later",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#! @Chapter Precompilation
2+
3+
#! @Section Precompiling the category of skeletal finite sets
4+
5+
#! @Example
6+
LoadPackage( "FinSetsForCAP", false );
7+
#! true
8+
category_constructor := {} -> CategoryOfSkeletalFinSets( );;
9+
given_arguments := [ ];;
10+
compiled_category_name := "CategoryOfSkeletalFinSetsPrecompiled";;
11+
package_name := "FinSetsForCAP";;
12+
13+
CapJitPrecompileCategoryAndCompareResult(
14+
category_constructor,
15+
given_arguments,
16+
package_name,
17+
compiled_category_name
18+
:
19+
operations :=
20+
Difference(
21+
ListPrimitivelyInstalledOperationsOfCategory( SkeletalFinSets ),
22+
[ "CartesianBraidingInverseWithGivenDirectProducts",
23+
"ProjectionInFactorOfDirectProduct",
24+
"UniversalMorphismIntoDirectProduct",
25+
] )
26+
);;
27+
28+
CategoryOfSkeletalFinSetsPrecompiled( );
29+
#! SkeletalFinSets
30+
cat := CategoryOfSkeletalFinSets( );
31+
#! SkeletalFinSets
32+
#! @EndExample
33+
34+
#! Now we check whether the compiled code is loaded automatically.
35+
#! For this we use the name of the argument of `InitialObject`;
36+
#! for non-compiled code it is "cat", while for compiled code it is "cat_1":
37+
38+
#! @Example
39+
NamesLocalVariablesFunction(
40+
Last( cat!.added_functions.InitialObject )[1] )[1];
41+
#! "cat_1"
42+
#! @EndExample

examples/SkeletalCoastrictionToImage.g

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ phi := MapOfFinSets( n, [ 7, 5, 5 ], m );
1212
IsWellDefined( phi );
1313
#! true
1414
f := CoastrictionToImage( phi );
15-
#! <An epimorphism in SkeletalFinSets>
15+
#! <A morphism in SkeletalFinSets>
1616
Display( f );
1717
#! [ 3, [ 2, 1, 1 ], 2 ]
1818
IsWellDefined( f );
@@ -32,7 +32,7 @@ IsWellDefined( phi );
3232
iota := ImageEmbedding( phi );
3333
#! <A monomorphism in SkeletalFinSets>
3434
pi := CoastrictionToImage( phi );
35-
#! <An epimorphism in SkeletalFinSets>
35+
#! <A morphism in SkeletalFinSets>
3636
Display( pi );
3737
#! [ 4, [ 3, 1, 2, 1 ], 3 ]
3838
IsWellDefined( pi );

gap/SkeletalFinSetsForCAP.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
# Technical functions
88
DeclareGlobalFunction( "INSTALL_FUNCTIONS_FOR_SKELETAL_FIN_SETS" );
99

10+
DeclareGlobalFunction( "SKELETAL_FIN_SETS_Coequalizer" );
11+
12+
DeclareGlobalFunction( "SKELETAL_FIN_SETS_IsMonomorphism" );
13+
14+
DeclareGlobalFunction( "SKELETAL_FIN_SETS_IsEpimorphism" );
15+
1016
#! @Chapter The category of skeletal finite sets
1117

1218
#! @Section Skeletal GAP Categories

0 commit comments

Comments
 (0)