I think Andrew Reischer wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I have a little rule that keeps firing. I have an object with two slots. 
> I match one of them in the LHS. I set the other in the RHS though a 
> modify. Does the modify in the RHS change the object enough to trigger 
> the rule? 
> 

This is a fairly common concern; so common, in fact, that the next
major release of Jess will offer a specific way to avoid this
behavior.

For now, though, the trick is to modify the rule such that the LHS is
a little more specific, so the rule won't match if its already fired:

 (defrule accumulate_disease
   (disease (name ?dname))
   ?ac <- (parameter-stat (parameter-name  primary_disease)
                          (possible-values ?v))
   (test (neq -1 (?v indexOf  (str-cat "|" ?dname "|")))
   =>
   ...

This version of the rule will no longer match once an entry for ?dname
has been added.




---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

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