choco.kernel.model.constraints.cnf
Class Node

java.lang.Object
  extended by choco.kernel.model.constraints.cnf.ALogicTree
      extended by choco.kernel.model.constraints.cnf.Node
All Implemented Interfaces:
Cloneable

public final class Node
extends ALogicTree


Since:
21/12/10
Author:
Charles Prud'homme

Nested Class Summary
 
Nested classes/interfaces inherited from class choco.kernel.model.constraints.cnf.ALogicTree
ALogicTree.Operator, ALogicTree.Type
 
Constructor Summary
protected Node(ALogicTree.Operator operator, ALogicTree.Type type, ALogicTree... children)
           
 
Method Summary
static Node and(ALogicTree... children)
           
 Node clone()
           
 IntegerVariable[] flattenBoolVar()
          Extracts and returns the flatten array of BoolVar contained in this.
 ALogicTree[] getChildren()
          Returns the array of children of this.
 int getNbPositiveLiterals()
          Computes and returns the number of positive literals contained in the direct level.
static Node ifOnlyIf(ALogicTree a, ALogicTree b)
           
static Node ifThenElse(ALogicTree a, ALogicTree b, ALogicTree c)
           
static Node implies(ALogicTree a, ALogicTree b)
           
 boolean is(ALogicTree.Operator op)
          Current tree is rooted with the logical operator op
static Node nand(ALogicTree... children)
           
static Node nor(ALogicTree... children)
           
static Node or(ALogicTree... children)
           
static Node reified(Literal b, ALogicTree tree)
           
 String toString()
           
static Node xor(ALogicTree a, ALogicTree b)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

protected Node(ALogicTree.Operator operator,
               ALogicTree.Type type,
               ALogicTree... children)
Method Detail

and

public static Node and(ALogicTree... children)

ifOnlyIf

public static Node ifOnlyIf(ALogicTree a,
                            ALogicTree b)

reified

public static Node reified(Literal b,
                           ALogicTree tree)

ifThenElse

public static Node ifThenElse(ALogicTree a,
                              ALogicTree b,
                              ALogicTree c)

implies

public static Node implies(ALogicTree a,
                           ALogicTree b)

or

public static Node or(ALogicTree... children)

nand

public static Node nand(ALogicTree... children)

nor

public static Node nor(ALogicTree... children)

xor

public static Node xor(ALogicTree a,
                       ALogicTree b)

is

public boolean is(ALogicTree.Operator op)
Description copied from class: ALogicTree
Current tree is rooted with the logical operator op

Specified by:
is in class ALogicTree
Parameters:
op - operator checked
Returns:
true if this is op

getChildren

public ALogicTree[] getChildren()
Description copied from class: ALogicTree
Returns the array of children of this. null is a valid return value.

Specified by:
getChildren in class ALogicTree
Returns:
an array of logic trees, null otherwise

toString

public String toString()
Overrides:
toString in class Object

clone

public Node clone()
           throws CloneNotSupportedException
Overrides:
clone in class ALogicTree
Throws:
CloneNotSupportedException

flattenBoolVar

public IntegerVariable[] flattenBoolVar()
Description copied from class: ALogicTree
Extracts and returns the flatten array of BoolVar contained in this. WARNING : a variable may appear more than once, redundancy is not checked!

Specified by:
flattenBoolVar in class ALogicTree
Returns:
array of bool variables

getNbPositiveLiterals

public int getNbPositiveLiterals()
Description copied from class: ALogicTree
Computes and returns the number of positive literals contained in the direct level.

Specified by:
getNbPositiveLiterals in class ALogicTree
Returns:
number of positive literals


Copyright © 2012. All Rights Reserved.