This isn't a trivial question, but the answer is still simple:
basically, yes.

Jess's rule language is not the predicate calculus, and rules are
declarative and active. The "=>" ("implies") of predicate calculus is
an entirely different thing than the "=>" of Jess, which is best read
as "then". Jess rules are like active if-then statements -- if X, then
-do- Y. If you need rules to enforce logical statements, then yes, the
only way to do it is as you've shown here.


I think Francois Keegan wrote:
> Hello,
> I'm sorry if the question is trivial, maybe I've miss
> something in the manual..
> I wonder how to write something like:
> 
> P(x) => not A(x)
> 
> in jess. The only (tricky) way I found is:
> 
> (defrule r
> (declare (salience MAX_VALUE))
> (P ?x)
> ?f <- (A ?x)
> =>
> (retract ?f)
> )
> 
> An what about:
> P(x) => A(x) or B(x)
> 
> do I have to write two rules?:
> (defrule r1
> P(x)
> (not (A ?x))
> =>
> (assert (B ?x))
> )
> 
> (defrule r2
> P(x)
> (not (B ?x))
> =>
> (assert (A ?x))
> )
> 
> Am I wrong if I say:
> the LHS can contain everything (neg, and or)
> and the RHS must contain
> a conjunction?
> 
> thankfully,
>        Francois
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]
> ---------------------------------------------------------------------
> 



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

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