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

9 Technical Details
 9.1 The Category Cat
 9.2 Tools

  9.2-1 DeclareFamilyProperty

  9.2-2 CAP_INTERNAL_REPLACE_STRING_WITH_FILTER

  9.2-3 CAP_INTERNAL_REPLACE_STRINGS_WITH_FILTERS

  9.2-4 CAP_INTERNAL_MERGE_FILTER_LISTS

  9.2-5 CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT

  9.2-6 CAP_INTERNAL_FIND_APPEARANCE_OF_SYMBOL_IN_FUNCTION

  9.2-7 CAP_INTERNAL_MERGE_PRECONDITIONS_LIST

  9.2-8 CAP_INTERNAL_ASSERT_IS_CELL_OF_CATEGORY

  9.2-9 CAP_INTERNAL_ASSERT_IS_OBJECT_OF_CATEGORY

  9.2-10 CAP_INTERNAL_ASSERT_IS_MORPHISM_OF_CATEGORY

  9.2-11 CAP_INTERNAL_ASSERT_IS_TWO_CELL_OF_CATEGORY

  9.2-12 CAP_INTERNAL_ASSERT_IS_LIST_OF_OBJECTS_OF_CATEGORY

  9.2-13 CAP_INTERNAL_ASSERT_IS_LIST_OF_MORPHISMS_OF_CATEGORY

  9.2-14 CAP_INTERNAL_ASSERT_IS_LIST_OF_TWO_CELLS_OF_CATEGORY

  9.2-15 CAP_INTERNAL_ASSERT_IS_NON_NEGATIVE_INTEGER_OR_INFINITY

  9.2-16 CachingStatistic

  9.2-17 BrowseCachingStatistic

  9.2-18 InstallDeprecatedAlias

  9.2-19 IsSpecializationOfFilter

  9.2-20 IsSpecializationOfFilterList

  9.2-21 InstallMethodForCompilerForCAP

  9.2-22 InstallOtherMethodForCompilerForCAP

  9.2-23 CapJitAddKnownMethod

  9.2-24 CapJitAddTypeSignature

  9.2-25 CapJitAddTypeSignatureDeferred

  9.2-26 CapJitDataTypeOfCategory

  9.2-27 CapFixpoint

  9.2-28 Iterated

  9.2-29 TransitivelyNeededOtherPackages

  9.2-30 PackageOfCAPOperation

  9.2-31 SafePosition

  9.2-32 SafeUniquePosition

  9.2-33 SafePositionProperty

  9.2-34 SafeUniquePositionProperty

  9.2-35 SafeFirst

  9.2-36 SafeUniqueEntry

  9.2-37 NTuple

  9.2-38 Pair

  9.2-39 Triple

  9.2-40 HandlePrecompiledTowers

  9.2-41 CAP_JIT_INCOMPLETE_LOGIC

  9.2-42 ListWithKeys

  9.2-43 SumWithKeys

  9.2-44 ProductWithKeys

  9.2-45 ForAllWithKeys

  9.2-46 ForAnyWithKeys

  9.2-47 NumberWithKeys

  9.2-48 FilteredWithKeys

  9.2-49 FirstWithKeys

  9.2-50 LastWithKeys

9 Technical Details

9.1 The Category Cat

9.1-1 ObjectCache
‣ ObjectCache( functor )( attribute )

Returns: IsCachingObject

Retuns the caching object which stores the results of the functor functor applied to objects.

9.1-2 MorphismCache
‣ MorphismCache( functor )( attribute )

Returns: IsCachingObject

Retuns the caching object which stores the results of the functor functor applied to morphisms.

9.2 Tools

9.2-1 DeclareFamilyProperty
‣ DeclareFamilyProperty( arg )( function )

9.2-2 CAP_INTERNAL_REPLACE_STRING_WITH_FILTER
‣ CAP_INTERNAL_REPLACE_STRING_WITH_FILTER( filter_or_string[, category] )( function )

Returns: a filter

The function takes a filter or one of the strings listed under filter_list in 7.3. Filters are returned unchanged. If a string is given, the corresponding filter of the category category is returned. If no category is given, generic filters (IsCapCategoryObject, IsCapCategoryMorphism etc.) are used.

9.2-3 CAP_INTERNAL_REPLACE_STRINGS_WITH_FILTERS
‣ CAP_INTERNAL_REPLACE_STRINGS_WITH_FILTERS( list[, category] )( function )

Returns: Replaced list

