public class SDD extends CanonicalWatched
| Modifier and Type | Method and Description |
|---|---|
SDD |
and(SDD other)
Returns the SDD corresponding to the AND operation
between this SDD and the specified SDD.
|
<X> X |
apply(SDDFunction<X> f)
Applies the specified SDD function on this SDD.
|
static SDD |
constant(boolean constant,
Vtree tree)
Returns the SDD representing the specified constant.
|
static SDD |
create(SDDTree sdd,
Vtree tree)
Creates an SDD defined as the specified SDD tree on the specified vtree.
|
protected void |
destroy()
Notifies this object that it is no longer referenced.
|
protected boolean |
equivalent(java.lang.Object obj)
Indicates whether the specified object
is equivalent to this object.
|
SDD |
exists(Variable vr)
Computes the SDD resulting from the existantial operation
over this SDD for the specified variable.
|
SDD |
forall(Variable vr)
Computes the SDD resulting from the universal operation
over this SDD for the specified variable.
|
java.util.List<Assignment> |
getAssignments()
Returns the models of this SDD.
|
protected java.util.Map<java.lang.Object,SDD> |
getBuffer()
Returns the buffer that is used to decide the canonical objects.
|
Assignment |
getOneAssignment()
Returns one model of this SDD.
|
SDDTree |
getSDDTree()
Returns the SDDTree of this SDD.
|
Vtree |
getTree()
Returns the Vtree of this SDD.
|
int |
hashCode() |
boolean |
isConstant()
Indicates whether this SDD represents a constant (true or false).
|
boolean |
isSat()
Indicates whether this SDD is satisfiable,
i.e., whether it is different from false.
|
boolean |
isValid()
Indicates whether this SDD is valid,
i.e., whether it is equivalent to true.
|
SDD |
leftRotation(VtreeNode nodeWhereLeftRotationIsPerformed)
Performs a left rotation operation on the specified node of the vtree.
|
SDD |
leftRotationOnRoot()
Performs a left rotation operation on the root of this SDD.
|
java.math.BigInteger |
nbModels()
Returns the number of models of this SDD.
|
SDD |
neg()
Returns the SDD corresponding to the NOT operation
on this SDD.
|
SDD |
or(SDD other)
Returns the SDD corresponding to the OR operation
between this SDD and the specified SDD.
|
static SDD |
or(Vtree tree,
SDD... sdds)
Performs an OR operation on the specified collection of SDD.
|
static void |
printBuffer(java.io.PrintStream out)
Prints the content of the SDD buffer,
i.e., the list of SDD that are still being watched.
|
static SDD |
readCNF(Vtree vtree,
java.util.List<SDD> vars,
IntegerTokenizer tokizer)
Reads the CNF in the specified integer tokenizer
with the specified list of sdds (representing the variables)
and the specified vtree.
|
SDD |
replace(Variable var1,
Variable var2)
Computes the SDD where every instance of the first specified variable
is replaced in this SDD by an instance of the second variable.
|
SDD |
rightRotation(VtreeNode nodeWhereRightRotationIsPerformed)
Performs a right rotation operation on the specified node of the vtree.
|
SDD |
rightRotationOnRoot()
Performs a right rotation operation on the root of this SDD.
|
int |
size()
Returns the number of nodes used to represent this SDD.
|
SDD |
swapVnodeOnRoot()
Performs a swap operation on the root of this SDD.
|
void |
toDot()
Prints a DOT representation of this SDD in System.out.
|
void |
toDot(java.lang.String filename)
Prints a DOT representation of this SDD
in the file at the specified address.
|
static void |
toDot(java.lang.String filename,
SDD... sdds)
Print a DOT representation of the specified collection of SDDs
in the file at the specified address.
|
java.lang.String |
toString() |
static SDD |
variable(Variable var,
Vtree tree)
Creates the SDD associated with the specified variable
(i.e., the positive literal associated with the variable)
for a given vtree.
|
equals, getCanonical, print, unwatch, unwatchAll, verifyValidity, watchpublic static SDD create(SDDTree sdd, Vtree tree)
sdd - the SDD tree.tree - the vtree upon which the SDD tree is defined.public static SDD variable(Variable var, Vtree tree)
var - the variable.tree - the vtree.public static SDD constant(boolean constant, Vtree tree)
constant - the constant (true or false) of the SDD.tree - the tree upon which the SDD is built.public int hashCode()
hashCode in class CanonicalWatchedprotected boolean equivalent(java.lang.Object obj)
CanonicalWatchedequivalent in class CanonicalWatchedobj - the object compared to this object.protected java.util.Map<java.lang.Object,SDD> getBuffer()
CanonicalWatchedgetBuffer in class CanonicalWatchedprotected void destroy()
CanonicalWatcheddestroy in class CanonicalWatchedpublic static SDD readCNF(Vtree vtree, java.util.List<SDD> vars, IntegerTokenizer tokizer)
vtree - the vtree.vars - the list of variables (vars.get(i)
is the variable referred to as x in the integer tokenizer).tokizer - the integer tokenizer.public Vtree getTree()
public SDDTree getSDDTree()
public java.lang.String toString()
toString in class java.lang.Objectpublic void toDot()
public void toDot(java.lang.String filename)
filename - the address of the file where the dot file should be stored.public static void toDot(java.lang.String filename,
SDD... sdds)
filename - the address of the file where the dot file should be stored.sdds - the list of SDDs that should be printed together.public static void printBuffer(java.io.PrintStream out)
out - the print stream where the buffer should be printed.public SDD and(SDD other)
other - the SDD that is conjuncted with this SDD.public SDD or(SDD other)
other - the SDD that is disjuncted with this SDD.public static SDD or(Vtree tree, SDD... sdds)
tree - the Vtree upon which the SDD is built.sdds - the collection of SDD whose disjunction is requested.public SDD neg()
public SDD exists(Variable vr)
vr - the variable whose value is ignored.public SDD forall(Variable vr)
vr - the variable whose value is ignored.public SDD replace(Variable var1, Variable var2)
var1 - the variable that is replaced.var2 - the variable that replaces var1.public SDD rightRotationOnRoot()
public SDD rightRotation(VtreeNode nodeWhereRightRotationIsPerformed)
nodeWhereRightRotationIsPerformed - the node of the vtree of this SDD
where the right rotation is performed.public SDD leftRotationOnRoot()
public SDD leftRotation(VtreeNode nodeWhereLeftRotationIsPerformed)
nodeWhereLeftRotationIsPerformed - the node of the vtree of this SDD
where the left rotation is performed.public SDD swapVnodeOnRoot()
public java.util.List<Assignment> getAssignments()
public Assignment getOneAssignment()
public boolean isConstant()
public int size()
public boolean isValid()
public boolean isSat()
public java.math.BigInteger nbModels()
public <X> X apply(SDDFunction<X> f)
X - the type of object that the function computes.f - the function to apply on this SDD.