This module includes low-level primitives for interacting with CiaoPP.
Type analysis supports different degrees of precision. For example, with the flag type_precision with value defined, the analysis restricts the types to the finite domain of predefined types, i.e., the types defined by the user or in libraries, without generating new types. Another alternative is to use the normal analysis, i.e., creating new type definitions, but having only predefined types in the output. This is handled through the type_output flag.
Greater precision can be obtained evaluating builtins like is/2 abstractly: eterms includes a variant which allows evaluation of the types, which is governed by the type_eval flag.
Partial evaluation is performed during analysis when the local_control flag is set to other than off. Flag fixpoint must be set to di. Unfolding will take place while analyzing the program, therefore creating new patterns to analyze. The unfolding rule is governed by flag local_control (see transformation(codegen)).
For partial evaluation to take place, an analysis domain capable of tracking term structure should be used (e.g., eterms, pd, etc.). In particular:
Note that these two analyses will not infer useful information on the program. They are intended only to enable (classical) partial evaluation.
Size analysis yields functions which give bounds on the size of output data of procedures as a function of the size of the input data. The size can be expressed in various measures, e.g., term-size, term-depth, list-length, integer-value, etc.
Cost (steps) analysis yields functions which give bounds on the cost (expressed in the number of resolution steps) of procedures as a function of the size of their input data.
V is a value for a flag.
Outputs the current module preprocessing state to a file Output. The output format (which should be valid for the loaded program) is guessed from the file extension.
Outputs the current Module preprocessing state to a file named Module_opt.ext, where Module is the current module.
Reads the code of FileName and its preprocessing unit, and sets it as the current module.
Reads the code of the list of file names FileNameList (and their preprocessing units), and sets them as the current modules.
Returns on backtracking all available program transformation identifiers.
Performs transformation Trans on the current module.
Checks assertions w.r.t. analysis information.
Returns on backtracking all available analyses.
Analyzes the current module with Analysis.
Unfolding is performed continuously on the already unfolded clauses, until a condition for stopping the process is satisfied. This condition is stablished by the local control policy, governed by the local_control flag, as follows:
Only hom_emb guarantees termination. However, id and inst are more efficient, and terminating in many practical cases.
Parallelization is performed by considering goals the execution of which can be deemed as independent [HR95,GHM00] under certain conditions. Parallel expressions (possibly conditional) are built from such goals, in the following fashions:
Transformation is a valid transformation identifier.
Analysis is a valid analysis identifier.