Good day!

So sorry for asking so much questions, my understanding is pretty limited.
I'm trying to compare the elements of 2 multislots but does not know how. I
have tried using (foreach element of list) but I don't think it works in
rules.

I have 3 "machine-match" facts and 1 rule as shown below.

***************************************************************************************
         (deftemplate machine-match
                (slot ident)
                (multislot body-part)
                (multislot machine)     );;close

         (deffacts create-facts-data 
         (machine-match (ident match)   (body-part arms)        (machine X9 N6 
X8))     
         (machine-match  (ident match)  (body-part abs)         (machine Q4 N6 
Q9))
         (machine-match  (ident match)  (body-part butt)        (machine ZZ CC 
II))
);;close


         (defrule combine-this
          ?matchA <-    (machine-match  (body-part $?partA)     (machine 
$?machA))
          ?matchB <-    (machine-match  (body-part $?partB)     (machine 
$?machB))

          (test         (member$ $?machA $?machB))
           (test (not   (member$ $?partA $?partB)))
            =>
            (printout t "station " $?machA "works out both " $?partA " & "
$?partB ))

**************************************************************************************

I hope to print it out as >>
station N6 works out both arms  & abs 
How can I compare the element of multislot machineA & machineB such that as
long as there is 1 that matches, return true.

thank you so much again
rick

-- 
View this message in context: 
http://www.nabble.com/How-to-compare-the-elements-of-2-lists-tf3469729.html#a9682185
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]
--------------------------------------------------------------------

Reply via email to