Applies CAP_INTERNAL_REPLACE_STRING_WITH_FILTER (9.2-2) to all elements of list and returns the result.

9.2-4 CAP_INTERNAL_MERGE_FILTER_LISTS
‣ CAP_INTERNAL_MERGE_FILTER_LISTS( list, additional, list )( function )

Returns: merged lists

The first argument should be a dense list with filters, the second a sparse list containing filters not longer then the first one. The filters of the second list are then appended (via and) to the filters in the first list at the corresponding position, and the resulting list is returned.

9.2-5 CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT
‣ CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( string, value )( function )

Returns: option value

Returns the value of the option with name string, or, if this value is fail, the object value.

9.2-6 CAP_INTERNAL_FIND_APPEARANCE_OF_SYMBOL_IN_FUNCTION
‣ CAP_INTERNAL_FIND_APPEARANCE_OF_SYMBOL_IN_FUNCTION( function, symbol_list, loop_multiple, replacement_record )( function )

Returns: a list of symbols with multiples

The function searches for the appearance of the strings in symbol list on the function function and returns a list of pairs, containing the name of the symbol and the number of appearance. If the symbol appears in a loop, the number of appearance is counted times the loop multiple. Moreover, if appearances of found strings should be replaced by collections of other strings, then these can be specified in the replacement record.

9.2-7 CAP_INTERNAL_MERGE_PRECONDITIONS_LIST
‣ CAP_INTERNAL_MERGE_PRECONDITIONS_LIST( list1, list2 )( function )

Returns: merge list

The function takes two lists containing pairs of symbols (strings) and multiples. The lists are merged that pairs where the string only appears in one list is then added to the return list, if a pair with a string appears in both lists, the resulting lists only contains this pair once, with the higher multiple from both lists.

9.2-8 CAP_INTERNAL_ASSERT_IS_CELL_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_CELL_OF_CATEGORY( cell, category, human_readable_identifier_getter )( function )

The function throws an error if cell is not a cell of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to cell in the error message.

9.2-9 CAP_INTERNAL_ASSERT_IS_OBJECT_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_OBJECT_OF_CATEGORY( object, category, human_readable_identifier_getter )( function )

The function throws an error if object is not an object of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to object in the error message.

9.2-10 CAP_INTERNAL_ASSERT_IS_MORPHISM_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_MORPHISM_OF_CATEGORY( morphism, category, human_readable_identifier_getter )( function )

The function throws an error if morphism is not a morphism of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to morphism in the error message.

9.2-11 CAP_INTERNAL_ASSERT_IS_TWO_CELL_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_TWO_CELL_OF_CATEGORY( two_cell, category, human_readable_identifier_getter )( function )

The function throws an error if two_cell is not a 2-cell of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to two_cell in the error message.

9.2-12 CAP_INTERNAL_ASSERT_IS_LIST_OF_OBJECTS_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_LIST_OF_OBJECTS_OF_CATEGORY( list_of_objects, category, human_readable_identifier_getter )( function )

The function throws an error if list_of_objects is not a dense list of objects of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to list_of_objects in the error message.

9.2-13 CAP_INTERNAL_ASSERT_IS_LIST_OF_MORPHISMS_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_LIST_OF_MORPHISMS_OF_CATEGORY( list_of_morphisms, category, human_readable_identifier_getter )( function )

The function throws an error if list_of_morphisms is not a dense list of morphisms of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to list_of_morphisms in the error message.

9.2-14 CAP_INTERNAL_ASSERT_IS_LIST_OF_TWO_CELLS_OF_CATEGORY
‣ CAP_INTERNAL_ASSERT_IS_LIST_OF_TWO_CELLS_OF_CATEGORY( list_of_twocells, category, human_readable_identifier_getter )( function )

The function throws an error if list_of_twocells is not a dense list of 2-cells of category. If category is the boolean false, only general checks not specific to a concrete category are performed. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to list_of_twocells in the error message.

9.2-15 CAP_INTERNAL_ASSERT_IS_NON_NEGATIVE_INTEGER_OR_INFINITY
‣ CAP_INTERNAL_ASSERT_IS_NON_NEGATIVE_INTEGER_OR_INFINITY( nnintorinf, human_readable_identifier_getter )( function )

The function throws an error if nnintorinf is not a nonnegative integer or infinity. human_readable_identifier_getter is a 0-ary function returning a string which is used to refer to nnintorinf in the error message.

9.2-16 CachingStatistic
‣ CachingStatistic( category[, operation] )( function )

