On Mar 6, 2007, at 8:20 AM, M Ismail wrote:
and i want to define a rule like the following:
(defrule fight-rule-8
(if r_object == r_relation)
=>
(assert (update-control 25))


Old syntax (any version of Jess:)

(defrule fight-rule-8
    (relation (r_object ?obj) (r_relation ?obj))
    =>
    (assert ...

New syntax (Jess 7 or later:)

(defrule fight-rule-8
    (relation {r_object == r_relation})
    =>
    (assert ...

Note that the rule "same-first-and-last-name" in section 6.2 of the Jess 7 manual, "Simple Patterns", does exactly what you need. Have a look.

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