Package org.jreliability.bdd.javabdd
Class JBDD<T>
- java.lang.Object
-
- org.jreliability.bdd.javabdd.JBDD<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected net.sf.javabdd.BDD
bdd
protected JBDDProvider<T>
provider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Iterator<BDD<T>>
allsat()
Returns aBDD
Iterator
containing all satisfying variable assignments.BDD<T>
and(BDD<T> that)
Returns the logicaland
of two BDDs.void
andWith(java.util.Collection<T> that)
Makes this BDD the logicaland
of this andthat
variables.void
andWith(BDD<T> that)
void
andWith(T that)
Makes this BDD the logicaland
of this andthat
variable.BDD<T>
copy()
Returns a copy of thisBDD
.boolean
equals(java.lang.Object that)
TODO Returnstrue
if this BDD equalsthat
BDD.BDD<T>
exist(T variable)
Returns thisBDD
after an existential quantification of the specified variable.BDD<T>
forAll(T variable)
Returns thisBDD
after a universal quantification of the specified variable.void
free()
Destroys thisBDD
.BDDProvider<T>
getProvider()
Returns the usedBDDProvider
.java.util.Set<T>
getVariables()
Returns the set of variables that are used in thisBDD
.int
hashCode()
BDD<T>
high()
Returns thetrue
or1
branch of this BDD.BDD<T>
imp(BDD<T> that)
Returns the logical implication of twoBDD
s.void
impWith(BDD<T> that)
Returns the logical implication of twoBDD
s.void
impWith(T that)
Makes this BDD the logical implication of this andthat
variable.boolean
isOne()
Returnstrue
if this BDD is theone
BDD.boolean
isZero()
Returnstrue
if this BDD is thezero
BDD.BDD<T>
ite(BDD<T> thenBDD, BDD<T> elseBDD)
int
level()
Returns the level of thisBDD
.BDD<T>
low()
int
nodeCount()
Returns the number of node in thisBDD
.BDD<T>
not()
BDD<T>
or(BDD<T> that)
Returns the logical or of twoBDD
s.void
orWith(java.util.Collection<T> that)
Makes thisBDD
the logical or of this andthat
variables.void
orWith(BDD<T> that)
Makes this BDD the logical or of this andthat
BDD
.void
orWith(T that)
Makes this BDD the logical or of this andthat
variable.BDD<T>
replace(T variable1, T variable2)
void
replaceWith(T variable1, T variable2)
BDD<T>
restrict(BDD<T> that)
void
restrictWith(BDD<T> that)
Restricts the variables ofthat
to constant reliabilityFunctions in this BDD.BDD<T>
sat()
Returns one satisfying variable assignment as aBDD
.java.lang.String
toString()
T
var()
Returns the variable labeling theBDD
.BDD<T>
xor(BDD<T> that)
Returns the logical xor of twoBDD
s.void
xorWith(BDD<T> that)
Makes thisBDD
the logical xor of this andthat
BDD.void
xorWith(T that)
Makes thisBDD
the logical xor of this andthat
variable.
-
-
-
Field Detail
-
provider
protected JBDDProvider<T> provider
-
bdd
protected net.sf.javabdd.BDD bdd
-
-
Method Detail
-
allsat
public java.util.Iterator<BDD<T>> allsat()
Description copied from interface:BDD
Returns aBDD
Iterator
containing all satisfying variable assignments.
-
and
public BDD<T> and(BDD<T> that)
Description copied from interface:BDD
Returns the logicaland
of two BDDs. Note: Both BDDs remain unchanged after this and-operation.
-
andWith
public void andWith(BDD<T> that)
Description copied from interface:BDD
Makes this BDD the logicaland
of this andthat
BDD
. Note:That
BDD is consumed(!) within this operation and invalid afterwards.
-
equals
public boolean equals(java.lang.Object that)
Description copied from interface:BDD
TODO Returnstrue
if this BDD equalsthat
BDD.
-
exist
public BDD<T> exist(T variable)
Description copied from interface:BDD
Returns thisBDD
after an existential quantification of the specified variable.
-
forAll
public BDD<T> forAll(T variable)
Description copied from interface:BDD
Returns thisBDD
after a universal quantification of the specified variable.
-
getProvider
public BDDProvider<T> getProvider()
Description copied from interface:BDD
Returns the usedBDDProvider
.- Specified by:
getProvider
in interfaceBDD<T>
- Returns:
- the used bdd provider
-
high
public BDD<T> high()
Description copied from interface:BDD
Returns thetrue
or1
branch of this BDD.
-
isOne
public boolean isOne()
Description copied from interface:BDD
Returnstrue
if this BDD is theone
BDD.
-
isZero
public boolean isZero()
Description copied from interface:BDD
Returnstrue
if this BDD is thezero
BDD.
-
nodeCount
public int nodeCount()
Description copied from interface:BDD
Returns the number of node in thisBDD
.
-
or
public BDD<T> or(BDD<T> that)
Description copied from interface:BDD
Returns the logical or of twoBDD
s. Note: Both BDDs remain unchanged after this or-operation.
-
orWith
public void orWith(BDD<T> that)
Description copied from interface:BDD
Makes this BDD the logical or of this andthat
BDD
. Note:That
BDD is consumed(!) within this operation and invalid afterwards.
-
replaceWith
public void replaceWith(T variable1, T variable2)
Description copied from interface:BDD
- Specified by:
replaceWith
in interfaceBDD<T>
- Parameters:
variable1
- the first variablevariable2
- the second variable
-
restrictWith
public void restrictWith(BDD<T> that)
Description copied from interface:BDD
Restricts the variables ofthat
to constant reliabilityFunctions in this BDD. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Specified by:
restrictWith
in interfaceBDD<T>
- Parameters:
that
- the BDD to restrict this BDD with
-
sat
public BDD<T> sat()
Description copied from interface:BDD
Returns one satisfying variable assignment as aBDD
.
-
xor
public BDD<T> xor(BDD<T> that)
Description copied from interface:BDD
Returns the logical xor of twoBDD
s. Note: Both BDDs remain unchanged after this xor-operation.
-
xorWith
public void xorWith(BDD<T> that)
Description copied from interface:BDD
Makes thisBDD
the logical xor of this andthat
BDD. Note:That
BDD is consumed(!) within this operation and invalid afterwards.
-
imp
public BDD<T> imp(BDD<T> that)
Description copied from interface:BDD
Returns the logical implication of twoBDD
s. Note: Both BDDs remain unchanged after this and-operation.
-
impWith
public void impWith(BDD<T> that)
Description copied from interface:BDD
Returns the logical implication of twoBDD
s. Note:That
BDD is consumed(!) within this operation and invalid afterwards.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
andWith
public void andWith(java.util.Collection<T> that)
Description copied from interface:BDD
Makes this BDD the logicaland
of this andthat
variables.
-
andWith
public void andWith(T that)
Description copied from interface:BDD
Makes this BDD the logicaland
of this andthat
variable.
-
orWith
public void orWith(java.util.Collection<T> that)
Description copied from interface:BDD
Makes thisBDD
the logical or of this andthat
variables.
-
orWith
public void orWith(T that)
Description copied from interface:BDD
Makes this BDD the logical or of this andthat
variable.
-
impWith
public void impWith(T that)
Description copied from interface:BDD
Makes this BDD the logical implication of this andthat
variable.
-
xorWith
public void xorWith(T that)
Description copied from interface:BDD
Makes thisBDD
the logical xor of this andthat
variable.
-
getVariables
public java.util.Set<T> getVariables()
Description copied from interface:BDD
Returns the set of variables that are used in thisBDD
.- Specified by:
getVariables
in interfaceBDD<T>
- Returns:
- the set of variables that are used in this bdd
-
-