Prints statistics for all caches in category. If operation is given (as a string), only statistics for the given operation cache is stored.

9.2-17 BrowseCachingStatistic
‣ BrowseCachingStatistic( category )( function )

Displays statistics for all caches in category. in a Browse window. Here "status" indicates if the cache is weak, strong, or inactive, "hits" is the number of successful cache accesses, "misses" the number of unsuccessful cache accesses, and "stored" the number of objects currently stored in the cache.

9.2-18 InstallDeprecatedAlias
‣ InstallDeprecatedAlias( alias_name, function_name, deprecation_date )( function )

Makes the function given by function_name available under the alias alias_name with a deprecation warning including the date deprecation_date.

9.2-19 IsSpecializationOfFilter
‣ IsSpecializationOfFilter( filter1, filter2 )( function )

Checks if filter2 is more special than filter1, i.e. if filter2 implies filter1. filter1 and/or filter2 can also be one of the strings listed under filter_list in 7.3 and in this case are replaced by the corresponding filters (e.g. IsCapCategory, IsCapCategoryObject, IsCapCategoryMorphism, ...).

9.2-20 IsSpecializationOfFilterList
‣ IsSpecializationOfFilterList( filter_list1, filter_list2 )( function )

Checks if filter_list2 is more special than filter_list1, i.e. if both lists have the same length and any element of filter_list2 is more special than the corresponding element of filter_list1 in the sense of IsSpecializationOfFilter (9.2-19). filter_list1 and filter_list2 can also be the string "any", respresenting a most general filter list of any length.

9.2-21 InstallMethodForCompilerForCAP
‣ InstallMethodForCompilerForCAP( same, as, for, InstallMethod )( function )

Installs a method via InstallMethod and adds it to the list of methods known to the compiler. See CapJitAddKnownMethod (9.2-23) for requirements.

9.2-22 InstallOtherMethodForCompilerForCAP
‣ InstallOtherMethodForCompilerForCAP( same, as, for, InstallOtherMethod )( function )

Installs a method via InstallOtherMethod and adds it to the list of methods known to the compiler. See CapJitAddKnownMethod (9.2-23) for requirements.

9.2-23 CapJitAddKnownMethod
‣ CapJitAddKnownMethod( operation, filters, method )( function )

Adds a method to the list of methods known to the compiler. The first argument of the method must be a CAP category. Method selection happens via the number of arguments and the category filter. In particular, adding two methods (or a convenience method for a CAP operation) with the same number of arguments and one category filter implying the other is not supported.

9.2-24 CapJitAddTypeSignature
‣ CapJitAddTypeSignature( name, input_filters, output_data_type )( function )

(experimental) Adds a type signature for the global function or operation given by name to the compiler. input_filters must be a list of filters, or the string '"any"' representing a most general filter list of any length. output_data_type must be a filter, a data type, or a function. If it is a function with one argument, it must accept a list of input types and return the corresponding data type of the output. If it is a function with two arguments, it must accept the arguments of a function call of name (as syntax trees) and the function stack and return a record with components args (the possibly modified arguments) and output_type (the data type of the output). See CapJitInferredDataTypes (CompilerForCAP: CapJitInferredDataTypes) for more details on data types.

9.2-25 CapJitAddTypeSignatureDeferred
‣ CapJitAddTypeSignatureDeferred( package_name, name, input_filters, output_data_type )( function )

(experimental) Same as CapJitAddTypeSignature (9.2-24), but the filters and the output data type must be given as strings which will be evaluated once package_name is loaded. This should be used with care because errors will only be detected at runtime.

9.2-26 CapJitDataTypeOfCategory
‣ CapJitDataTypeOfCategory( category )( function )
‣ CapJitDataTypeOfObjectOfCategory( category )( function )
‣ CapJitDataTypeOfMorphismOfCategory( category )( function )

(experimental) Returns the data type of the category (or objects or morphisms in the category) category.

9.2-27 CapFixpoint
‣ CapFixpoint( predicate, func, initial_value )( function )

Computes a fixpoint of func with regard to equality given by predicate, starting with initial_value. If no such fixpoint exists, the execution does not terminate.

9.2-28 Iterated
‣ Iterated( list, func, initial_value )( operation )

Shorthand for Iterated( Concatenation( [ initial_value ], list ), func ).

9.2-29 TransitivelyNeededOtherPackages
‣ TransitivelyNeededOtherPackages( package_name )( function )

