Both rules will be "activated," or placed on the agenda, ready for firing. Then one of them will fire first. It's hard to predict which one, since their LHS are identical. Jess doesn't "pick one randomly," but one will naturally be placed first on the agenda. When that rule fires, it retracts the two facts that activated it. This will result in the second rule be deactivated and removed from the agenda.
I think Francisco Dario wrote: > Hello, > I have the following question: > Supose I have the following rules > > (defrule r1 > ?f1 <- (a ?n1) > ?f2 <- (b ?n2) > => > (assert (c (+ ?n1 ?n2))) > (retract ?f1) > (retract ?f2)) > > > and another rule > > (defrule r2 > ?f1 <- (a ?n1) > ?f2 <- (b ?n2) > => > (assert (c (- ?n1 ?n2))) > (retract ?f1) > (retract ?f2)) > > > What should be the behavior of JESS when I assert the facts > (a 4) and (a 6) for instance? > These two facts satisfy the antecedents of the two rules, but when the first > one is fired it retracts the facts which would be used for the second rule, > isn't it? Thus, is the second rule fired? Jess chooses randomly the first > rule to fire? > > Thanx. > Dario > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > --------------------------------------------------------- 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] --------------------------------------------------------------------
