Modules, Inputs, and Outputs
Every CSL module has an associated set of input identifiers and an associated set of output identifiers. Some CSL modules return a boolean value. When the cost engine evaluates a CSL module, it does the following:
Establishes values for all the input identifiers. See Inputs for detailed information on inputs.
Imports any explicitly specified import modules, as well as certain CSL modules global to the current process group. See Imports for information on imports.
Evaluates the module’s rules and formulas. The flow of evaluation depends on the module’s type (see below). Formula evaluation establishes values for output identifiers. See Outputs for detailed information on outputs. Rule evaluation returns boolean values, and can cause the module to return a boolean. See Return Values for more information on return values.
Evaluates each formula in a set block. See Set Blocks for information on set blocks.
The following summarizes the flow of evaluation for formulas and rules:
For taxonomy and selection modules, the cost engine generally evaluates all the output formulas, that is, formulas whose left hand side is an output identifier. This establishes values for the output identifiers. Other formulas and rules are evaluated only if required for the evaluation of some output formula. See Formulas for more information on formula evaluation.
For modules that return true or false, rules are evaluated in the order in which they appear in the module. If a rule fails, rule evaluation terminates, and module evaluation returns false; if all the rules succeed, module evaluation returns true. Formulas are evaluated when required for rule evaluation. For feasibility modules, after rule evaluation terminates and before the module returns a value, the cost engine evaluates output formulas, if there are any. See Rules for more information on rules.
Note that an instance of any of these syntactic categories can span lines only through the use of line continuations (with certain exceptions)—see Comments and Line Continuation. Note also that CSL supports comments. See Comments and Line Continuation for more information.