Hi, I have template called Person which has a multislot called Ancestors. I've inserted a fact of type Person called Bart who has 3 ancestors (Tom,John,Jane). Basically I need to change the ancestor 'John' title. I wrote the rule below but I can't get it to fire.
(deftemplate Person (slot Name (type STRING)) (slot Title (type STRING)) (multislot Ancestors) ) (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)) any help is appreciated thanks -------------------------------------------------------------------- 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] --------------------------------------------------------------------