Returns a list of package names which are transitively needed other packages of the package package_name.

9.2-30 PackageOfCAPOperation
‣ PackageOfCAPOperation( operation_name )( function )

Returns the name of the package to which the CAP operation given by operation_name belongs or fail if the package is not known.

9.2-31 SafePosition
‣ SafePosition( list, obj )( operation )

Returns: an integer

Returns Position( list, obj ) while asserting that this value is not fail.

9.2-32 SafeUniquePosition
‣ SafeUniquePosition( list, obj )( operation )

Returns: an integer

Returns Position( list, obj ) while asserting that this value is not fail and the position is unique.

9.2-33 SafePositionProperty
‣ SafePositionProperty( list, func )( operation )

Returns: an integer

Returns PositionProperty( list, func ) while asserting that this value is not fail.

9.2-34 SafeUniquePositionProperty
‣ SafeUniquePositionProperty( list, func )( operation )

Returns: an integer

Returns a position in list for which func returns true when applied to the corresponding entry while asserting that there exists exactly one such position.

9.2-35 SafeFirst
‣ SafeFirst( list, func )( operation )

Returns: an element of the list

Returns First( list, func ) while asserting that this value is not fail.

9.2-36 SafeUniqueEntry
‣ SafeUniqueEntry( list, func )( operation )

Returns: an element of the list

Returns a value in list for which func returns true while asserting that there exists exactly one such entry.

9.2-37 NTuple
‣ NTuple( n, args... )( function )

Returns: a list

Returns args while asserting that its length is n.

9.2-38 Pair
‣ Pair( first, second )( function )

Returns: a list

Alias for NTuple( 2, first, second ).

9.2-39 Triple
‣ Triple( first, second, third )( function )

Returns: a list

Alias for NTuple( 3, first, second, third ).

9.2-40 HandlePrecompiledTowers
‣ HandlePrecompiledTowers( category, underlying_category, constructor_name )( function )

Handles the information stored in underlying_category!.compiler_hints.precompiled_towers (if bound) which is a list of records with components:

If constructor_name is the only entry of remaining_constructors_in_tower, precompiled_functions_adder is applied to category (except if the option no_precompiled_code is set to true) and should add precompiled code. Else, if constructor_name is the first entry of remaining_constructors_in_tower, the information is attached to category!.compiler_hints.precompiled_towers after removing constructor_name from remaining_constructors_in_tower. Note: Currently, there is no logic for finding the "optimal" code to install if constructor_name is the only entry of remaining_constructors_in_tower of multiple entries.

9.2-41 CAP_JIT_INCOMPLETE_LOGIC
‣ CAP_JIT_INCOMPLETE_LOGIC( value )( function )

Simply returns value. Used to signify that the argument is not fully run through all logic functions/templates by CompilerForCAP.

9.2-42 ListWithKeys
‣ ListWithKeys( list, func )( function )

Returns: a list

Same as List( list, func ) but func gets both the key i and list[i] as arguments.

9.2-43 SumWithKeys
‣ SumWithKeys( list, func )( function )

Returns: a list

Same as Sum( list, func ) but func gets both the key i and list[i] as arguments.

9.2-44 ProductWithKeys
‣ ProductWithKeys( list, func )( function )

Returns: a list

Same as Product( list, func ) but func gets both the key i and list[i] as arguments.

9.2-45 ForAllWithKeys
‣ ForAllWithKeys( list, func )( function )

Returns: a list

Same as ForAll( list, func ) but func gets both the key i and list[i] as arguments.

9.2-46 ForAnyWithKeys
‣ ForAnyWithKeys( list, func )( function )

Returns: a list

Same as ForAny( list, func ) but func gets both the key i and list[i] as arguments.

9.2-47 NumberWithKeys
‣ NumberWithKeys( list, func )( function )

Returns: a list

Same as Number( list, func ) but func gets both the key i and list[i] as arguments.

9.2-48 FilteredWithKeys
‣ FilteredWithKeys( list, func )( function )

Returns: a list

Same as Filtered( list, func ) but func gets both the key i and list[i] as arguments.

9.2-49 FirstWithKeys
‣ FirstWithKeys( list, func )( function )

Returns: a list

Same as First( list, func ) but func gets both the key i and list[i] as arguments.

9.2-50 LastWithKeys
‣ LastWithKeys( list, func )( function )

Returns: a list

Same as Last( list, func ) but func gets both the key i and list[i] as arguments.

 [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 Ind

generated by GAPDoc2HTML