diff --git a/gap/CompilerLogic.gi b/gap/CompilerLogic.gi index 22011ba..bf18aaa 100644 --- a/gap/CompilerLogic.gi +++ b/gap/CompilerLogic.gi @@ -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 ); @@ -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 )", ) diff --git a/gap/Julia.gi b/gap/Julia.gi index ef26785..8b1e543 100644 --- a/gap/Julia.gi +++ b/gap/Julia.gi @@ -33,7 +33,7 @@ end ); ## InstallMethod( MapOfFinSets, - [ IsSkeletalFiniteSet, IsJuliaObject, IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets, IsJuliaObject, IsObjectInCategoryOfSkeletalFinSets ], function ( source, graph, range ) diff --git a/gap/SkeletalFinSets.gd b/gap/SkeletalFinSets.gd index 17fe281..6279abe 100644 --- a/gap/SkeletalFinSets.gd +++ b/gap/SkeletalFinSets.gd @@ -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 @@ -37,9 +37,9 @@ 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., @@ -47,18 +47,18 @@ CapJitAddTypeSignature( "Length", [ IsSkeletalFiniteSet ], IsBigInt ); #! @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 phi, see . +#! The graph defining the skeletal finite set morphism phi, see . #! @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 @@ -97,7 +97,7 @@ KeyDependentOperation( "FinSet", IsCategoryOfSkeletalFinSets, IsBigInt, ReturnTr #! @Arguments s, G, t #! @Returns a ∩ morphism DeclareOperation( "MapOfFinSets", - [ IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet ] ); + [ IsObjectInCategoryOfSkeletalFinSets, IsList, IsObjectInCategoryOfSkeletalFinSets ] ); #! @InsertChunk SkeletalMapOfFinSets #! @Section Tools @@ -107,7 +107,7 @@ DeclareOperation( "MapOfFinSets", #! @Arguments s, f #! @Returns a list DeclareOperation( "ListOp", - [ IsSkeletalFiniteSet, IsFunction ] ); + [ IsObjectInCategoryOfSkeletalFinSets, IsFunction ] ); #! @Description #! Construct the embedding $\iota:$s$\to$t of the finite sets s and t, @@ -115,34 +115,34 @@ DeclareOperation( "ListOp", #! @Arguments s, t #! @Returns a ∩ morphism DeclareOperation( "EmbeddingOfFinSets", - [ IsSkeletalFiniteSet, IsSkeletalFiniteSet ] ); + [ IsObjectInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ] ); #! @Description #! Compute the Preimage of t under the morphism phi. #! @Arguments phi, t #! @Returns a ∩ object DeclareOperation( "Preimage", - [ IsSkeletalFiniteSetMap, IsList ] ); + [ IsMorphismInCategoryOfSkeletalFinSets, IsList ] ); #! @Description #! Compute the image of s_ under the morphism phi. #! @Arguments phi, s_ #! @Returns a ∩ object DeclareOperation( "ImageObject", - [ IsSkeletalFiniteSetMap, IsSkeletalFiniteSet ] ); + [ IsMorphismInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ] ); #! @Description #! Returns the image of L[1] under the map phi assuming L[1] is a nonnegative integer smaller than Length( Source( phi ) ). #! @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 ); diff --git a/gap/SkeletalFinSets.gi b/gap/SkeletalFinSets.gi index f5708fd..dc6fe79 100644 --- a/gap/SkeletalFinSets.gi +++ b/gap/SkeletalFinSets.gi @@ -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 ); @@ -63,7 +63,7 @@ end ); ## InstallMethod( AsList, "for a CAP skeletal finite set", - [ IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets ], function ( s ) @@ -74,7 +74,7 @@ end ); ## InstallMethod( ListOp, "for a CAP skeletal finite set and a function", - [ IsSkeletalFiniteSet, IsFunction ], + [ IsObjectInCategoryOfSkeletalFinSets, IsFunction ], function ( s, f ) @@ -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 ) @@ -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 ) @@ -109,7 +109,7 @@ end ); ## InstallMethod( EmbeddingOfFinSets, "for two CAP skeletal finite sets", - [ IsSkeletalFiniteSet, IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets, IsObjectInCategoryOfSkeletalFinSets ], function ( s, t ) local iota; @@ -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; @@ -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 ) ); @@ -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; @@ -988,7 +988,7 @@ end ); ## InstallMethod( String, "for a CAP skeletal finite set", - [ IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets ], function ( s ) return Concatenation( "FinSet( SkeletalFinSets, ", String( Length( s ) ), " )" ); @@ -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 ) ), " )" ); @@ -1006,7 +1006,7 @@ end ); ## InstallMethod( ViewString, "for a CAP skeletal finite set", - [ IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets ], function ( s ) return Concatenation( "|", String( Length( s ) ), "|" ); @@ -1015,7 +1015,7 @@ end ); ## InstallMethod( ViewString, "for a CAP map of skeletal finite sets", - [ IsSkeletalFiniteSetMap ], + [ IsMorphismInCategoryOfSkeletalFinSets ], function ( phi ) local arrow; @@ -1049,7 +1049,7 @@ end ); ## InstallMethod( PrintString, "for a CAP skeletal finite set", - [ IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets ], function ( s ) local l, string; @@ -1073,7 +1073,7 @@ end ); ## InstallMethod( PrintString, "for a CAP map of skeletal finite sets", - [ IsSkeletalFiniteSetMap ], + [ IsMorphismInCategoryOfSkeletalFinSets ], function ( phi ) @@ -1087,7 +1087,7 @@ end ); ## InstallMethod( DisplayString, "for a CAP skeletal finite set", - [ IsSkeletalFiniteSet ], + [ IsObjectInCategoryOfSkeletalFinSets ], function ( s ) @@ -1098,7 +1098,7 @@ end ); ## InstallMethod( DisplayString, "for a CAP map of skeletal finite sets", - [ IsSkeletalFiniteSetMap ], + [ IsMorphismInCategoryOfSkeletalFinSets ], function ( phi ) @@ -1116,3 +1116,6 @@ InstallOtherMethod( FinSet, return FinSet( SkeletalFinSets, n ); end ); + +DeclareSynonym( "IsSkeletalFiniteSet", IsObjectInCategoryOfSkeletalFinSets ); +DeclareSynonym( "IsSkeletalFiniteSetMap", IsMorphismInCategoryOfSkeletalFinSets );