Package com.github.javabdd
Class BDDVarSet
- java.lang.Object
-
- com.github.javabdd.BDDVarSet
-
- Direct Known Subclasses:
BDDFactoryIntImpl.IntBDDVarSet
,BDDVarSet.DefaultImpl
public abstract class BDDVarSet extends Object
Some BDD methods, namelyexist()
,forall()
,unique()
,relprod()
,applyAll()
,applyEx()
,applyUni()
, andsatCount()
take a BDDVarSet argument.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BDDVarSet.DefaultImpl
Default implementation of BDDVarSet based on BDDs.
-
Constructor Summary
Constructors Constructor Description BDDVarSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
abstract boolean
equalsBDDVarSet(BDDVarSet that)
Returns true if the sets are equal.abstract void
free()
BDDDomain[]
getDomains()
Scans this BDD and copies the stored variables into an array of BDDDomains.abstract BDDFactory
getFactory()
Returns the factory that created this BDDVarSet.abstract int
hashCode()
abstract BDDVarSet
id()
abstract BDDVarSet
intersect(BDDVarSet b)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given BDDVarSet.abstract BDDVarSet
intersectWith(BDDVarSet b)
Modifies this BDDVarSet to include all of the vars in the given set.abstract boolean
isEmpty()
abstract int
size()
abstract int[]
toArray()
abstract BDD
toBDD()
abstract int[]
toLevelArray()
String
toString()
abstract BDDVarSet
union(int var)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given variable.abstract BDDVarSet
union(BDDVarSet b)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given BDDVarSet.abstract BDDVarSet
unionWith(int var)
Modifies this BDDVarSet to include the given variable.abstract BDDVarSet
unionWith(BDDVarSet b)
Modifies this BDDVarSet to include all of the vars in the given set.
-
-
-
Method Detail
-
getFactory
public abstract BDDFactory getFactory()
Returns the factory that created this BDDVarSet.- Returns:
- factory that created this BDDVarSet
-
toBDD
public abstract BDD toBDD()
-
id
public abstract BDDVarSet id()
-
free
public abstract void free()
-
size
public abstract int size()
-
isEmpty
public abstract boolean isEmpty()
-
toArray
public abstract int[] toArray()
-
toLevelArray
public abstract int[] toLevelArray()
-
getDomains
public BDDDomain[] getDomains()
Scans this BDD and copies the stored variables into an array of BDDDomains. The domains returned are guaranteed to be in ascending order.Compare to fdd_scanset.
- Returns:
- int[]
-
union
public abstract BDDVarSet union(BDDVarSet b)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given BDDVarSet. This constructs a new set; neither the current nor the given BDDVarSet is modified.- Parameters:
b
- BDDVarSet to union with- Returns:
- a new BDDVarSet that is the union of the two sets
-
union
public abstract BDDVarSet union(int var)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given variable. This constructs a new set; the current BDDVarSet is not modified.- Parameters:
var
- variable to add to set- Returns:
- a new BDDVarSet that includes the given variable
-
unionWith
public abstract BDDVarSet unionWith(BDDVarSet b)
Modifies this BDDVarSet to include all of the vars in the given set. This modifies the current set in place and consumes the given set.- Parameters:
b
- BDDVarSet to union in- Returns:
- this
-
unionWith
public abstract BDDVarSet unionWith(int var)
Modifies this BDDVarSet to include the given variable. This modifies the current set in place.- Parameters:
var
- variable to add to set- Returns:
- this
-
intersect
public abstract BDDVarSet intersect(BDDVarSet b)
Returns a new BDDVarSet that is the union of the current BDDVarSet and the given BDDVarSet. This constructs a new set; neither the current nor the given BDDVarSet is modified.- Parameters:
b
- BDDVarSet to union with- Returns:
- a new BDDVarSet that is the union of the two sets
-
intersectWith
public abstract BDDVarSet intersectWith(BDDVarSet b)
Modifies this BDDVarSet to include all of the vars in the given set. This modifies the current set in place and consumes the given set.- Parameters:
b
- BDDVarSet to union in- Returns:
- this
-
equalsBDDVarSet
public abstract boolean equalsBDDVarSet(BDDVarSet that)
Returns true if the sets are equal.- Parameters:
that
- other set- Returns:
- true if the sets are equal
-
-