The "embedded inference engine" for xps4xps
(The generic rule for xps4xps)

The 'rules' can be represented as objects; derived from a generic rule object. The data of the generic rule objects are a three-valued logical value and text strings, furthermore the methods are functions (comprising operators, logical functions and other computational methods). The derived rules have 'their own' value, which is calculated from some other rules and/or from some (properly communicated) external values.

The 'inference engine' functionality is hidden in the operator functions, which take logical variables or rules as arguments and they provide generic rules as result. In addition to performing the logical operation, these operator functions make 'history notes' about the actual state of the used arguments. When asking for reasoning the resulting value, this history string (preceded by the name and the actual value of the rule) is returned.

Note that two different evaluation modes can be set for the rules. In the 'complete' mode all logical variables and functions comprising the rules are evaluated, independently from the actual values the rules deliver. In 'shortcut' mode only those, from which the result of the rule can be doubtlessly evaluated. For example if the rule is 'A and B', and the value of A is false, the result of the logical expression will be false, independently of the value of B. Because of this, in shortcut mode B will not be evaluated at all. Since the variables and functions, which are not used actually for calculating the value of the rule, are redundant; leaving them away makes the evaluation shorter and quicker as well as the reasoning more clear. Because of this, the 'shortcut' mode is selected as default.