This seems to be a bug in the code that is supposed to allow you to
redefine rules. This behaviour appears only in the 5.0 alphas. If you
use the (view) command after loading the batch file the second time,
you'll see only two of the rules appear, but if you use the (rules)
command, they'll all be listed. As soon as I figure it out, I'll have
an explanation and probably a patch.

I think Vera =?iso-8859-1?Q?L=FAcia?= da Silva wrote:
> 
> I have the following code:
> 
>  (deftemplate seres
>    (slot animal))
> 
> (defrule nao-mamifero
>    ?animal <- (animal tempena)
>    =>
>    (printout t "animal nao mamifero")
>    (assert (animal naomamifero)))
> 
> (defrule mamifero
>    ?animal <- (animal tempelo)
>    =>
>    (printout t "animal mamifero e nao ave")
>    (assert (animal mamifero))
>    (assert (animal naoave)))
> 
> (defrule ave
>    ?animal <- (animal naomamifero)
>    =>
>   (printout t "animal ave")
>    (assert (animal ave)))
> 
> (defrule startup "."
>    =>
>    (assert (animal tempena))
>    (assert (animal voa)))
> 
> (reset)
> (run)
> 
> The first time that I execute it usually works. However, when I try to
> execute for the second time it simply executes the rule (defrule startup
> "."  Please, can anybody tell me the one what I am doing wrong?
> 
> Jess> (batch ganimal.clp)                       - first time
> animal nao mamiferoanimal ave3            - it is ok!
> Jess> (run)
> 0
> Jess> (reset)
> TRUE
> Jess> (run)
> animal nao mamiferoanimal ave3                - it is ok.
> Jess> (reset)
> TRUE
> Jess> (facts)
> f-0   (initial-fact)
> For a total of 1 facts.
> Jess> (run)
> animal nao mamiferoanimal ave3                    - it is ok.
> Jess> (batch ganimal.clp)                               - second time
> 1
> Jess> (reset)
> TRUE
> Jess> (run)
> 1                                                - answers is only 1.
> Jess> (facts)
> f-0   (initial-fact)
> f-1   (animal tempena)
> f-2   (animal voa)
> For a total of 3 facts.
> Jess> (reset)
> TRUE
> Jess> (facts)
> f-0   (initial-fact)
> For a total of 1 facts.
> Jess> (run)
> 1                                                        - answers is
> only 1.
> 
> Thanks
> Vera
> 
> ---------------------------------------------------------------------
> 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  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [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