- java.lang.Object
-
- org.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTree
-
- org.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTreeLeaf
-
public class DTreeLeaf extends DTree
A leaf in a DTree.- Since:
- 2.0.0
- Version:
- 2.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected Formulaclauseprotected intclauseSizeprotected intidprotected int[]literalsprotected BitSetseparatorBitSetprotected DnnfSatSolversolverprotected int[]staticClauseIds-
Fields inherited from class org.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTree
staticSeparator, staticVariables, staticVarSet
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Formulaclause()Returns the leaf's clause.intclauseSize()Returns the size of the leaf's clause.voidcountUnsubsumedOccurrences(int[] occurrences)Counts the number of unsubsumed occurrences for each variable in occurrences.intdepth()Returns the depth of this tree.BitSetdynamicSeparator()The dynamic separator of this DTree.intgetId()Returns the leaf's id.voidinitialize(DnnfSatSolver solver)Initializes the DTree.protected booleanisSubsumed()List<DTreeLeaf>leafs()int[]literals()Returns the literal integers of the clause.intsize()Returns the size of the DTree.int[]staticClauseIds()SortedSet<Variable>staticVariableSet()StringtoString()intwidestSeparator()Returns the widest separator of this tree.-
Methods inherited from class org.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTree
staticVarSet
-
-
-
-
Field Detail
-
id
protected final int id
-
clause
protected final Formula clause
-
clauseSize
protected final int clauseSize
-
literals
protected int[] literals
-
separatorBitSet
protected final BitSet separatorBitSet
-
solver
protected DnnfSatSolver solver
-
staticClauseIds
protected final int[] staticClauseIds
-
-
Constructor Detail
-
DTreeLeaf
public DTreeLeaf(int id, Formula clause)Constructs a new leaf with the given id and clause.- Parameters:
id- the idclause- the clause
-
-
Method Detail
-
initialize
public void initialize(DnnfSatSolver solver)
Description copied from class:DTreeInitializes the DTree.- Specified by:
initializein classDTree- Parameters:
solver- a specializes DNNF SAT solver
-
size
public int size()
Description copied from class:DTreeReturns the size of the DTree.
-
dynamicSeparator
public BitSet dynamicSeparator()
Description copied from class:DTreeThe dynamic separator of this DTree. "Dynamic" means that subsumed clauses are ignored during the separator computation.- Specified by:
dynamicSeparatorin classDTree- Returns:
- The dynamic separator of this DTree
-
staticClauseIds
public int[] staticClauseIds()
-
isSubsumed
protected boolean isSubsumed()
-
countUnsubsumedOccurrences
public void countUnsubsumedOccurrences(int[] occurrences)
Description copied from class:DTreeCounts the number of unsubsumed occurrences for each variable in occurrences.The parameter occurrences should be modified by the method accordingly.
- Specified by:
countUnsubsumedOccurrencesin classDTree- Parameters:
occurrences- The current number of occurrences for each variable which should be modified accordingly
-
depth
public int depth()
Description copied from class:DTreeReturns the depth of this tree.
-
widestSeparator
public int widestSeparator()
Description copied from class:DTreeReturns the widest separator of this tree.- Specified by:
widestSeparatorin classDTree- Returns:
- the widest separator
-
clause
public Formula clause()
Returns the leaf's clause.- Returns:
- the leaf's clause
-
literals
public int[] literals()
Returns the literal integers of the clause.- Returns:
- literals integers of the clause
-
clauseSize
public int clauseSize()
Returns the size of the leaf's clause.- Returns:
- the size of the leaf's clause
-
getId
public int getId()
Returns the leaf's id.- Returns:
- the leaf's id
-
-