On Mar 26, 2007, at 5:33 PM, ricktee wrote:

How can I compare the element of multislot machineA & machineB such that as
long as there is 1 that matches, return true.


(defrule combine-this
    ?m1 <- (machine-match (body-part $?partA) (machine $? ?m $?))
    ?m2 <- (machine-match (body-part $?partB) (machine $? ?m $?))
    (test (neq ?m1 ?m2))
    =>
    (printout t "station " ?m "works out both " $?partA " & "$?partB ))

"$?" matches 0 or more things. By using ?m in both multifields, we insist they have one item in common.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.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