I think ROSSEL, Olivier (CIMPA) wrote:

> I am using Jess with Protege.  I want to write a rule that says: run
> when you get an oject FOO with a non-empty slot called 'name' and
> where there is no fact foo with property bar equal to the slot
> value.  I would intuitively wirte that this way:

 (defrule doStuff "" 
  ?o <- (object (is-a FOO) (name ?name&~nil))
  (not (foo (bar ?name)))
 =>
 ...
 )
 
> Is it a correct syntax?

There were some extra close-parentheses, which I've removed. I also
added a "not nil" condition to meet the "non-empty" requirement,
assuming that nil is the default value for that slot. Other than
that's it's fine as far as I know -- whether it's actually correct or
not depends on the "object" and "foo" templates.


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