The binding for some element ?x anywhere in a multislot is written like this (ms $? ?x $?) where $? matches "zero or more elments". Therefore,
(defrule check (person (name ?name) (friend $? ?fx $?)) (not (dislike ?x)) => (assert (allow ?name)) ) asserts (allow ?name) iff there is no disliked ?x in ?name's friend list. -W On Sat, Mar 7, 2009 at 8:57 PM, NehaP <[email protected]> wrote: > > To make it more clear, if my person template had two slots instead of a > multislot, > > (deftemplate person > (slot name) > (slot friend)) > > I would write the rule like this > > (defrule check > (person (name ?name) (friend ?friend)) > (not (dislike ?friend)) > => > (assert (allow ?name)) > ) > > However, my problem is that friend is a multislot and not a slot. So I > would > like to check if a fact exists for each member of the multislot friend. How > do I do this? > > Thanks, > Neha. > -- > View this message in context: > http://www.nabble.com/JESS%3A-Check-assertion-of-multi-slot-values-in-LHS-of-rule-tp22388880p22391255.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]. > -------------------------------------------------------------------- > >
