Mapping/Translating Core to Production Rules
This page is to discuss the mapping/translation of RIF-Core to the proposed RIF-PR (RIF for Production Rules). This content is per F2F6 agreed action# 315.
Possibly this page belongs under item 4 (under Core Compatibility in the TOC on the main Core page).
Assumptions for this discussion
"Core" refers to the definition of Core per the general RIF Core page
Also related is the list of functions and operators per the general RIF Core fns and ops page
Production rules refer to the definition of production rules per the PRR (proposed) standard - see the Related Work on the home page. In addition, PRR compatibility is a requirement on RIF.
- Most of the introductory material on this page should be transferred to the future page covering the PR RIF dialect...
Background on Production Rules (PR)
The OMG PRR definition states: Production Rule definition A production rule is a statement of programming logic that specifies the execution of one or more actions in the case that its conditions are satisfied. Production rules therefore have an operational semantic (formalizing state changes, e.g., on the basis of a state transition system formalism). The effect of executing production rules may depend on the ordering of the rules, irrespective of whether such ordering is defined by the rule execution mechanism or the ordered representation of the rules. The production rule is typically represented as: if [condition] then [action-list]
Production Rule Semantics
OMG PRR takes a "pragmatic approach" (ie based on industry practice rather than theory) to what semantics to use for PRR: it provides 2 versions:
The semantics of the Rete forward chaining algorithm, as (generally) implemented by most "business rule engines" available today (Fair Isaac Blaze Advisor, ILOG JRules, RedHat JBoss Rules, Sandia Labs JESS, TIBCO BusinessEvents (listed in alphabetical order).
- The semantics of a simple non-declarative rule "scripts": this is equivalent to many of the so-called "rules engines" attached to simple orchestration and process automation tools, and are really just a list of rules that are executed as if procedural code. Mapping non-inferencing rulesets to procedural code is a performance-enhancing feature for BRMS tools like Fair Isaac Blaze Advisor, ILOG JRules; indeed Fair Isaac Blaze Advisor for COBOL has no inference engine and maps rule statements to COBOL code...
The primary PR semantic being considered for RIF is i. above, although from a rule format perspective ii. should also be handled.
The PR semantics are quite complex, being typically based on the Rete high performance forward chaining algorithm; recommended reading would be the PRR Chair's snippet on his blog (PDF).
Comparison of PR to Core/Horn
Note: it is recommended to read the ASN06 representation from the core specification page rather than interpret the diagram.
- future action: provide side by side PRR and RIF OMG-type abstract syntax metamodels
Rule Conditions
We use the Core specification at http://www.w3.org/2005/rules/wg/wiki/Core/Specification. Comparing this with the PRR metamodel for rule conditions we see:
Condition Expressions |
RIF Core |
PRR Core mapping |
|
ForAll clause |
Implied by use of PRR:RuleVariable which indicates an iterator for rules over each combination of the class or set applied. |
|
Var delaration |
See PRR:RuleVariable declaration. |
|
Clause formula definition |
PRRCore maps this to a UML:OpaqueExpression. |
Rule Actions
TO BE CONTINUED ON 220607
- future action: check against formal PRR metamodel terminology;
- future action: add (the more interesting) Actions mapping;
(with apologies: I lost my edits for this section when my laptop crashed before I did a save. Lame, but true PV190607