[RIF]: On production rules and phase I&II --> PR and recursion

Sorry - I forget why "recursion" is being discussed here at all... Is
this a requirement for some rule languages?

 

Production rules (as Hassan mentioned) are not invoked by name so cannot
recurse (ie they cannot "call" themselves). However, PRs can certainly
be invoked more than once, for different data.

 

For example: consider fwd-chaining PR using Rete semantics:

 

If 

A is a human 

B is a human where B is a memberOf A.ancestorList 

C is a human where C.parent = A 

Then

C.ancestorList.append( A)

 

[Implementation notes:

- A, B, C are rule variables. A Rete engine will construct a rule
instance per binding of each tuple of {A, B, C} that satisfy the rule
condition

- assumes some collection function in the rule action

- this is not an efficient way of obtaining ancestor lists: it would be
rare for a production rule engine to be used in this manner]

 

This rule does not recurse, but for the known humans (or some other
specified typed object) it will create the necessary ancestors. Note
that this is an "action" - some process which needs to create ancestor
lists - rather than knowledge or logic.

 

Paul Vincent

Fair Isaac Blaze Advisor --- Business Rule Management

OMG PRR and W3C RIF for rule standards

 

 

-----Original Message-----
From: public-rif-wg-request@w3.org [mailto:public-rif-wg-request@w3.org]
On Behalf Of Peter F. Patel-Schneider
Sent: Wednesday, March 08, 2006 4:28 PM
To: bry@ifi.lmu.de
Cc: public-rif-wg@w3.org
Subject: Re: On production rules and phase I&II

 

 

From: Francois Bry <bry@ifi.lmu.de>

Subject: Re: On production rules and phase I&II

Date: Wed, 08 Mar 2006 17:18:40 +0100

 

> Dear Peter,

> 

> We are in a non-terminating loop because the argument Hassan gave does

> not seem to reach you - and you answers do not reach Hassan and me.

> 

> Hassan's point was, as I understand it, that in the production rules
you

> give below, there is nothing like a procedure or function call and

> therefore no recursion. Is this tentative explaination helping?

> 

> Regards,

> 

> Francois

 

Not one tiny little bit.

 

Rule sets don't have procedure or function calls.  However, some rules
are

called "recursive", for example the second rule below:

 

      ancestor(A, B) :- parent(A, B).

      ancestor(A, B) :- parent(A, X), ancestor(X, B).

 

(See, for example,

http://en.wikibooks.org/wiki/Programming:Prolog_Recursive_Rules for more
about

recursive rules.)

 

Given that the example above contains a recursive rule, then I see every
reason

to state that the pure production rule set

 

      (p (parent ^parent <x> ^child <y>)

         -->

         (make ancestor ^ancestor <x> ^descendant <y>))

 

      (p (parent ^parent <x> ^child <y>)

         (ancestor ^ancestor <y> ^descendant <z>)

         -->

         (make ancestor ^ancestor <x> ^descendant <z>))

 

also contains a recursive rule.

 

Peter F. Patel-Schneider

 

Received on Wednesday, 8 March 2006 19:52:03 UTC