|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.model.constraints.cnf.ALogicTree
choco.kernel.model.constraints.cnf.Literal
public final class Literal
Nested Class Summary |
---|
Nested classes/interfaces inherited from class choco.kernel.model.constraints.cnf.ALogicTree |
---|
ALogicTree.Operator, ALogicTree.Type |
Constructor Summary | |
---|---|
protected |
Literal(IntegerVariable var,
ALogicTree.Type type)
|
Method Summary | |
---|---|
void |
addChild(ALogicTree child)
Adds child to the current list of children of this |
Literal |
clone()
|
int |
compareTo(Literal o)
|
IntegerVariable[] |
flattenBoolVar()
Extracts and returns the flatten array of BoolVar contained in this . |
ALogicTree |
getAndChild()
Returns the first AND logic tree within the list of children. |
ALogicTree |
getChildBut(ALogicTree child)
Returns the first child within the list of children, different from child . |
ALogicTree[] |
getChildren()
Returns the array of children of this . |
int |
getNbPositiveLiterals()
Computes and returns the number of positive literals contained in the direct level. |
boolean |
hasAndChild()
Checks if at least one children is an AND logic tree |
boolean |
hasOrChild()
Check if at least one children is an OR logic tree |
boolean |
is(ALogicTree.Operator op)
Current tree is rooted with the logical operator op |
boolean |
isLit()
Current tree is a literal |
boolean |
isNot()
Current tree is rooted with NOT logical operator |
static Literal |
neg(IntegerVariable var)
|
static Literal[] |
neg(IntegerVariable[] vars)
|
static Literal |
pos(IntegerVariable var)
|
static Literal[] |
pos(IntegerVariable[] vars)
|
void |
removeChild(ALogicTree child)
Removes child from the current list of children of this |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Literal(IntegerVariable var, ALogicTree.Type type)
Method Detail |
---|
public static Literal pos(IntegerVariable var)
public static Literal[] pos(IntegerVariable[] vars)
public static Literal neg(IntegerVariable var)
public static Literal[] neg(IntegerVariable[] vars)
public boolean is(ALogicTree.Operator op)
ALogicTree
op
is
in class ALogicTree
op
- operator checked
true
if this
is op
public boolean isNot()
ALogicTree
true
if this
is NOTpublic boolean isLit()
ALogicTree
true
if this
is a literalpublic boolean hasOrChild()
ALogicTree
true
if this
contains one OR logic treepublic boolean hasAndChild()
ALogicTree
true
if this
contains one AND logic treepublic void addChild(ALogicTree child)
ALogicTree
child
to the current list of children of this
child
- the logic tree to addpublic void removeChild(ALogicTree child)
ALogicTree
child
from the current list of children of this
child
- the logic tree to removepublic ALogicTree[] getChildren()
ALogicTree
this
.
null
is a valid return value.
getChildren
in class ALogicTree
null
otherwisepublic ALogicTree getAndChild()
ALogicTree
null
is a valid return value.
null
otherwisepublic ALogicTree getChildBut(ALogicTree child)
ALogicTree
child
.
null
is a valid return value.
child
- node to avoid
child
if exists, null
otherwisepublic String toString()
toString
in class Object
public int compareTo(Literal o)
compareTo
in interface Comparable<Literal>
public Literal clone() throws CloneNotSupportedException
clone
in class ALogicTree
CloneNotSupportedException
public IntegerVariable[] flattenBoolVar()
ALogicTree
this
.
WARNING : a variable may appear more than once, redundancy is not checked!
flattenBoolVar
in class ALogicTree
public int getNbPositiveLiterals()
ALogicTree
getNbPositiveLiterals
in class ALogicTree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |