I think Young-Jin Lee wrote:
> 
> But even though I called "(run)" again, do-change-baby is not fired. It looks like 
>the RHS of do-change-baby seems to be extracted from the knowledge base. Is this 
>correct interpretation? 

No, not correct. A rule will only fire once for any given set of
unmodified facts. The rule do-change-baby won't fire again unless the
baby-is-wet fact is retracted and then re-asserted.


> Is there any way to look at the LHS and RHS of the rules in the knowledge base?
> 

(ppdefrule <rule-name>)

> These behavior is not what I expected. I think the rule should be
untouched and the fact caused firing the rule should be removed from
the knowledge base.

If you want the rule to remove the facts it fired on (and this is
indeed sometimes the case) then you have to retract the facts. This
rule certainly should retract the baby-is-wet fact, since the idea is
that it is making the baby dry, but it's just an example. If you were
really writing an automatic baby changing machine, you'd want to
retract that fact. 

But what if the rule was

(defrule wash-baby
  (baby)
  (bathwater)
  =>
  ...

Then if Jess were to retract these two facts automatically, you'd be
throwing the baby out with the bathwater (there'sa joke of some kind,
there). Clearly the baby fact should remain, as the baby will be used
by other rules!

> Is there any reason for this behavior or am I misunderstanding something a lot?
> 

You're misunderstanding something a lot :)

> What should I do, if I want the do-change-baby is always fired when there is the 
>fact, baby-is-wet is in the knowledge base?
> 

You don't. You want it to be fired once each time the baby is wet. You
should then remove that fact so the baby is dry.

> Is there any way to see how many functions are in the knowledge base? I can see the 
>rules and facts with (rules) and (facts) function call, but there is no (functions) 
>in Jess.
> 

(list-function$)

> Thanks in advance. Any comments would be of great help.
> 
> Young-Jin
> 



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