Skip to content

Commit

Permalink
renamed IsSkeletalFiniteSet(Map) -> IsObject/MorphismInCategoryOfSkel…
Browse files Browse the repository at this point in the history
…etalFinSets
  • Loading branch information
mohamed-barakat committed Jun 9, 2023
1 parent 50dca70 commit 7404f42
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 36 deletions.
4 changes: 2 additions & 2 deletions gap/CompilerLogic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ end );
## Teach CompilerForCAP about the input type of the function so it can correctly type the function,
## that can be done with the following code (adapted from the existing List type signature):
##
CapJitAddTypeSignature( "List", [ IsSkeletalFiniteSet, IsFunction ], function ( args, func_stack )
CapJitAddTypeSignature( "List", [ IsObjectInCategoryOfSkeletalFinSets, IsFunction ], function ( args, func_stack )

args := ShallowCopy( args );

Expand All @@ -109,7 +109,7 @@ end );
CapJitAddLogicTemplate(
rec(
variable_names := [ "M", "func" ],
variable_filters := [ IsSkeletalFiniteSet, IsObject ],
variable_filters := [ IsObjectInCategoryOfSkeletalFinSets, IsObject ],
src_template := "List( M, func )",
dst_template := "List( [ 0 .. Length( M ) - 1 ], func )",
)
Expand Down
2 changes: 1 addition & 1 deletion gap/Julia.gi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end );

##
InstallMethod( MapOfFinSets,
[ IsSkeletalFiniteSet, IsJuliaObject, IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets, IsJuliaObject, IsObjectInCategoryOfSkeletalFinSets ],

function ( source, graph, range )

Expand Down
32 changes: 16 additions & 16 deletions gap/SkeletalFinSets.gd
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ DeclareCategory( "IsCategoryOfSkeletalFinSets",
#! The GAP category of objects in the category
#! of skeletal finite sets.
#! @Arguments object
DeclareCategory( "IsSkeletalFiniteSet",
DeclareCategory( "IsObjectInCategoryOfSkeletalFinSets",
IsCapCategoryObject );

#! @Description
#! The GAP category of morphisms in the category
#! of skeletal finite sets.
#! @Arguments object
DeclareCategory( "IsSkeletalFiniteSetMap",
DeclareCategory( "IsMorphismInCategoryOfSkeletalFinSets",
IsCapCategoryMorphism );

#! @Section Attributes
Expand All @@ -37,28 +37,28 @@ DeclareCategory( "IsSkeletalFiniteSetMap",
#! @Arguments M
#! @Returns an integer
DeclareAttribute( "Length",
IsSkeletalFiniteSet );
IsObjectInCategoryOfSkeletalFinSets );

CapJitAddTypeSignature( "Length", [ IsSkeletalFiniteSet ], IsBigInt );
CapJitAddTypeSignature( "Length", [ IsObjectInCategoryOfSkeletalFinSets ], IsBigInt );

#! @Description
#! The list associated to a skeletal finite set, i.e.,
#! <C>AsList( FinSet( n ) ) = [ 0 .. n - 1 ]</C>.
#! @Arguments M
#! @Returns a list
DeclareAttribute( "AsList",
IsSkeletalFiniteSet );
IsObjectInCategoryOfSkeletalFinSets );

CapJitAddTypeSignature( "AsList", [ IsSkeletalFiniteSet ], rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) );
CapJitAddTypeSignature( "AsList", [ IsObjectInCategoryOfSkeletalFinSets ], rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) );

#! @Description
#! The graph defining the skeletal finite set morphism <A>phi</A>, see <Ref Oper="MapOfFinSets" Label="for IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet" />.
#! The graph defining the skeletal finite set morphism <A>phi</A>, see <Ref Oper="MapOfFinSets" Label="for IsObjectInCategoryOfSkeletalFinSets, IsList, IsObjectInCategoryOfSkeletalFinSets" />.
#! @Arguments phi
#! @Returns a list
DeclareAttribute( "AsList",
IsSkeletalFiniteSetMap );
IsMorphismInCategoryOfSkeletalFinSets );

CapJitAddTypeSignature( "AsList", [ IsSkeletalFiniteSetMap ], rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) );
CapJitAddTypeSignature( "AsList", [ IsMorphismInCategoryOfSkeletalFinSets ], rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) );

#! @Section Constructors

