I recall (vaguely) a discussion about adding a way to match a bound fact.
This would permit:

;; Warning! Not implemented?!

?ex <- (example)
(not ?ex <- (example (code $? n $?))) ; i.e., not exists same example with n in 
code

I guess it's a matter of taste whether this is more or less elegant
than using a predicate.


-----Original Message-----
From: [email protected] on behalf of Ernest Friedman-Hill
Sent: Fri 5/7/2010 2:09 AM
To: jess-users
Subject: Re: JESS: How to match a multislot which does not contain a given 
value?
 
Hi Adam,

There's no especially elegant way to do it. You can bind the whole  
multislot with a multifield, and then test it using the "member$"  
function:


(example (code $?m&:(not (member$ n $?m))))



On May 6, 2010, at 3:20 PM, Adam Malik wrote:

>
> how could Jess match a fact whose multislot doesn't contain a given  
> value?
> In the following example (code) is a multislot. I would like to do the
> opposite of that
>
> (example (code $? n $?))
>
> that is: find all (example)-facts whose (code)-multislot does not  
> contains
> "n".
>

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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