Re: JESS: Time-varying methods inside a and in a test

"Wolfgang Laun" <[email protected]> Tue, 19 Jul 2011 12:10:04 +0200
Newsgroups gmane.comp.java.jess
Message-ID <CANaj1LeNxPpymceZg3n7AQ4sTUVhY2h80THjwUGJuU--SOTNLQ@mail.gmail.com>
(and) does a short-circuited evaluation of its operands, but it is still a
single CE. Whether it returns false due to the first or second operand does
not matter: it'll have to be reevaluated over and over again.

Using two boolean functions in two different CEs may result in less
invocations of
these functions since a "true" result of the first CE is not lost.

Wolfgang

On 18 July 2011 17:00, Skeptic . <[email protected]> wrote:

>  Hi,
>
> Is there a good reason why a rule like this :
>
> (defrule r1
> [...]
> (test (and (time-varying call1) (time-varying call2))
> =>
> [...])
>
> behave differently than one like this :
>
> (defrule r1b
> [...]
> (test (time-varying call1))
> (test (time-varying call2))
> =>
> [...])
>
> Thanks !
>