Package org.jreliability.bdd
Interface BDD<T>
-
- Type Parameters:
T
- the type of the variables
- All Known Implementing Classes:
JBDD
public interface BDD<T>
-
-
Method Summary
All Methods Instance Methods Abstract 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
.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
.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.
-
-
-
Method Detail
-
allsat
java.util.Iterator<BDD<T>> allsat()
Returns aBDD
Iterator
containing all satisfying variable assignments.- Returns:
- all satisfying variable assignments
-
and
BDD<T> and(BDD<T> that)
Returns the logicaland
of two BDDs. Note: Both BDDs remain unchanged after this and-operation.- Parameters:
that
- the BDD to and with this BDD- Returns:
- the logical and of the two BDDs
-
andWith
void andWith(BDD<T> that)
Makes this BDD the logicaland
of this andthat
BDD
. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Parameters:
that
- the BDD to and with this BDD
-
andWith
void andWith(java.util.Collection<T> that)
Makes this BDD the logicaland
of this andthat
variables.- Parameters:
that
- the variables to and with this BDD
-
andWith
void andWith(T that)
Makes this BDD the logicaland
of this andthat
variable.- Parameters:
that
- the variable to and with this BDD
-
equals
boolean equals(java.lang.Object that)
TODO Returnstrue
if this BDD equalsthat
BDD.- Overrides:
equals
in classjava.lang.Object
- Parameters:
that
- the BDD to compare with this BDD- Returns:
- true if this BDD equals that BDD
-
exist
BDD<T> exist(T variable)
Returns thisBDD
after an existential quantification of the specified variable.- Parameters:
variable
- the variable for the existential quantification- Returns:
- this BDD after an existential quantification of the specified variables
-
forAll
BDD<T> forAll(T variable)
Returns thisBDD
after a universal quantification of the specified variable.- Parameters:
variable
- the variable for the universal quantification- Returns:
- this BDD after a universal quantification of the specified variables
-
sat
BDD<T> sat()
Returns one satisfying variable assignment as aBDD
.- Returns:
- one satisfying variable assignment as a BDD
-
high
BDD<T> high()
Returns thetrue
or1
branch of this BDD.- Returns:
- the true or 1 branch of this BDD
-
getProvider
BDDProvider<T> getProvider()
Returns the usedBDDProvider
.- Returns:
- the used bdd provider
-
isOne
boolean isOne()
Returnstrue
if this BDD is theone
BDD.- Returns:
- true if this BDD is the one BDD
-
isZero
boolean isZero()
Returnstrue
if this BDD is thezero
BDD.- Returns:
- true if this BDD is the zero BDD
-
ite
BDD<T> ite(BDD<T> thenBDD, BDD<T> elseBDD)
Returns the if-then-else}BDD
with thisBDD
being the if, thethenBDD
being the then andelseBDD
being the else statement.- Parameters:
thenBDD
- the BDD for the then statementelseBDD
- the BDD for the else statement- Returns:
- the if-then-else BDD
-
level
int level()
Returns the level of thisBDD
.- Returns:
- the level of this BDD
-
nodeCount
int nodeCount()
Returns the number of node in thisBDD
.- Returns:
- the number of nodes in this bdd
-
or
BDD<T> or(BDD<T> that)
Returns the logical or of twoBDD
s. Note: Both BDDs remain unchanged after this or-operation.- Parameters:
that
- the BDD to or with this BDD- Returns:
- the logical or of the two BDDs
-
orWith
void orWith(BDD<T> that)
Makes this BDD the logical or of this andthat
BDD
. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Parameters:
that
- the BDD to or with this BDD
-
orWith
void orWith(java.util.Collection<T> that)
Makes thisBDD
the logical or of this andthat
variables.- Parameters:
that
- the variables to or with this BDD
-
orWith
void orWith(T that)
Makes this BDD the logical or of this andthat
variable.- Parameters:
that
- the variable to or with this BDD
-
replace
BDD<T> replace(T variable1, T variable2)
- Parameters:
variable1
- the first variablevariable2
- the second variable- Returns:
- a BDD where the variable for variable1 is replaced with the variable of variable2
-
replaceWith
void replaceWith(T variable1, T variable2)
- Parameters:
variable1
- the first variablevariable2
- the second variable
-
restrict
BDD<T> restrict(BDD<T> that)
Returns aBDD
where the variables ofthat
BDD
are set to constant reliabilityFunctions in this BDD. Note: Both BDDs remain unchanged after this or-operation.- Parameters:
that
- the BDD to restrict this BDD with- Returns:
- a new BDD representing this BDD restricted with that BDD
-
restrictWith
void restrictWith(BDD<T> that)
Restricts the variables ofthat
to constant reliabilityFunctions in this BDD. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Parameters:
that
- the BDD to restrict this BDD with
-
xor
BDD<T> xor(BDD<T> that)
Returns the logical xor of twoBDD
s. Note: Both BDDs remain unchanged after this xor-operation.- Parameters:
that
- the BDD to xor with this BDD- Returns:
- the logical xor of the two BDDs
-
xorWith
void xorWith(BDD<T> that)
Makes thisBDD
the logical xor of this andthat
BDD. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Parameters:
that
- the BDD to xor with this BDD
-
xorWith
void xorWith(T that)
Makes thisBDD
the logical xor of this andthat
variable.- Parameters:
that
- the variable to or with this BDD
-
imp
BDD<T> imp(BDD<T> that)
Returns the logical implication of twoBDD
s. Note: Both BDDs remain unchanged after this and-operation.- Parameters:
that
- the BDD to implicate with this BDD- Returns:
- the logical implication of the two BDDs
-
impWith
void impWith(BDD<T> that)
Returns the logical implication of twoBDD
s. Note:That
BDD is consumed(!) within this operation and invalid afterwards.- Parameters:
that
- the BDD to implicate with this BDD
-
impWith
void impWith(T that)
Makes this BDD the logical implication of this andthat
variable.- Parameters:
that
- the variable to implicate with this BDD
-
getVariables
java.util.Set<T> getVariables()
Returns the set of variables that are used in thisBDD
.- Returns:
- the set of variables that are used in this bdd
-
free
void free()
Destroys thisBDD
.
-
-