choco.kernel.model.constraints.cnf
Class ALogicTree

java.lang.Object
  extended by choco.kernel.model.constraints.cnf.ALogicTree
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Literal, Node, Singleton

public abstract class ALogicTree
extends Object
implements Cloneable


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

Nested Class Summary
static class ALogicTree.Operator
           
static class ALogicTree.Type
           
 
Constructor Summary
protected ALogicTree(ALogicTree.Type type)
           
 
Method Summary
 ALogicTree clone()
           
abstract  IntegerVariable[] flattenBoolVar()
          Extracts and returns the flatten array of BoolVar contained in this.
abstract  ALogicTree[] getChildren()
          Returns the array of children of this.
abstract  int getNbPositiveLiterals()
          Computes and returns the number of positive literals contained in the direct level.
abstract  boolean is(ALogicTree.Operator op)
          Current tree is rooted with the logical operator op
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALogicTree

protected ALogicTree(ALogicTree.Type type)
Method Detail

is

public abstract boolean is(ALogicTree.Operator op)
Current tree is rooted with the logical operator op

Parameters:
op - operator checked
Returns:
true if this is op

getChildren

public abstract ALogicTree[] getChildren()
Returns the array of children of this. null is a valid return value.

Returns:
an array of logic trees, null otherwise

clone

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

flattenBoolVar

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

Returns:
array of bool variables

getNbPositiveLiterals

public abstract int getNbPositiveLiterals()
Computes and returns the number of positive literals contained in the direct level.

Returns:
number of positive literals


Copyright © 2012. All Rights Reserved.