I think Mark Egloff wrote:
> Hello there
> 
> My next question is, how can I check if a specific value is in a list?
> The list is part of a fact.
> 
> Example:
> 
> (assert(tariff (type A) (keys 22 33 44 55)))
> (assert(event (type A) (key 33)))
> 
> How do I check if the "key" slot from fact "event" is contained in the
> "keys" list of fact "tariff"?

In a rule, one way to do this is

(defrule find-key
   (event (type A) (key ?k))
   (tarriff (type A) (keys $? ?k $?))
   =>
   ...

This will fire only for matching pairs of facts.


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
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