It is virtually always better to do all your tests on the LHSs of your
rules. For a rule with one one CE, like this one, it doesn't matter
much, but for a rule like

      (defrule good (A ?a&:(eq ?a nothing)) (B ?b) (C ?c) => ...)
      (defrule bad (A ?a) (B ?b) (C ?c) => (if (eq ?a nothing ) ...)

the difference can be huge. Making "good" faster than "bad" is, in fact,
the whole point of the Rete algorithm.

I think Christo Andonyadis wrote:
> 
> Which is better/faster:
> 
> (something ?s)
> =>
> (if (eq ?s nothing) then
>       (assert (somethingelse nothingatall))
> )
> 
> OR
> 
> (something ?s&:(eq ?s nothing))
> =>
> (assert (somethingelse nothingatall))
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. 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 9214                  [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. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to