public abstract class BDDDomain extends Object
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.
BDDFactory.extDomain(int[])
Modifier and Type | Field and Description |
---|---|
protected int |
index |
protected int[] |
ivar |
protected String |
name |
protected BigInteger |
realsize |
protected BDDVarSet |
var |
Modifier | Constructor and Description |
---|---|
protected |
BDDDomain(int index,
BigInteger range)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
BDD |
buildAdd(BDDDomain that,
int bits,
long value) |
BDD |
buildAdd(BDDDomain that,
long value) |
BDD |
buildEquals(BDDDomain that)
Builds a BDD which is true for all the possible assignments to the
variable blocks that makes the blocks equal.
|
BDD |
domain()
Returns what corresponds to a disjunction of all possible values of this
domain.
|
int |
ensureCapacity(BigInteger range) |
int |
ensureCapacity(long range) |
abstract BDDFactory |
getFactory()
Returns the factory that created this domain.
|
int |
getIndex()
Returns the index of this domain.
|
String |
getName()
Gets the name of this domain.
|
BigInteger[] |
getVarIndices(BDD bdd)
Convert a BDD that to a list of indices of this domain.
|
BigInteger[] |
getVarIndices(BDD bdd,
int max)
Convert a BDD that to a list of indices of this domain.
|
BDD |
ithVar(BigInteger val) |
BDD |
ithVar(long val)
Returns the BDD that defines the given value for this finite domain
block.
|
BDDVarSet |
set()
Returns the variable set that contains the variables used to define this
finite domain block.
|
void |
setName(String name)
Sets the name of this domain.
|
BigInteger |
size()
Returns the size of the domain for this finite domain block.
|
String |
toString() |
int |
varNum()
Returns the number of BDD variables used for this finite domain block.
|
BDD |
varRange(BigInteger lo,
BigInteger hi) |
BDD |
varRange(long lo,
long hi)
Returns the BDD that defines the given range of values, inclusive,
for this finite domain block.
|
int[] |
vars()
Returns an integer array containing the indices of the BDD variables used
to define this finite domain.
|
protected String name
protected int index
protected BigInteger realsize
protected int[] ivar
protected BDDVarSet var
protected BDDDomain(int index, BigInteger range)
index
- index of this domainrange
- size of this domainpublic abstract BDDFactory getFactory()
public void setName(String name)
public String getName()
public int getIndex()
public BDD 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.
public BigInteger size()
public BDD buildEquals(BDDDomain that)
that
- public BDDVarSet set()
public BDD ithVar(long val)
public BDD ithVar(BigInteger val)
public BDD varRange(long lo, long hi)
public BDD varRange(BigInteger lo, BigInteger hi)
public int varNum()
public int[] vars()
public int ensureCapacity(long range)
public int ensureCapacity(BigInteger range)
public BigInteger[] getVarIndices(BDD bdd)
Be careful when using this method for BDDs with a large number of entries, as it allocates a BigInteger[] array of dimension k.
bdd
- bdd that is the disjunction of domain indicesgetVarIndices(BDD,int)
,
ithVar(BigInteger)
public BigInteger[] getVarIndices(BDD bdd, int max)
bdd
- bdd that is the disjunction of domain indicesmax
- maximum number of entries to be returnedithVar(long)
Copyright © 2020. All rights reserved.