I think Carlos Pedrinaci wrote:
> 
> I would like to retrieve the value(s) of propertyA for which propertyB
> is _always_ TRUE. Moreover, I would like it to match just once per
> propertyA.

Human languages are very imprecise; I think there may be several ways
to interpret this statement, so forgive me if I haven't understood
properly.

This rule

(defrule attempt-1
  (MyBean (propertyA ?a) (propertyB TRUE))
  (not (MyBean (propertyA ?a) (propertyB FALSE)))
  (not (processed ?a))
  => 
  (do-whatever ?a)
  (assert (processed ?a)))

fires just once for each value of ?a such that at least one MyBean
exists with propertyA equal to ?a, and propertyB TRUE, and no
MyBeans exist with propertyA equal to ?a and propertyB FALSE. If 
MyBean has only these two properties, then the simpler

(defrule attempt-2
  (MyBean (propertyA ?a) (propertyB TRUE))
  (not (MyBean (propertyA ?a) (propertyB FALSE)))
  => 
  (do-whatever ?a))

does the same thing. 


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