Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

1 CAP Categories
 1.1 Categories
 1.2 Categorical properties
 1.3 Constructor
 1.4 Internal Attributes
 1.5 Logic switcher
 1.6 Tool functions
 1.7 Well-Definedness of Cells
 1.8 Unpacking data structures
 1.9 Caching
 1.10 Sanity checks
 1.11 Timing statistics
 1.12 Enable automatic calls of Add
 1.13 Performance tweaks
 1.14 LaTeX

1 CAP Categories

Categories are the main GAP objects in CAP. They are used to associate GAP objects which represent objects and morphisms with their category. By associating a GAP object to the category, one of two filters belonging to the category (ObjectFilter/MorphismFilter) are set to true. Via Add methods, functions for specific existential quantifiers can be associated to the category and after that can be applied to GAP objects in the category. A GAP category object also knows which constructions are currently possible in this category.

Classically, a category consists of a class of objects, a set of morphisms, identity morphisms, and a composition function satisfying some simple axioms. In CAP, we use a slightly different notion of a category.

A CAP category \mathbf{C} consists of the following data:

1.1 Categories

1.1-1 IsCapCategory
‣ IsCapCategory( object )( filter )

Returns: true or false

The GAP category of CAP categories. Objects of this type handle the CAP category information, the caching, and filters for objects in the CAP category. Please note that the object itself is not related to methods, you only need it as a handler and a presentation of the CAP category.

1.1-2 IsCapCategoryCell
‣ IsCapCategoryCell( object )( filter )

Returns: true or false

The GAP category of CAP category cells. Every object, morphism, and 2-cell of a CAP category lies in this GAP category.

1.1-3 IsCapCategoryObject
‣ IsCapCategoryObject( object )( filter )

Returns: true or false

The GAP category of CAP category objects. Every object of a CAP category lies in this GAP category.

1.1-4 IsCapCategoryMorphism
‣ IsCapCategoryMorphism( object )( filter )

Returns: true or false

The GAP category of CAP category morphisms. Every morphism of a CAP category lies in this GAP category.

1.1-5 IsCapCategoryTwoCell
‣ IsCapCategoryTwoCell( object )( filter )

Returns: true or false

The GAP category of CAP category 2-cells. Every 2-cell of a CAP category lies in this GAP category.

1.2 Categorical properties

1.2-1 AddCategoricalProperty
‣ AddCategoricalProperty( list )( function )

Adds a categorical property to the list of CAP categorical properties. list must be a list containing one entry, if the property is self dual, or two, if the dual property has a different name. If the first entry of the list is empty and the second is a property name, the property is assumed to have no dual.

1.2-2 IsEquippedWithHomomorphismStructure
‣ IsEquippedWithHomomorphismStructure( C )( property )

Returns: true or false

The property of the category C being equipped with a homomorphism structure.

1.2-3 IsCategoryWithDecidableLifts
‣ IsCategoryWithDecidableLifts( C )( property )

Returns: true or false

The property of the category C having decidable lifts.

1.2-4 IsCategoryWithDecidableColifts
‣ IsCategoryWithDecidableColifts( C )( property )

Returns: true or false

The property of the category C having decidable colifts.

1.2-5 IsCategoryWithInitialObject
‣ IsCategoryWithInitialObject( C )( property )

Returns: true or false

The property of the category C having an initial object.

1.2-6 IsCategoryWithTerminalObject
‣ IsCategoryWithTerminalObject( C )( property )

Returns: true or false

The property of the category C having a terminal object.

1.2-7 IsCategoryWithZeroObject
‣ IsCategoryWithZeroObject( C )( property )

Returns: true or false

The property of the category C having a zero object.

1.2-8 IsEnrichedOverCommutativeRegularSemigroup
‣ IsEnrichedOverCommutativeRegularSemigroup( C )( property )

Returns: true or false

The property of the category C being enriched over a commutative regular semigroup.

1.2-9 IsSkeletalCategory
‣ IsSkeletalCategory( C )( property )

Returns: true or false

The property of the category C being skeletal, that is, whether IsEqualForObjects and IsIsomorphicForObjects coincide.

1.2-10 IsAbCategory
‣ IsAbCategory( C )( property )

Returns: true or false

The property of the category C being preadditive.

1.2-11 IsLinearCategoryOverCommutativeRing
‣ IsLinearCategoryOverCommutativeRing( C )( property )

Returns: true or false

The property of the category C being linear over a commutative ring.

