Response to WL

> The W3C RIF Working Group has achieved a remarkable goal: no less than the
> definition of a coherent set of languages for abstract rule notation and
> interchange. Built around a Basic Logic Dialect and a set of data types
> similar to what we have in XML schema, the framework promises the capability
> to be adapted to rule languages that are (by design) not fully covered by
> BLD.

Thanks. Achieving some coherence between BLD and PRD required that we make the overlap (Core) as large as possible. This biased us to emphasize the logical aspects of PRD and de-emphasize (for PRD 1.0) the non-logical aspects. This bias is evident in the responses to some of your detailed comments below.

> Current work has me interested in Production Rule systems, which are
> addressed by the Group's RIF-PRD document with its very ambitious goal to
> add action parts to (purely descriptive) BLD rules and, notably, an abstract
> execution model for forward chaining rule engines. (What I miss in RIF-PRD
> is a statement similar to the one found in RIF-BLD, where is says that "the
> design clearly indicates a decision to avoid solving the (probably
> impossible) problem of rule interchange in general". Clearly, this "probable
> impossibility" is much more probable in the realm of full-blown PR systems.)

You are correct. The initial focus is on a limited subset of full-blown PR systems, and we will editorialize accordingly in the next revision of the spec.

> However, it is important to note that the basic definitions are here, for
> Actions and a PR Engine, with an abstract algorithm defining the state
> transition typical for such systems. A basic Conflict Resolution is defined
> in terms of Refraction, Priority and Recency, as implemented in real-word
> systems. (Here, another comment on more or less essential - from a pragmatic
> point of view - features must be made. Isn't switching between rule groups
> important?

Yes, and PRD supports this in a static way by allowing a priority to be attached to a rule group.
Some PR systems support more dynamic notions such as rule flow, dynamic priorities, module stacks, and so forth.
This was deemed out of scope for PRD 1.0.

> How can one express the "no-loop" feature for upholding
> refraction in spite of an update of a contributing fact in the rule's action
> part?)

Although this feature appears in several rule engines, we could not find a clear common semantic description (in terms of our model). Some systems interpret no-loop to mean that a rule may only fire once, others that at most 1 instance of a rule may be active at a time, others that a rule instance's actions may not directly re-instantiate the same rule, etc.

> A minor point is the absence of globals, i.e., variables with visibility in
> all action parts. This is a common convenience feature that permits you to
> implement general actions.

We know that many PR languages include many features of procedural programming languages, such as global variables, loops, etc.
This was considered out of scope, given the bias toward overlap with logical rule languages.

> More specifically, in reference to the "running example", there are several
> points that appear unusual when compared with some existing real-world
> systems.
>
> - Example 3.3 illustrates "assert" and "retract" actions, showing that
> they operate on "ground atomic formulas", representing what implementations
> usually have as fields or attributes of a record or objects, and where they
> would require a "modify" operation on the containing entity.

PRD uses frames to approximate objects. Frames have a logical semantics and typical objects (like java.lang.Object) do not.
Use of frames allows much greater overlap between PRD and BLD. (Frames also allow interoperation with the semantic web.) Unfortunately, frames are only an approximation to the typical objects in real world PR systems. We are aware of this problem but have no solution yet. PRD does define a modify action (also shown in Example 3.3) whose intent is to better approximate typical object semantics (but of course, at the expense of interoperability with BLD).

> - Rules that require binding of facts to variables to be used in the
> action part have to be represented by "Forall ?var such that ...", where the
> natural domain of the ?var, i.e., all facts of some class, is defined by a
> term (?var # class) of the following condition. Forall is also used where a
> condition's term will match at most once. While this is (FOP-)technically
> correct, it seems to make the addition of a "forall" pattern where the range
> is defined by a condition impossible? (Cf. "forall" in Jess or Drools.)

In PRD, the "such that ..." is syntactic sugar. I.e.,
Forall ?var such that <cond1> if <cond2> then ... is equivalent to
Forall ?var If And(<cond1> <cond2>) then ... This gives compatibility with BLD. A forall pattern in Drools such as
If forall(Bus(color=="red")) then ... (as I understand the semantics) would be translated to PRD as
If Not(Exists ?bus And(?bus#Bus Not(?bus[color->"red"]))) then ...
Finally, note that the Jess forall CE is somewhat different from Drools but can also be translated to PRD.

> - Similarly, Exists must apparently be used to introduce variables to be
> bound to facts, for matching arbitrary values. Again, the "exists" (as in
> Jess or Drools) appears to be barred (but this can still be expressed using
> double negation).

No, the meaning of Exists in PRD and typical PR languages should be quite close. E.g. the Drools rule
If exists(Bus(color=="red")) then ... can be translated to PRD as
If Exists ?bus And(?bus#Bus ?bus[color->"red"]) then ...

> It is surprising that the notation does not include any (explicit)
> definition of fact classes. While much of the structure is implied by the
> terms in the rules (e.g., ?customer[ex1:status->",,,"]) there seems to be no
> way to express class hierarchies, let alone projections (such as Java's
> interfaces).

Frames support the notion of subclass (##). E.g. if we are given that Bus##Vehicle and Car##Vehicle then a rule such as
Forall ?v If ?v#Vehicle Then ... will match all Cars and Buses.

> It seems that RIF-PRD is capable to express subsets of the semantic features
> of existing systems. But it remains to be seen whether non-trivial
> applications can be interchanged between different PR systems.

We agree, and we hope that you and others will build RIF translators to help us validate the design.

Please acknowledge receipt of this email to <mailto:public-rif-comments@w3.org> (replying to this email should suffice). In your acknowledgment please let us know whether or not you are satisfied with the working group's response to your comment.