Drools :: Core 6.0.0.Beta5

org.drools.core.rule
Class LogicTransformer

java.lang.Object
  extended by org.drools.core.rule.LogicTransformer

public class LogicTransformer
extends Object

LogicTransformation is reponsible for removing redundant nodes and move Or nodes upwards. This class does not turn Exists into two Nots at this stage, that role is delegated to the Builder.


Nested Class Summary
 class LogicTransformer.NotOrTransformation
          (Not (OR (A B) Not | or / \ a b (And ( Not (a) Exist (b)) ) And / \ Not Not | | a b
 
Constructor Summary
protected LogicTransformer()
           
 
Method Summary
protected  void fixClonedDeclarations(GroupElement and)
          During the logic transformation, we eventually clone CEs, specially patterns and corresponding declarations.
static LogicTransformer getInstance()
           
protected  void processTree(GroupElement ce)
          Traverses a Tree, during the process it transforms Or nodes moving the upwards and it removes duplicate logic statement, this does not include Not nodes.
protected  GroupElement[] splitOr(GroupElement cloned)
           
 GroupElement[] transform(GroupElement cloned)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicTransformer

protected LogicTransformer()
Method Detail

getInstance

public static LogicTransformer getInstance()

transform

public GroupElement[] transform(GroupElement cloned)
                         throws InvalidPatternException
Throws:
InvalidPatternException

splitOr

protected GroupElement[] splitOr(GroupElement cloned)

fixClonedDeclarations

protected void fixClonedDeclarations(GroupElement and)
During the logic transformation, we eventually clone CEs, specially patterns and corresponding declarations. So now we need to fix any references to cloned declarations.

Parameters:
and -

processTree

protected void processTree(GroupElement ce)
                    throws InvalidPatternException
Traverses a Tree, during the process it transforms Or nodes moving the upwards and it removes duplicate logic statement, this does not include Not nodes. Traversal involves three levels the graph for each iteration. The first level is the current node, this node will not be transformed, instead what we are interested in are the children of the current node (called the parent nodes) and the children of those parents (call the child nodes).

Parameters:
ce -
Throws:
InvalidPatternException

Drools :: Core 6.0.0.Beta5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.