Expand Down Expand Up @@ -97,7 +97,7 @@ KeyDependentOperation( "FinSet", IsCategoryOfSkeletalFinSets, IsBigInt, ReturnTr
#! @Arguments s, G, t
#! @Returns a &CAP; morphism
DeclareOperation( "MapOfFinSets",
[ IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet ] );
[ IsObjectInCategoryOfSkeletalFinSets, IsList, IsObjectInCategoryOfSkeletalFinSets ] );
#! @InsertChunk SkeletalMapOfFinSets

#! @Section Tools
Expand All @@ -107,42 +107,42 @@ DeclareOperation( "MapOfFinSets",
#! @Arguments s, f
#! @Returns a list
DeclareOperation( "ListOp",
[ IsSkeletalFiniteSet, IsFunction ] );
[ IsObjectInCategoryOfSkeletalFinSets, IsFunction ] );

#! @Description
#! Construct the embedding $\iota:$<A>s</A>$\to$<A>t</A> of the finite sets <A>s</A> and <A>t</A>,
#! where <A>s</A> must be subset of <A>t</A>.
#! @Arguments s, t
#! @Returns a &CAP; morphism
DeclareOperation( "EmbeddingOfFinSets",
[ IsSkeletalFiniteSet, IsSkeletalFiniteSet ] );
[ IsObjectInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ] );

#! @Description
#! Compute the Preimage of <A>t</A> under the morphism <A>phi</A>.
#! @Arguments phi, t
#! @Returns a &CAP; object
DeclareOperation( "Preimage",
[ IsSkeletalFiniteSetMap, IsList ] );
[ IsMorphismInCategoryOfSkeletalFinSets, IsList ] );

#! @Description
#! Compute the image of <A>s_</A> under the morphism <A>phi</A>.
#! @Arguments phi, s_
#! @Returns a &CAP; object
DeclareOperation( "ImageObject",
[ IsSkeletalFiniteSetMap, IsSkeletalFiniteSet ] );
[ IsMorphismInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ] );

#! @Description
#! Returns the image of <C><A>L</A>[1]</C> under the map <A>phi</A> assuming <C><A>L</A>[1]</C> is a nonnegative integer smaller than <C>Length( Source( <A>phi</A> ) )</C>.
#! @Arguments phi, L
#! @Returns a list
# DeclareOperation( "CallFuncList",
# [ IsSkeletalFiniteSetMap, IsList ] );
# [ IsMorphismInCategoryOfSkeletalFinSets, IsList ] );

# Technical functions
DeclareGlobalFunction( "INSTALL_FUNCTIONS_FOR_SKELETAL_FIN_SETS" );

DeclareGlobalFunction( "SKELETAL_FIN_SETS_ExplicitCoequalizer" );
CapJitAddTypeSignature( "SKELETAL_FIN_SETS_ExplicitCoequalizer", [ IsSkeletalFiniteSet, IsList ], rec( filter := IsList, element_type := rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) ) );
CapJitAddTypeSignature( "SKELETAL_FIN_SETS_ExplicitCoequalizer", [ IsObjectInCategoryOfSkeletalFinSets, IsList ], rec( filter := IsList, element_type := rec( filter := IsList, element_type := rec( filter := IsBigInt ) ) ) );

