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