Using relations as you propose might result in lots of redundant facts being around, and you'd never be quite sure whether some particular relation has already been established as facts. So, for the "uncle" relation, you'd need all the sibling relations, which, for n siblings requires n-1 (symmetric) relational facts. These would have to be derived from the "parent" relations, which have to be established as primary facts.
Consider an arbitrary graph. (A family tree is just a special case.) Would you establish facts beyond those defining the edges joining two nodes, e.g., (isTwoHopsDistant x y)? Check http://www.jessrules.com/jesswiki/view?FactsAsSlotValues for a possible solution to the family tree problem. -W 2009/3/30 Kartik Tadanki <[email protected]> > Hi, > > I think the best way to capture this would be : > > (deftemplate <relation>Of ( slot person ) ( slot relation) ): > states who is the <relation> of whom. > > A person need not then store the references to each relation. And also the > cardinality issues get evened out, i.e. it is easier to represent the fact > that > i have 2 brothers and 3 uncles . > > Also this way i think one would be able to further reason about the > relations themselves. > > > Kartik Tadanki. > NCSU. > > Wolfgang Laun wrote: > > If your Person-fact has a slot hasUncle, the what do you need a rule for? > And then, what do you do if a person has more than one brother? > > The clue is in the answer to this question: > Which relatives of a person are guaranteed to be singletons? > > -W > > On Mon, Mar 30, 2009 at 5:29 PM, The Boy <[email protected]> wrote: > >> >> Hello all, >> how I can define the equivalence of this rule ?x hasFather ?y ∧ ?y >> hasBrother ?z => ?x hasUncle ?z >> in Jess/CLIPS . I assume that ?x, ?y and ?z are instances of class Person; >> and class Person has 3 slots (hasBroher with type Instance,hasFather with >> type Instance ,hasUncle with type Instance) >> >> Thanks in advance. >> >> Joe_ >> -- >> View this message in context: >> http://www.nabble.com/define-Uncle-rule-tp22785792p22785792.html >> Sent from the Jess mailing list archive at Nabble.com. >> >> >> >> -------------------------------------------------------------------- >> 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] >> . >> -------------------------------------------------------------------- >> >> > >
