- java.lang.Object
-
- org.logicng.knowledgecompilation.bdds.jbuddy.BDDConstruction
-
public class BDDConstruction extends Object
This class provides abstractions for the construction of BDDs.- Since:
- 2.0.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description BDDConstruction(BDDKernel k)Constructs a new object with the given kernel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intand(int l, int r)Returns the conjunction of two BDDs.intbddHigh(int root)Returns the true branch of the given root node.intbddLow(int root)Returns the false branch of the given root node.intbddVar(int root)Returns the variable index labeling the given root node.intequivalence(int l, int r)Returns the equivalence of two BDDs.intexists(int r, int var)Existential quantifier elimination for the variables invar.intforAll(int r, int var)Universal quantifier elimination for the variables invar.intimplication(int l, int r)Returns the implication of two BDDs.protected booleaninsvarset(int a)protected booleaninvarset(int a)intithVar(int i)Returns a BDD representing the i-th variable (one node with the children true and false).intnithVar(int i)Returns a BDD representing the negation of the i-th variable (one node with the children true and false).intnot(int r)Returns the negation of a BDD.protected intnotRec(int r)intor(int l, int r)Returns the disjunction of two BDDs.protected intquantRec(int r, BDDKernel.Operand op, int quantid)intrestrict(int r, int var)Restricts the variables in the BDDrto constants true or false.protected intrestrictRec(int r, int miscid)protected voidvarset2svartable(int r)protected voidvarset2vartable(int r)
-
-
-
Constructor Detail
-
BDDConstruction
public BDDConstruction(BDDKernel k)
Constructs a new object with the given kernel.- Parameters:
k- the kernel
-
-
Method Detail
-
ithVar
public int ithVar(int i)
Returns a BDD representing the i-th variable (one node with the children true and false).- Parameters:
i- the index i- Returns:
- the BDD representing the i-th variable
- Throws:
IllegalArgumentException- if the index is not within the range of variables
-
nithVar
public int nithVar(int i)
Returns a BDD representing the negation of the i-th variable (one node with the children true and false).- Parameters:
i- the index i- Returns:
- the BDD representing the negated i-th variable
- Throws:
IllegalArgumentException- if the index is not within the range of variables
-
bddVar
public int bddVar(int root)
Returns the variable index labeling the given root node.- Parameters:
root- the root node of the BDD- Returns:
- the variable index
-
bddLow
public int bddLow(int root)
Returns the false branch of the given root node.- Parameters:
root- the root node of the BDD- Returns:
- the false branch
-
bddHigh
public int bddHigh(int root)
Returns the true branch of the given root node.- Parameters:
root- the root node of the BDD- Returns:
- the true branch
-
and
public int and(int l, int r)Returns the conjunction of two BDDs.- Parameters:
l- the first BDDr- the second BDD- Returns:
- the conjunction of the two BDDs
-
or
public int or(int l, int r)Returns the disjunction of two BDDs.- Parameters:
l- the first BDDr- the second BDD- Returns:
- the disjunction of the two BDDs
-
implication
public int implication(int l, int r)Returns the implication of two BDDs.- Parameters:
l- the first BDDr- the second BDD- Returns:
- the implication of the two BDDs
-
equivalence
public int equivalence(int l, int r)Returns the equivalence of two BDDs.- Parameters:
l- the first BDDr- the second BDD- Returns:
- the equivalence of the two BDDs
-
not
public int not(int r)
Returns the negation of a BDD.- Parameters:
r- the BDD- Returns:
- the negation of the BDD
-
notRec
protected int notRec(int r) throws BDDKernel.BddReorderRequest- Throws:
BDDKernel.BddReorderRequest
-
restrict
public int restrict(int r, int var)Restricts the variables in the BDDrto constants true or false. The restriction is submitted in the BDDvar.- Parameters:
r- the BDD to be restrictedvar- the variable mapping as a BDD- Returns:
- the restricted BDD
-
restrictRec
protected int restrictRec(int r, int miscid) throws BDDKernel.BddReorderRequest- Throws:
BDDKernel.BddReorderRequest
-
exists
public int exists(int r, int var)Existential quantifier elimination for the variables invar.- Parameters:
r- the BDD root nodevar- the variables to eliminate- Returns:
- the BDD with the eliminated variables
-
forAll
public int forAll(int r, int var)Universal quantifier elimination for the variables invar.- Parameters:
r- the BDD root nodevar- the variables to eliminate- Returns:
- the BDD with the eliminated variables
-
quantRec
protected int quantRec(int r, BDDKernel.Operand op, int quantid) throws BDDKernel.BddReorderRequest- Throws:
BDDKernel.BddReorderRequest
-
varset2svartable
protected void varset2svartable(int r)
-
varset2vartable
protected void varset2vartable(int r)
-
insvarset
protected boolean insvarset(int a)
-
invarset
protected boolean invarset(int a)
-
-