Package com.github.javabdd
Class BDD.BDDIterator
java.lang.Object
com.github.javabdd.BDD.BDDIterator
- Enclosing class:
- BDD
BDDIterator is used to iterate through the satisfying assignments of a BDD. It includes the ability to check if
bits are dont-cares and skip them.
-
Constructor Summary
ConstructorsConstructorDescriptionBDDIterator(BDD bdd, BDDVarSet var) Construct a new BDDIterator on the given BDD. -
Method Summary
Modifier and TypeMethodDescriptionvoidfastForward(int var) Fast-forward the iteration such that the given variable number is true.voidfastForward(int[] vars) Fast-forward the iteration such that the given set of variables are true.protected voidgotoNext()protected booleanbooleanhasNext()booleanisDontCare(int var) Returns true if the given BDD variable number is a dont-care.booleanReturns true if the BDD variables in the given BDD domain are all dont-care's.next()nextBDD()Return the next BDD in the iteration.boolean[]nextSat()Return the next single satisfying assignment in the iteration.Return the next tuple of domain values in the iteration.An alternate implementation of nextTuple().voidremove()voidAssumingdis a dont-care, skip to the end of the iteration ford.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
BDDIterator
Construct a new BDDIterator on the given BDD. The var argument is the set of variables that will be mentioned in the result.- Parameters:
bdd- BDD to iterate overvar- variable set to mention in result
-
-
Method Details
-
gotoNext
protected void gotoNext() -
gotoNextA
protected boolean gotoNextA() -
hasNext
public boolean hasNext() -
next
-
nextValue
-
nextTuple
Return the next tuple of domain values in the iteration.- Returns:
- the next tuple of domain values in the iteration.
-
nextTuple2
An alternate implementation of nextTuple(). This may be slightly faster than the default if there are many domains.- Returns:
- the next tuple of domain values in the iteration.
-
nextSat
public boolean[] nextSat()Return the next single satisfying assignment in the iteration.- Returns:
- the next single satisfying assignment in the iteration.
-
nextBDD
Return the next BDD in the iteration.- Returns:
- the next BDD in the iteration
-
remove
public void remove() -
isDontCare
public boolean isDontCare(int var) Returns true if the given BDD variable number is a dont-care.varmust be a variable in the iteration set.- Parameters:
var- variable number to check- Returns:
- if the given variable is a dont-care
-
isDontCare
Returns true if the BDD variables in the given BDD domain are all dont-care's.- Parameters:
d- domain to check- Returns:
- if the variables are all dont-cares
- Throws:
BDDException- if d is not in the iteration set
-
fastForward
public void fastForward(int var) Fast-forward the iteration such that the given variable number is true.- Parameters:
var- number of variable
-
fastForward
public void fastForward(int[] vars) Fast-forward the iteration such that the given set of variables are true.- Parameters:
vars- set of variable indices
-
skipDontCare
Assumingdis a dont-care, skip to the end of the iteration ford.- Parameters:
d- BDD domain to fast-forward past
-