On Feb 27, 2007, at 1:54 PM, fan yang wrote:


The following Prolog rules will identify direct or indirect inheritance:
ancestor (X, Y) :- inheritsFrom (Y, X).
ancestor (X, Y) :- inheritsFrom (Z, X), ancestor (Z, Y).

I want to do the exact same thing in Jess, but I don't know how to do
it. For my understanding, first, Jess rule dosen't support parameter
in its rule definition, seceond ancestor rule wokrs in recursive
manner, from jess manual, i didn't find recursive support, would you
please help me through it.


Jess is primarily a forward-chaining system, with some support for a form of backward chaining. Prolog is a backward-chaining system. So the way that rules are written -- and even the definition of what a rule is -- is rather different.

Rete-based forward chaining systems like Jess operate under the "closed world assumption", meaning that the implicit assumption is made that all true statements are represented by a "fact" in the working memory. Jess's backward chaining can be used to loosen this restriction in the sense that it can create new facts based solely on the logical requirements of existing rules. Look, for example, at the "factorial backward chaining" example in the manual. To implement something like the rules above, you'd have a rule to express the ancestor relationsip, and then a backward chaining rule to find intermediate steps and assert facts into working memory to represent them.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to