Package com.github.javabdd
Class BDDDomain
java.lang.Object
com.github.javabdd.BDDDomain
Represents a domain of BDD variables. This is useful for finite state machines, among other things.
BDDDomains are called "finite domain blocks" in Section 2.9 of the buddy documentation. A BDDDomain is a block of BDD variables that can represent integer values as opposed to only true and false.
Use BDDFactory.extDomain() to create one or more domains with a specified list of sizes.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBDDDomain(int index, BigInteger range) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuildEquals(BDDDomain that) Builds a BDD which is true for all the possible assignments to the variable blocks that makes the blocks equal.domain()Returns what corresponds to a disjunction of all possible values of this domain.intensureCapacity(long range) intensureCapacity(BigInteger range) abstract BDDFactoryReturns the factory that created this domain.intgetIndex()Returns the index of this domain.getName()Gets the name of this domain.getVarIndices(BDD that) Convert a BDDthatto a list of indices of this domain.getVarIndices(BDD that, int max) Convert a BDDthatto a list of indices of this domain.ithVar(long val) Returns the BDD that defines the given value for this finite domain block.ithVar(BigInteger val) set()Returns the variable set that contains the variables used to define this finite domain block.voidSets the name of this domain.size()Returns the size of the domain for this finite domain block.toString()intvarNum()Returns the number of BDD variables used for this finite domain block.varRange(long lo, long hi) Returns the BDD that defines the given range of values, inclusive, for this finite domain block.varRange(BigInteger lo, BigInteger hi) int[]vars()Returns an integer array containing the indices of the BDD variables used to define this finite domain.
-
Field Details
-
name
-
index
protected int index -
realsize
-
ivar
protected int[] ivar -
var
-
-
Constructor Details
-
BDDDomain
Default constructor.- Parameters:
index- index of this domainrange- size of this domain
-
-
Method Details
-
getFactory
Returns the factory that created this domain.- Returns:
- the BDD factory
-
setName
Sets the name of this domain.- Parameters:
name- the name
-
getName
Gets the name of this domain.- Returns:
- the name
-
getIndex
public int getIndex()Returns the index of this domain.- Returns:
- the index
-
domain
Returns what corresponds to a disjunction of all possible values of this domain. This is more efficient than doing ithVar(0) OR ithVar(1) ... explicitly for all values in the domain.Compare to fdd_domain.
- Returns:
- BDD representing the possible values of this domain
-
size
Returns the size of the domain for this finite domain block.Compare to fdd_domainsize.
- Returns:
- the size
-
buildAdd
-
buildAdd
-
buildEquals
Builds a BDD which is true for all the possible assignments to the variable blocks that makes the blocks equal.Compare to fdd_equals/fdd_equ.
- Parameters:
that- the other BDD domain- Returns:
- BDD
-
set
Returns the variable set that contains the variables used to define this finite domain block.Compare to fdd_ithset.
- Returns:
- BDDVarSet
-
ithVar
Returns the BDD that defines the given value for this finite domain block.Compare to fdd_ithvar.
- Parameters:
val- the given value- Returns:
- BDD
-
ithVar
-
varRange
Returns the BDD that defines the given range of values, inclusive, for this finite domain block.- Parameters:
lo- low value (inclusive)hi- high value (inclusive)- Returns:
- BDD
-
varRange
-
varNum
public int varNum()Returns the number of BDD variables used for this finite domain block.Compare to fdd_varnum.
- Returns:
- int
-
vars
public int[] vars()Returns an integer array containing the indices of the BDD variables used to define this finite domain.Compare to fdd_vars.
- Returns:
- int[]
-
ensureCapacity
public int ensureCapacity(long range) -
ensureCapacity
-
toString
-
getVarIndices
Convert a BDDthatto a list of indices of this domain. This method assumes that the BDD passed is a disjunction of ithVar(i_1) to ithVar(i_k). It returns an array of length 'k' with elements [i_1,...,i_k].Be careful when using this method for BDDs with a large number of entries, as it allocates a BigInteger[] array of dimension k.
- Parameters:
that- bdd that is the disjunction of domain indices- Returns:
- list of indices in this domain
- See Also:
-
getVarIndices
Convert a BDDthatto a list of indices of this domain. Same as getVarIndices(BDD), except only 'max' indices are extracted.- Parameters:
that- bdd that is the disjunction of domain indicesmax- maximum number of entries to be returned- Returns:
- list of indices of this domain
- See Also:
-