Thanks - this is a very succinct demonstration of a bug I suspected
might still be in there. Here's a workaround. Add the following method
to jess/NodeNot2.java:

  boolean callNode(Token token, int callType) throws JessException
  {
    if ((token.m_tag == RU.ADD || token.m_tag == RU.UPDATE) && callType  == LEFT)
      token = new Token(token);

    return super.callNode(token, callType);
  }



I think Vadim Zaliva wrote:
> 
> I have following rules:
> 
> (watch all)
> 
> (defrule r
>   (declare (salience 1))
>   (not (p ?))
>   =>
>   (printout t "r" crlf))
> 
> (defrule r1 
>   (declare (salience -1))
>   (not (p ?))
>   =>
>   (printout t "r1" crlf))
> 
> (defrule r2
>   (declare (salience -2))
>   (not (p ?))
>   =>
>   (printout t "r2" crlf))
> 
> 
> (reset)
> (assert (p 1))
> (run)
> (retract 1)
> 
> When I run it, I got:
> 
> Jess, the Java Expert System Shell
> Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
> Jess Version 5.0a6 7/7/99
> 
> null
> null
> null
>  ==> f-0 (initial-fact)
> ==> Activation: r :  f-0,
> ==> Activation: r1 :  f-0,
> ==> Activation: r2 :  f-0,
>  ==> f-1 (p 1)
> <== Activation: r :  f-0,
> <== Activation: r1 :  f-0,
> <== Activation: r2 :  f-0,
>  <== f-1 (p 1)
> ==> Activation: r2 :  f-0,
> 
> My question is, why upon retraction of 'p' fact,
> only r2 rule is fired, not r1 and r?
> 
> Vadim
> 
> -- 
> ;;-----------------------------------+-----------------------------------+
> ;; [EMAIL PROTECTED]      + Those who do not understand Unix  +
> ;; Project Manager, Matranet Inc.    + are condemned to reinvent it,     +
> ;; http://www.matranet.com/          + poorly.          (H. Spencer)     +
> ;;-----------------------------------+-----------------------------------+
> 
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
> 
> 


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

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