DeclareGlobalFunction( "SKELETAL_FIN_SETS_IsMonomorphism" );
CapJitAddTypeSignature( "SKELETAL_FIN_SETS_IsMonomorphism", [ IsList, IsBigInt ], IsBool );
Expand Down
37 changes: 20 additions & 17 deletions gap/SkeletalFinSets.gi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ InstallMethod( CategoryOfSkeletalFinSets,

cat := CreateCapCategoryWithDataTypes(
"SkeletalFinSets", IsCategoryOfSkeletalFinSets,
IsSkeletalFiniteSet, IsSkeletalFiniteSetMap, IsCapCategoryTwoCell,
IsObjectInCategoryOfSkeletalFinSets, IsMorphismInCategoryOfSkeletalFinSets, IsCapCategoryTwoCell,
IsBigInt, rec( filter := IsList, element_type := rec( filter := IsBigInt ) ), fail
);

Expand Down Expand Up @@ -63,7 +63,7 @@ end );
##
InstallMethod( AsList,
"for a CAP skeletal finite set",
[ IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets ],

function ( s )

Expand All @@ -74,7 +74,7 @@ end );
##
InstallMethod( ListOp,
"for a CAP skeletal finite set and a function",
[ IsSkeletalFiniteSet, IsFunction ],
[ IsObjectInCategoryOfSkeletalFinSets, IsFunction ],

function ( s, f )

Expand All @@ -87,7 +87,7 @@ end );
##
InstallMethod( MapOfFinSets,
"for two CAP skeletal finite sets and a list",
[ IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets, IsList, IsObjectInCategoryOfSkeletalFinSets ],

function ( s, G, t )

Expand All @@ -98,7 +98,7 @@ end );
##
InstallOtherMethod( MapOfFinSets,
"for a category of skeletal finite sets, two CAP skeletal finite sets and a list",
[ IsCategoryOfSkeletalFinSets, IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet ],
[ IsCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets, IsList, IsObjectInCategoryOfSkeletalFinSets ],

function ( cat, s, G, t )

Expand All @@ -109,7 +109,7 @@ end );
##
InstallMethod( EmbeddingOfFinSets,
"for two CAP skeletal finite sets",
[ IsSkeletalFiniteSet, IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ],

function ( s, t )
local iota;
Expand All @@ -126,7 +126,7 @@ end );
##
InstallMethod( Preimage,
"for a CAP map of skeletal finite sets and a CAP skeletal finite set",
[ IsSkeletalFiniteSetMap, IsList ],
[ IsMorphismInCategoryOfSkeletalFinSets, IsList ],

function ( phi, t )
local S;
Expand All @@ -142,7 +142,7 @@ end );
##
InstallMethod( ImageObject,
"for a CAP map of skeletal finite sets and a CAP skeletal finite set",
[ IsSkeletalFiniteSetMap, IsSkeletalFiniteSet ],
[ IsMorphismInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ],
function ( phi, s_ )

return ImageObject( PreCompose( EmbeddingOfFinSets( s_, Source( phi ) ), phi ) );
Expand All @@ -152,7 +152,7 @@ end );
##
InstallMethod( CallFuncList,
"for a CAP map of skeletal finite sets and a list",
[ IsSkeletalFiniteSetMap, IsList ],
[ IsMorphismInCategoryOfSkeletalFinSets, IsList ],

function ( phi, L )
local x;
Expand Down Expand Up @@ -988,7 +988,7 @@ end );
##
InstallMethod( String,
"for a CAP skeletal finite set",
[ IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets ],

function ( s )
return Concatenation( "FinSet( SkeletalFinSets, ", String( Length( s ) ), " )" );
Expand All @@ -997,7 +997,7 @@ end );
##
InstallMethod( String,
"for a CAP map of skeletal finite sets",
[ IsSkeletalFiniteSetMap ],
[ IsMorphismInCategoryOfSkeletalFinSets ],

function ( phi )
return Concatenation( "MapOfFinSets( SkeletalFinSets, ", String( Source( phi ) ), ", ", String( AsList( phi ) ), ", ", String( Range( phi ) ), " )" );
Expand All @@ -1006,7 +1006,7 @@ end );
##
InstallMethod( ViewString,
"for a CAP skeletal finite set",
[ IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets ],

function ( s )
return Concatenation( "|", String( Length( s ) ), "|" );
Expand All @@ -1015,7 +1015,7 @@ end );
##
InstallMethod( ViewString,
"for a CAP map of skeletal finite sets",
[ IsSkeletalFiniteSetMap ],
[ IsMorphismInCategoryOfSkeletalFinSets ],

function ( phi )
local arrow;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ end );
##
InstallMethod( PrintString,
"for a CAP skeletal finite set",
[ IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets ],

function ( s )
local l, string;
Expand All @@ -1073,7 +1073,7 @@ end );
##
InstallMethod( PrintString,
"for a CAP map of skeletal finite sets",
[ IsSkeletalFiniteSetMap ],
[ IsMorphismInCategoryOfSkeletalFinSets ],

function ( phi )

Expand All @@ -1087,7 +1087,7 @@ end );
##
InstallMethod( DisplayString,
"for a CAP skeletal finite set",
[ IsSkeletalFiniteSet ],
[ IsObjectInCategoryOfSkeletalFinSets ],

function ( s )

Expand All @@ -1098,7 +1098,7 @@ end );
##
InstallMethod( DisplayString,
"for a CAP map of skeletal finite sets",
[ IsSkeletalFiniteSetMap ],
[ IsMorphismInCategoryOfSkeletalFinSets ],

function ( phi )

Expand All @@ -1116,3 +1116,6 @@ InstallOtherMethod( FinSet,
return FinSet( SkeletalFinSets, n );

end );

DeclareSynonym( "IsSkeletalFiniteSet", IsObjectInCategoryOfSkeletalFinSets );
DeclareSynonym( "IsSkeletalFiniteSetMap", IsMorphismInCategoryOfSkeletalFinSets );

0 comments on commit 7404f42

Please sign in to comment.