1.2-12 IsLinearCategoryOverCommutativeRingWithFinitelyGeneratedFreeExternalHoms
‣ IsLinearCategoryOverCommutativeRingWithFinitelyGeneratedFreeExternalHoms( C )( property )

Returns: true or false

The property of the category C being linear over a commutative ring k such that all external homs are finitely generated free k-modules.

1.2-13 IsAdditiveCategory
‣ IsAdditiveCategory( C )( property )

Returns: true or false

The property of the category C being additive.

1.2-14 IsPreAbelianCategory
‣ IsPreAbelianCategory( C )( property )

Returns: true or false

The property of the category C being preabelian.

1.2-15 IsAbelianCategory
‣ IsAbelianCategory( C )( property )

Returns: true or false

The property of the category C being abelian.

1.2-16 IsAbelianCategoryWithEnoughProjectives
‣ IsAbelianCategoryWithEnoughProjectives( C )( property )

Returns: true or false

The property of the category C being abelian with enough projectives.

1.2-17 IsAbelianCategoryWithEnoughInjectives
‣ IsAbelianCategoryWithEnoughInjectives( C )( property )

Returns: true or false

The property of the category C being abelian with enough injectives.

1.2-18 IsLocallyOfFiniteProjectiveDimension
‣ IsLocallyOfFiniteProjectiveDimension( C )( property )

Returns: true or false

The property of the category C being locally of finite projective dimension.

1.2-19 IsLocallyOfFiniteInjectiveDimension
‣ IsLocallyOfFiniteInjectiveDimension( C )( property )

Returns: true or false

The property of the category C being locally of finite injective dimension.

1.3 Constructor

1.3-1 CreateCapCategory
‣ CreateCapCategory( )( operation )

Returns: a category

Creates a new CAP category from scratch. It gets a generic name.

1.3-2 CreateCapCategory
‣ CreateCapCategory( s )( operation )

Returns: a category

The argument is a string s. This operation creates a new CAP category from scratch. Its name is set to s.

1.3-3 CreateCapCategory
‣ CreateCapCategory( s, category_filter, object_filter, morphism_filter, two_cell_filter )( operation )

Returns: a category

The argument is a string s. This operation creates a new CAP category from scratch. Its name is set to s. The category, its objects, its morphisms, and its two cells will lie in the corresponding given filters.

1.3-4 CreateCapCategoryWithDataTypes
‣ CreateCapCategoryWithDataTypes( s, category_filter, object_filter, morphism_filter, two_cell_filter, object_datum_type, morphism_datum_type, two_cell_datum_type )( function )

Returns: a category

The argument is a string s. This operation creates a new CAP category from scratch. Its name is set to s. The category, its objects, its morphisms, and its two cells will lie in the corresponding given filters. The data types of the object/morphism/two cell datum can be given as described in CapJitInferredDataTypes (CompilerForCAP: CapJitInferredDataTypes). As a convenience, simply a filter can be given if this suffices to fully determine the data type. If a data type is not specified, pass fail instead.

1.4 Internal Attributes

1.4-1 Name
‣ Name( C )( attribute )

Returns: a string

The argument is a category C. The output is its name.

Each category C stores various filters. They are used to apply the right functions in the method selection.

1.4-2 CategoryFilter
‣ CategoryFilter( C )( attribute )

Returns: a filter

The argument is a category C. The output is a filter in which C lies.

1.4-3 ObjectFilter
‣ ObjectFilter( C )( attribute )

Returns: a filter

The argument is a category C. The output is a filter in which all objects of C shall lie.

1.4-4 MorphismFilter
‣ MorphismFilter( C )( attribute )

Returns: a filter

The argument is a category C. The output is a filter in which all morphisms of C shall lie.

1.4-5 TwoCellFilter
‣ TwoCellFilter( C )( attribute )

Returns: a filter

The argument is a category C. The output is a filter in which all 2-cells of C shall lie.

1.4-6 ObjectDatumType
‣ ObjectDatumType( C )( attribute )

Returns: a data type or fail

The argument is a category C. The output is the data type (see CapJitInferredDataTypes (CompilerForCAP: CapJitInferredDataTypes)) of object data of C (or fail if this data type is not specified).

1.4-7 MorphismDatumType
‣ MorphismDatumType( C )( attribute )

Returns: a data type or fail

The argument is a category C. The output is the data type (see CapJitInferredDataTypes (CompilerForCAP: CapJitInferredDataTypes)) of morphism data of C (or fail if this data type is not specified).

1.4-8 TwoCellDatumType
‣ TwoCellDatumType( C )( attribute )

