public final class UnaryClausesDatabase extends AbstractClausesDatabase
CLAUSE_RATE_AVERAGE, CLAUSE_RATE_I_WANT_THIS_CLAUSE, CLAUSE_RATE_LOW, CLAUSE_RATE_UNSUPPORTED, CLAUSE_RATE_WELL_SUPPORTED, core, databaseIndex, dbStore, MINIMUM_VAR_WATCH_SIZE, pool, trail, watchLists
Constructor and Description |
---|
UnaryClausesDatabase() |
Modifier and Type | Method and Description |
---|---|
int |
addClause(int[] clause,
boolean isModel)
TODO: Radek,
|
void |
assertLiteral(int literal)
It informs the ClausesDatabase that this literal is set, so that it
can perform unit propagation.
|
void |
backjump(int level)
Do everything needed to return to the given level.
|
boolean |
canRemove(int clauseId)
It tells if the implementation of ClausesDatabase can remove clauses or not
|
int |
rateThisClause(int[] clause)
Indicates how much this database is optimized for this clause.
|
void |
removeClause(int clauseId)
It removes the clause which unique ID is @param clauseId.
|
MapClause |
resolutionWith(int clauseId,
MapClause clause)
It returns the clause obtained by resolution between clauseIndex and clause.
|
int |
size()
number of clauses in the database
|
void |
toCNF(BufferedWriter output)
It creates a CNF description of the clauses stored in this database.
|
String |
toString(String prefix)
prints the content of the database in a nice way, each line being
prefixed with
|
addWatch, doesWatch, ensureWatch, getDatabaseIndex, indexToUniqueId, initialize, removeWatch, setDatabaseIndex, swap, toString, uniqueIdToIndex
public int addClause(int[] clause, boolean isModel)
why would you bother with having any code for removal when nothing is being actually removed. Why not disallow removal altogether and call it StaticUnaryClausesDatabase?
clause
- the clause to addisModel
- defined if the clause is model clausepublic void removeClause(int clauseId)
ClauseDatabaseInterface
clauseId
- clause idpublic boolean canRemove(int clauseId)
ClauseDatabaseInterface
clauseId
- the unique Id of the clausepublic MapClause resolutionWith(int clauseId, MapClause clause)
ClauseDatabaseInterface
clauseId
- the unique id of the clauseclause
- an explanation clause that is modified by resolutionpublic void backjump(int level)
ClauseDatabaseInterface
level
- the level to return to. Must be < solver.getCurrentLevel().public void assertLiteral(int literal)
ClauseDatabaseInterface
literal
- the literal that is setpublic int rateThisClause(int[] clause)
AbstractClausesDatabase
rateThisClause
in class AbstractClausesDatabase
clause
- a clause to ratepublic String toString(String prefix)
AbstractClausesDatabase
toString
in class AbstractClausesDatabase
prefix
- prefix for printed linepublic int size()
AbstractClausesDatabase
size
in interface ClauseDatabaseInterface
size
in class AbstractClausesDatabase
public void toCNF(BufferedWriter output) throws IOException
AbstractClausesDatabase
toCNF
in interface ClauseDatabaseInterface
toCNF
in class AbstractClausesDatabase
output
- it specifies the target to which the description will be written.IOException
- execption from java.io packageCopyright © 2022. All rights reserved.