[rules-users] Question about Rete Tree example with NotNode in "Drools JBoss Rules 5.0 Developers Guide"

Edson Tirelli tirelli at post.com
Tue Oct 26 22:57:59 EDT 2010


    Hi Tina,

    I don't have the book in front of me, but I need to tell you: you
better be prepared to get your hands dirty! ;)

    This example shows you a not() with 2 "and'ed" nested patterns
inside. To resolve that, classic Rete requires the use of a
"subnetwork". That is why your LIAN in step 1 has two outgoing
connections. To understand subnetworks, I suggest you take a look at
Robert Doorenbos' thesis "Production Matching for Large Learning
Systems", chapter 2.8: "Conjunctive Negations". The explanation there
is probably better than any explanation I could give you.

    Let me know after you read that if you have any further questions
and we can try to clarify.

    Edson



2010/10/26 Tina Vießmann <tviessmann at stud.hs-bremen.de>:
> Hi,
>
> I'm working through the explanations about Rete Trees in chapter 12 of
> "Drools JBoss Rules 5.0 Developers Guide" on page 264-265. I have a
> problem in understanding the input of the NotNode.
>
> The rule says:
>     when
>       $address : Address ( addressLine == "Rossa Avenue" )
>       not (
>         $account : Account ( balance < 100 ) and
>         Customer ( accounts contains $account )
>       )
>     then
>        ...
>
> The related figure shows:
> 1. The Address object being processed and a tuple will be created by a
> LeftInputAdapterNode.
> 2. The tuple of 1. will be joined with the Account fact with no
> constraints (so that there's a tuple of size two?).
> 3. The tuple of 2. will be joined with the Customer fact with the
> restriction 'accounts contains $account'. (That results in a tuple with
> size 3!?)
> 4. The tuple of 3. will then be processed by a RightInputAdapterNode.
> 5. The tuple/fact from 3. will be processed using a NotNode together
> with the Address-tuple from 1.
>
> I don't understand while the tuple from 1. will in step 2 be joined with
> the Account fact. I would have expected something like:
> 1. // same
> 2. The Account fact will be processed and a tuple will be created by a
> LeftInputAdapterNode.
> 3. The Customer fact will be joined with the Account tuple with the
> constraint 'accounts contains $address'. Resulting in a tuple.
> 4. // somehow the tuple from step 3 will be negated and joined with the
> tuple from step 1.
>
> Could anybody explain to me why it's done the way its drawn in the book?
>
> Thank you! :)
> Tina
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com




More information about the rules-users mailing list