Returns: a data type or fail

The argument is a category C. The output is the data type (see CapJitInferredDataTypes (CompilerForCAP: CapJitInferredDataTypes)) of two cell data of C (or fail if this data type is not specified).

1.4-9 CommutativeRingOfLinearCategory
‣ CommutativeRingOfLinearCategory( C )( attribute )

Returns: a ring

The argument is a category C which is expected to lie in the filter IsLinearCategoryOverCommutativeRing. The output is a commutative ring over which the category is linear.

1.4-10 RangeCategoryOfHomomorphismStructure
‣ RangeCategoryOfHomomorphismStructure( C )( attribute )

Returns: a category

The argument is a category C which is expected to lie in the filter IsEquippedWithHomomorphismStructure. The output is the range category D of the defining functor H: C^{\mathrm{op}} \times C \rightarrow D of the homomorphism structure.

1.4-11 AdditiveGenerators
‣ AdditiveGenerators( C )( attribute )

Returns: a list of objects

The argument is an additive category C. The output is a list L of objects in C such that every object in C is a finite direct sum of objects in L.

1.4-12 IndecomposableProjectiveObjects
‣ IndecomposableProjectiveObjects( C )( attribute )

Returns: a list of objects

The argument is an Abelian category C with enough projectives. The output is the set of indecomposable projective objects in C up to isomorphism. That is every projective object in C is isomorphic to a finite direct sum over these objects.

1.4-13 IndecomposableInjectiveObjects
‣ IndecomposableInjectiveObjects( C )( attribute )

Returns: a list of objects

The argument is an Abelian category C with enough injectives. The output is the set of indecomposable injective objects in C up to isomorphism. That is every injective object in C is isomorphic to a finite direct sum over these objects.

1.5 Logic switcher

1.5-1 CapCategorySwitchLogicPropagationForObjectsOn
‣ CapCategorySwitchLogicPropagationForObjectsOn( C )( function )

Activates the predicate logic propagation between equal objects for the category C.

1.5-2 CapCategorySwitchLogicPropagationForObjectsOff
‣ CapCategorySwitchLogicPropagationForObjectsOff( C )( function )

Deactivates the predicate logic propagation between equal objects for the category C.

1.5-3 CapCategorySwitchLogicPropagationForMorphismsOn
‣ CapCategorySwitchLogicPropagationForMorphismsOn( C )( function )

Activates the predicate logic propagation between equal morphisms for the category C.

1.5-4 CapCategorySwitchLogicPropagationForMorphismsOff
‣ CapCategorySwitchLogicPropagationForMorphismsOff( C )( function )

Deactivates the predicate logic propagation between equal morphisms for the category C.

1.5-5 CapCategorySwitchLogicPropagationOn
‣ CapCategorySwitchLogicPropagationOn( C )( function )

Activates the predicate logic propagation between equal cells for the category C.

1.5-6 CapCategorySwitchLogicPropagationOff
‣ CapCategorySwitchLogicPropagationOff( C )( function )

Deactivates the predicate logic propagation between equal cells for the category C.

1.5-7 CapCategorySwitchLogicOn
‣ CapCategorySwitchLogicOn( C )( function )

Activates the predicate implication logic for the category C.

1.5-8 CapCategorySwitchLogicOff
‣ CapCategorySwitchLogicOff( C )( function )

Deactivates the predicate implication logic for the category C.

1.6 Tool functions

1.6-1 CanCompute
‣ CanCompute( C, string )( operation )
‣ CanCompute( C, operation )( operation )

Returns: true or false

The argument is a category C and a string string, which should be the name of a CAP operation, e.g., PreCompose. If applying this method is possible in C, the method returns true, false otherwise. If the string is not the name of a CAP operation, an error is raised. For debugging purposes one can also pass the CAP operation instead of its name.

1.6-2 OperationWeight
‣ OperationWeight( cat, op_name )( operation )

Returns: an integer

Returns the weight of the operation currently installed as op_name in cat.

1.6-3 MissingOperationsForConstructivenessOfCategory
‣ MissingOperationsForConstructivenessOfCategory( C, s )( operation )

Returns: a list

The arguments are a category C and a string s. If s is a categorical property (e.g. "IsAbelianCategory"), the output is a list of strings with CAP operations which are missing in C to have the categorical property constructively. If s is not a categorical property, an error is raised.

1.7 Well-Definedness of Cells

1.7-1 IsWellDefined
‣ IsWellDefined( c )( property )

Returns: a boolean

