Error( "at most one of the options `IsDerivation`, `IsFinalDerivation` and `IsPrecompiledDerivation` may be set" );
fi;
if weight = -1then
weight := 100; fi;
if is_derivation then
type := "ordinary_derivation";
elif is_final_derivation then
type := "final_derivation";
elif is_precompiled_derivation then
type := "precompiled_derivation";
else
type := "primitive_installation";
fi;
# Display a warning in various cases when overwriting existing functions if IsBound( category!.operations.(function_name) ) then
# If there already is a faster method: do nothing but display a warning because this should not happen. if weight > category!.operations.(function_name).weight then
Print( "WARNING: Ignoring a function added for ", function_name, " with weight ", weight, " to \"", category_name, "\" because there already is a function installed with weight ", category!.operations.(function_name).weight, "." );
if type = "precompiled_derivation"then
Print( " Probably you have to rerun the precompilation to adjust the weights in the precompiled code." );
fi;
Print( "\n" );
return;
fi;
if category!.operations.( function_name ).type = "primitive_installation"then
# Display a warning when overwriting primitive operations with derivations. if type <> "primitive_installation"then
Print( "WARNING: Overwriting a function for ", function_name, " primitively added to \"", category_name, "\" with a derivation." );
if type = "precompiled_derivation"then
Print( " Probably you have to rerun the precompilation to adjust the weights in the precompiled code." );
fi;
Print( "\n" );
fi;
else
Print( "WARNING: A function for ", function_name, " of type ", category!.operations.( function_name ).type, " is unexpectedly overwritten by a function of type ", type, "." );
if category!.operations.( function_name ).type = "precompiled_derivation"then
Print( " Probably you have to rerun the precompilation to adjust the weights in the precompiled code." );
# if a function for which a cached precompiled function exists is overwritten, drop the cached precompiled function if IsBound( category!.cached_precompiled_functions.( function_name ) ) then
## Nr arguments sanity check if NumberArgumentsFunction( func_to_install ) >= 0 and NumberArgumentsFunction( func_to_install ) <> Length( replaced_filter_list ) then
Error( "While adding a function for ", function_name, ": given function has ", NumberArgumentsFunction( func_to_install ), " arguments but should have ", Length( replaced_filter_list ) );
fi;
# prepare input sanity check
input_human_readable_identifier_getter := { i, function_name, category_name } -> Concatenation( "the ", String( i ), ". argument of the function \033[1m", function_name, "\033[0m of the category named \033[1m", category_name, "\033[0m" );
input_sanity_check_functions := [ ];
for filter_string in record.filter_list do
if not IsBound( category!.input_sanity_check_functions.(filter_string) ) then
# prepare output sanity check
output_human_readable_identifier_getter := { function_name, category_name } -> Concatenation( "the result of the function \033[1m", function_name, "\033[0m of the category named \033[1m", category_name, "\033[0m" );
output_data_type := CAP_INTERNAL_GET_DATA_TYPE_FROM_STRING( record.return_type, category );
if IsBound( record.redirect_function ) then
redirect_return := CallFuncList( record.redirect_function, arg ); if redirect_return[ 1 ] = true then if category!.predicate_logic then
INSTALL_TODO_FOR_LOGICAL_THEOREMS( record.function_name, arg{[ 2 .. Length( arg ) ]}, redirect_return[ 2 ], category ); fi;
return redirect_return[ 2 ]; fi; fi;
if category!.input_sanity_check_level > 0then for i in [ 1 .. Length( input_sanity_check_functions ) ] do
input_sanity_check_functions[ i ]( arg[ i ], i, function_name, category_name );
od;
if IsBound( record.pre_function ) then
pre_func_return := CallFuncList( record.pre_function, arg ); if pre_func_return[ 1 ] = false then
CAP_INTERNAL_DISPLAY_ERROR_FOR_FUNCTION_OF_CATEGORY( record.function_name, category, pre_func_return[ 2 ] ); fi; fi;
if category!.input_sanity_check_level > 1 and IsBound( record.pre_function_full ) then
pre_func_return := CallFuncList( record.pre_function_full, arg ); if pre_func_return[ 1 ] = false then
CAP_INTERNAL_DISPLAY_ERROR_FOR_FUNCTION_OF_CATEGORY( record.function_name, category, pre_func_return[ 2 ] ); fi; fi;
fi;
collect_timing_statistics := category!.timing_statistics_enabled and not is_derivation and not is_final_derivation;
if not is_derivation and not is_final_derivation then if category!.add_primitive_output then
record.add_value_to_category_function( category, result ); elif category!.output_sanity_check_level > 0then
output_sanity_check_function( result, function_name, category_name ); fi; fi;
if category!.predicate_logic then
INSTALL_TODO_FOR_LOGICAL_THEOREMS( record.function_name, arg{[ 2 .. Length( arg ) ]}, result, category ); fi;
if IsBound( record.post_function ) then
CallFuncList( record.post_function, Concatenation( arg, [ result ] ) );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.