Re: JESS: matching problem

2007-11-15 Thread sotski
Thank you , works fine! Regards Hans Jason Morris wrote: Yep, that works too, of course. And it is the preferred way of doing it. My bad. On Nov 14, 2007 1:23 PM, Robert Kirby [EMAIL PROTECTED] wrote: How about (defrule find_it2 (things (Id ?pId)(elements $? ?elementName $?))

JESS: matching problem

2007-11-14 Thread sotski
Hey all! I have a newbie question. I read the Answers to the matching in two multislots of two different templates post. I have very similiar problem but not the same ;-) I simplify the problem for you: ;;Templates: (deftemplate things (slot Id) (multislot elements)) (deftemplate

Re: JESS: matching problem

2007-11-14 Thread Jason Morris
Hi Hans, Try this solution: (clear) (watch all) (deftemplate things (slot Id) (multislot elements)) (deftemplate otherthing (slot one_Element)) (deffacts init (things (Id 1) (elements a b c)) (otherthing (one_Element a))) ;Get all Ids of things ;Where AElement of elements

Re: JESS: matching problem

2007-11-14 Thread Wolfgang Laun
Or this one which is subtly different: (deftemplate things (slot Id) (multislot elements)) (deftemplate otherthing (slot one_Element)) (defrule FindIt ?ot - (otherthing (one_Element ?el )) ?th - (things (Id ?Id) (elements $? ?el $?)) = (printout t found ?el in ?Id crlf) ) (deffacts

Re: JESS: matching problem

2007-11-14 Thread Robert Kirby
How about (defrule find_it2 (things (Id ?pId)(elements $? ?elementName $?)) (otherthing (one_Element ?elementName)) = (printout t found it: ?pId crlf)) which is described at the end of 6.4. Matching in Multislots http://herzberg.ca.sandia.gov/jess/docs/70/rules.html#multimatch? Bob

Re: JESS: matching problem

2007-11-14 Thread Jason Morris
Yep, that works too, of course. And it is the preferred way of doing it. My bad. On Nov 14, 2007 1:23 PM, Robert Kirby [EMAIL PROTECTED] wrote: How about (defrule find_it2 (things (Id ?pId)(elements $? ?elementName $?)) (otherthing (one_Element ?elementName)) = (printout t