Hi again, heres the deal, your program is running x times, because you
always have the facts in your knowledge database, after you run the
rule.

> (assert (Person (Name Bart)(Ancestors (create$ (assert (Person (Name
> Tom)(Title Mr))) (assert (Person (Name John)(Title Mr)))(assert (Person
> (Name Jane)(Title Mrs)))))))
> 
> (defrule changeAncestorJohnTitle
> "Need to change Bart's ancestor John title to Dr"
> ?bart<- (Person (Name Bart)(Ancestors $?ancestors))
> ?index<-(member$ ?p ?ancestors&:(?p (Person (Name John))))
> ?john<- (nth$ ?index ?ancestors)
> =>
> (printout t ?john crlf)
> (printout t ?ancestors crlf))
> 

Try changing to this:


...
=>
(retract ?bart)
...


This will erase that fact so the rule wont run over and over again.

Regards
Joco Jorge

5: Ano. Eng. Informatica
IPS / EST

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