This is an archive of an inactive wiki and cannot be modified.

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


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:

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:

  1. 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).

  2. 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.

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.
Note that the execution semantics are not, however, a simple "for each X do Y"

Var delaration
multiple contained in ForAll

See PRR:RuleVariable declaration.
In PRR this can also be declared at the ruleset level to avoid unnecessary repetition of term definitions per rule.

Clause formula definition
multiple contained in ForAll

PRRCore maps this to a UML:OpaqueExpression.
(Non-normative*1 PRROCL maps this to a variant of OCL extended for actions)

Rule Actions

TO BE CONTINUED ON 220607

(with apologies: I lost my edits for this section when my laptop crashed before I did a save. Lame, but true :) PV190607