On Oct 17, 2008, at 11:23 AM, Henrique Lopes Cardoso wrote:


Thus, I guess that 'exists' does not stick to the first fact it can
find. Also, since pattern matching is evaluated after each working
memory update, Jess keeps track that 'exists' never stops being true
(there is always at least one foo fact, even when modifying the other one).

Are my thoughts correct?

Yes, that's right; there's always at least one foo in working memory, so the "exists" isn't re-activated.

exists doesn't have to search for foo facts. The best way to think about it is that all the foo facts are stored in a bucket, and exists just has to look whether the bucket is empty or not.



Cheers,

Henrique



Ernest Friedman-Hill wrote:
On Oct 17, 2008, at 9:06 AM, Henrique Lopes Cardoso wrote:


;---

The rule fires in both runs. Is this the intended behavior?


It's traditional behavior for Rete engines, yes.


Is there a
way to prevent the rule from firing in the second run?


Only by having the rule assert a fact indicating it's already fired,
and matching the negation of that fact on the LHS of the rule.



Henrique



--------------------------------------------------------------------
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
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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