Mark,

I solved the unbalanced trees problems we were talking about. I will summarize the solutions bellow.

Unbalanced logical branches show up when we have a rule like this:

A and (B or (C and D) ) and E

In the above case, after transformation we will end up with 2 unbalanced logical branches:

A and B and C
A and C and D and E

So, in the first branch will work with a tuple [A, B, E] and the second will work with a tuple [A, C, D, E].

We end up with 2 problems:

a) first problem is that E column may have different attributes in each logical branch (and in fact it has), so during the logic transformation I'm now cloning columns when they are required in more than one branch.

b) second problem is that if someone binds the E element and uses it in the consequence, we need to know that it has different positions in each logical branch. The solution for this was to make each terminal node to hold a reference to the subrule (logical branch) it belongs to. This way, when activating the consequence, the knowledge helper will resolve the variable using the subrule attached to the terminal node that caused the activation.

   I added test cases and it is all working fine.

   []s
   Edson

--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com


_______________________________________________
rules-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to