in that particular example, in the one rule it is moot as only one condition has to be false.
But that is an interesting optimisation - for normal declarative rules - we would have to tell the engine that one condition implies the other. I am not sure if there are any existing optimisations that provide this without asking for more information from the rule author (which would be a bit error prone). Go ahead and do a Proof of concept if you think it would help prove or disprove. Michael. On 12/6/05, 王在祥 <[EMAIL PROTECTED]> wrote: > > I am a newer to drools, and i find that drools dont optimize the following > case: > > <rule1> > <condition>f.a == "this"</condition> > </rule> > > <rule2> > <condition>f.a == "that"</condition> > </rule> > > in my understand, if rule1.condition f.a == "this" is true, then > rule2.condition will be false and without a evaluation. > > Maybe we should add some support to the org.drools.spi.Condition two > methods: > 1. boolean implies(Condition other) return true if this condition implies > other condition, so when this condition eval to true, then the other will > be > true > 2. boolean impliesNot(Condition other) return true if this condition > implies > not the other condition, so when this condition eval to true, the other > will > be false. > > also optimize the rateoo engine to avoid evaluate conditional based on > these > methods. > > Do you think so? > >