The argument is a cell c. The output is true if c is well-defined, otherwise the output is false.

1.8 Unpacking data structures

1.8-1 Down
‣ Down( x )( attribute )

Returns: a GAP object

The argument is a GAP object x. If x is an object in a CAP category, the output consists of data which are needed to reconstruct x (e.g., by passing them to an appropriate constructor). If x is a morphism in a CAP category, the output consists of a triple whose first entry is the source of x, the third entry is the range of x, and the second entry consists of data which are needed to reconstruct x (e.g., by passing them to an appropriate constructor, possibly together with the source and range of x).

1.8-2 DownOnlyMorphismData
‣ DownOnlyMorphismData( x )( attribute )

Returns: a GAP object

The argument is a morphism in a CAP category, the output consists of data which are needed to reconstruct x (e.g., by passing it to an appropriate constructor, possibly together with its source and range).

1.8-3 DownToBottom
‣ DownToBottom( x )( attribute )

Returns: a GAP object

The argument is a GAP object x. This function iteratively calls Down until it becomes stable.

1.9 Caching

1.9-1 SetCachingOfCategory
‣ SetCachingOfCategory( category, type )( function )

Sets the caching of category to type.

1.9-2 SetCachingOfCategoryWeak
‣ SetCachingOfCategoryWeak( category )( function )
‣ SetCachingOfCategoryCrisp( category )( function )
‣ DeactivateCachingOfCategory( category )( function )

Sets the caching of category to weak, crisp or none, respectively.

1.9-3 SetDefaultCaching
‣ SetDefaultCaching( type )( function )
‣ SetDefaultCachingWeak( )( function )
‣ SetDefaultCachingCrisp( )( function )
‣ DeactivateDefaultCaching( )( function )

Sets the default caching behaviour, all new categories will have their caching set to either weak, crisp, or none. The default at startup is weak.

1.10 Sanity checks

1.10-1 DisableInputSanityChecks
‣ DisableInputSanityChecks( category )( function )
‣ DisableOutputSanityChecks( category )( function )
‣ EnablePartialInputSanityChecks( category )( function )
‣ EnablePartialOutputSanityChecks( category )( function )
‣ EnableFullInputSanityChecks( category )( function )
‣ EnableFullOutputSanityChecks( category )( function )
‣ DisableSanityChecks( category )( function )
‣ EnablePartialSanityChecks( category )( function )
‣ EnableFullSanityChecks( category )( function )

Most operations can perform optional sanity checks on their arguments and results. The checks can either be partial (set by default), full, or disabled. With the following commands you can either enable the full checks, the partial checks or, for performance, disable the checks altogether. You can do this for input checks, output checks or for both at once.

1.11 Timing statistics

1.11-1 EnableTimingStatistics
‣ EnableTimingStatistics( category )( function )
‣ DisableTimingStatistics( category )( function )
‣ ResetTimingStatistics( category )( function )
‣ DisplayTimingStatistics( category )( function )
‣ BrowseTimingStatistics( category )( function )

Enable, disable, reset, display, or browse timing statistics of the primitive operations of category. Caution: If a primitive operation calls another primitive operation, the runtime of the later (including sanity checks etc.) is also included in the runtime of the former.

1.12 Enable automatic calls of Add

1.12-1 EnableAddForCategoricalOperations
‣ EnableAddForCategoricalOperations( C )( function )
‣ DisableAddForCategoricalOperations( C )( function )

Enables/disables the automatic call of Add for the output of primitively added functions for the category C. If the automatic call of Add is disabled (default), the output of primitively added functions must belong to the correct category. If the automatic call of Add is enabled, the output of primitively added functions only has to be a GAP object lying in IsAttributeStoringRep (with suitable attributes Source and Range if the output should be a morphism or a twocell).

1.13 Performance tweaks

For finding performance issues in primitive operations, you can collect timing statistics, see 1.11. You can use the package CompilerForCAP to compile your code. Additionally, CAP has several settings which can improve the performance. In the following some of these are listed.

1.14 LaTeX

1.14-1 LaTeXOutput
‣ LaTeXOutput( c )( operation )

Returns: a string

The argument is a cell c. The output is a LaTeX string s (without enclosing dollar signs) that may be used to print out c nicely.

1.14-2 LaTeXOutput
‣ LaTeXOutput( C )( operation )

Returns: a string

The argument is a category C. The output is a LaTeX string s (without enclosing dollar signs) that may be used to print out C nicely.

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Ind

generated by GAPDoc2HTML