Hello,
 
Thanks a lot for your quick answer Dr. Friedman. So far, it is amazing to see the kind of support that you provide to beginners.
 
Thanks for your suggestion Aby. I completely forgot (watch all) function.
 
Regards,
 
Nicolas
 
 
----- Original Message -----
From: Aby
Sent: Wednesday, September 08, 2004 2:50 AM
Subject: Re: JESS: Come back to : Add new values to multislot

Hello Nicolas,
 
I was the one who asked the 'basic question'. I guess you are also a new JESS user.
I found turning watch function on using (watch all) function, while learning JESS is very useful. If 'watch' was on, you would have seen the rule being fired repeatedly, instead of seeing the blinking cursor. 'Watch' also displays lots of information and that will shed some lights on how the engine work.
 
Just an observation!
 
thanks
Aby

[EMAIL PROTECTED] wrote:
I think Nicolas Fortin wrote:

> But Jess complains because (alphalist (alphalist $?c)) is not true. So I changed the rule for :
>
> (defrule modify-slot
> ?f <- (alphalist (alpha $?c))
> =>
> (modify ?f (alpha (create$ ?c d e f))))
>
> However when I type (run), I get no response, the cursor is still blinking, and even after a long delay, Jess never prompts again. What is wrong with this rule ?
>

A rule like this that matches a fact, then modifies it such that the
fact still matches, leads to an infinite loop: the rule just keeps
firing and firing (although in this particular case if you wait long
enough, the multislot will grow so long Java will run out of memory.)

You have to change the rule so that it doesn't match after the modify
is done; for example

(defrule modify-slot?f <- (alphalist (alpha $?c&:(not (member$ d ?c))))
=>
(modify ?f (alpha (create$ ?c d e f))))

Charlemagne has a special "no-loop" declaration that prevents this
kind of self-activation from happening.


---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software 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]
--------------------------------------------------------------------

Yahoo! Mobile
- Download the latest ringtones, games, and more!

Reply via email to