public class CnfSatInstance extends KahinaSatInstance
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Integer> |
clauseIDs |
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> |
clauseStore |
protected int |
maxVarID |
protected boolean |
needsRebuild |
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> |
occurrenceMap |
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
reverseConversionTable |
symbolTable
needsUpdate
Constructor and Description |
---|
CnfSatInstance() |
Modifier and Type | Method and Description |
---|---|
int |
addClause(java.util.List<java.lang.Integer> clause) |
void |
announceAddedClauses() |
void |
announceChangedClauses() |
void |
applyAssignmentDestructively(PartialAssignment assignment) |
void |
applyDontCareFilter(ClauseFilter filter) |
void |
computeOccurrenceMap() |
CnfSatInstance |
copy() |
void |
deleteVariablesDestructively(java.util.Set<java.lang.Integer> removedVars) |
java.util.List<java.lang.Integer> |
deriveUnitsByPropagation(java.util.List<java.lang.Integer> toPropagate) |
void |
discardOccurrenceMap() |
PartialAssignment |
extractMaxAutarkyDestructively() |
java.util.Map<java.lang.String,java.lang.Integer> |
generateClauseToIndexMap() |
java.util.List<java.lang.Integer> |
getClause(int clauseIndex) |
java.util.List<java.lang.Integer> |
getClauseByID(int clauseID) |
int |
getCountOccourrence(int variable)
Counts the occurrence of a variable within the instance
|
int |
getHighestVar()
precondition: removeID must not be executed if this function is used.
|
int |
getNumVariables() |
int |
getSize() |
java.util.List<java.lang.Integer> |
getSubsumedClauseIndices(java.util.List<java.lang.Integer> clause)
Finds the clauses subsumed by some clause.
|
protected int |
idxToId(int clauseIndex) |
boolean |
isDontCareClause(int clauseIndex) |
boolean |
needsRebuild() |
boolean |
needsUpdate()
States whether a view of this object needs to be updated.
|
java.lang.String |
printAllClauses() |
void |
reduceToLeanKernel() |
void |
removeClauseID(int clauseID)
Removes the clause with the given internal ID.
|
void |
removeClauseIndex(int clauseIndex)
Removes the clause at the given index (not an internal ID!).
|
CnfSatInstance |
selectClauses(java.util.Collection<java.lang.Integer> clauseIndices)
Extracts a subinstance of the this instance defined by clause indices.
|
void |
setSubsumptionCheck(boolean check) |
getSymbolForLiteral, setSymbolMapping
requireUpdate
protected int maxVarID
protected java.util.List<java.lang.Integer> clauseIDs
protected java.util.Map<java.lang.Integer,java.lang.Integer> reverseConversionTable
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> clauseStore
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> occurrenceMap
protected boolean needsRebuild
public CnfSatInstance copy()
public void setSubsumptionCheck(boolean check)
public int addClause(java.util.List<java.lang.Integer> clause)
protected int idxToId(int clauseIndex)
public void removeClauseID(int clauseID)
clauseID
- the ID of the clause to be removed.public int getCountOccourrence(int variable)
variable
- the variableIDpublic void removeClauseIndex(int clauseIndex)
clauseIndex
- the index of the clause to be removed.public java.util.List<java.lang.Integer> getSubsumedClauseIndices(java.util.List<java.lang.Integer> clause)
clause
- the clause to check for subsumption against the clauses in this CNFpublic int getSize()
public void computeOccurrenceMap()
public void discardOccurrenceMap()
public boolean isDontCareClause(int clauseIndex)
public void applyDontCareFilter(ClauseFilter filter)
public java.util.List<java.lang.Integer> getClause(int clauseIndex)
public CnfSatInstance selectClauses(java.util.Collection<java.lang.Integer> clauseIndices)
clauseIndices
- a list of 1-based clause indices in this instancepublic java.util.List<java.lang.Integer> deriveUnitsByPropagation(java.util.List<java.lang.Integer> toPropagate)
public int getHighestVar()
public void deleteVariablesDestructively(java.util.Set<java.lang.Integer> removedVars)
public void applyAssignmentDestructively(PartialAssignment assignment)
public void reduceToLeanKernel()
public PartialAssignment extractMaxAutarkyDestructively()
public java.util.Map<java.lang.String,java.lang.Integer> generateClauseToIndexMap()
public void announceChangedClauses()
public void announceAddedClauses()
public boolean needsUpdate()
KahinaObject
needsUpdate
in class KahinaObject
public boolean needsRebuild()
public java.lang.String printAllClauses()
public java.util.List<java.lang.Integer> getClauseByID(int clauseID)
public int getNumVariables()