_1.5a and _1.5b mean the same thing, but _1.5a will be more
efficient. In general, function calls will have more overhead
than direct pattern matching.

_1.5 actually has a different meaning. Whereas the second two rules
match each e5crt fact where the field is not 0, 1, or 8, the first
rule matches the absence of any e5crt facts with the field equal to 0,
1, or 8. The first rule will then be activated no more than once
simultaneously, while the other two can each be activated multiple
times, once for each matching fact.


I think Jerry Hoe wrote:
> Hi again,
> 
> The rules below produce the same effect. I can't decide which one to use.
> So, can someone please points out the pros and cons of each rule? What
> is the rule of thumb when resolving such situations? Thanks in appreciation.
> 
> (defrule _1.5
>   (not(e5crt ?val&:(= ?val 0)|:(= ?val 1)|:(= ?val 8)))
>   =>
>   (assert (result .)))
> 
> (defrule _1.5a
>   (e5crt  ?val&~0&~1&~8)
>   =>
>   (assert (result .)))
> 
> (defrule _1.5b
>   (e5crt ?val&:(<> ?val 0)&:(<> ?val 1)&:(<> ?val 8))
>   =>
>   (assert (result .)))
> 
> --
> Regards,
> Jerry
> 
> ---------------------------------------------------------------------
> 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