|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.engine.satlab.MiniSat
final class MiniSat
Java wrapper for the MiniSat solver by Niklas Eén and Niklas Sörensson.
Field Summary | |
---|---|
protected long |
peer
The memory address of the native instance wrapped by this wrapper. |
Constructor Summary | |
---|---|
MiniSat()
Constructs a new MiniSAT wrapper. |
Method Summary | |
---|---|
boolean |
addClause(int[] lits)
Ensures that this solver logically contains the given clause, and returns true if this.clauses changed as a result of the call. |
(package private) boolean |
addClause(long peer,
int[] lits)
Ensures that the given native peer logically contains the specified clause and returns true if the solver's clause database changed as a result of the call. |
void |
addVariables(int numVars)
Adds the specified number of new variables to the solver's vocabulary. |
(package private) void |
addVariables(long peer,
int numVariables)
Adds the specified number of variables to the given native peer. |
(package private) void |
adjustClauseCount(int clauseCount)
Adjusts the internal clause count so that the next call to numberOfClauses() will return the given value. |
protected void |
finalize()
Releases the resources used by this native solver. |
void |
free()
Frees the memory used by this solver. |
(package private) void |
free(long peer)
Releases the resources associated with the native solver at the given memory address. |
(package private) boolean |
initializeActivity(long peer,
int var,
double priority)
Initialize MiniSAT's internal score used to order variables (highest first) |
void |
initializeOrder(int var,
double order)
Initializes MiniSAT's internal ordering for the specified variable |
(package private) static void |
loadLibrary(java.lang.Class<? extends kodkod.engine.satlab.NativeSolver> library)
Loads the JNI library for the given class. |
int |
numberOfClauses()
Returns the number of clauses in this solver. |
int |
numberOfVariables()
Returns the size of this solver's vocabulary. |
(package private) boolean |
overrideActivity(long peer,
int var,
int priority)
Statically override MiniSAT's internal score by external priorities (highest first) |
void |
overrideOrder(int var,
int order)
Overrides MiniSAT's internal ordering for the specified variable |
(package private) long |
peer()
Returns a pointer to the C++ peer class (the native instance wrapped by this object). |
boolean |
solve()
Returns true if there is a satisfying assignment for this.clauses. |
(package private) boolean |
solve(long peer)
Calls the solve method on the given native peer. |
(package private) java.lang.Boolean |
status()
Returns the current sat of the solver. |
java.lang.String |
toString()
|
(package private) void |
validateVariable(int variable)
Throws an IllegalArgumentException if variable ! |
boolean |
valueOf(int variable)
Returns the boolean value assigned to the given variable by the last successful call to SATSolver.solve() . |
(package private) boolean |
valueOf(long peer,
int literal)
Returns the assignment for the given literal by the specified native peer |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected long peer
Constructor Detail |
---|
public MiniSat()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
void free(long peer)
NativeSolver.free(long)
void addVariables(long peer, int numVariables)
NativeSolver.addVariables(long, int)
boolean addClause(long peer, int[] lits)
NativeSolver.addClause(long, int[])
boolean solve(long peer)
NativeSolver.solve(long)
boolean valueOf(long peer, int literal)
NativeSolver.valueOf(long, int)
public void initializeOrder(int var, double order)
initializeOrder
in interface OrderableSolver
public void overrideOrder(int var, int order)
overrideOrder
in interface OrderableSolver
boolean initializeActivity(long peer, int var, double priority)
boolean overrideActivity(long peer, int var, int priority)
static void loadLibrary(java.lang.Class<? extends kodkod.engine.satlab.NativeSolver> library)
public final int numberOfVariables()
numberOfVariables
in interface kodkod.engine.satlab.SATSolver
SATSolver.numberOfVariables()
public final int numberOfClauses()
numberOfClauses
in interface kodkod.engine.satlab.SATSolver
SATSolver.numberOfClauses()
void adjustClauseCount(int clauseCount)
public void addVariables(int numVars)
addVariables
in interface kodkod.engine.satlab.SATSolver
SATSolver.addVariables(int)
,
addVariables(long, int)
public final boolean addClause(int[] lits)
addClause
in interface kodkod.engine.satlab.SATSolver
SATSolver.addClause(int[])
,
addClause(long, int[])
final long peer()
final java.lang.Boolean status()
public final boolean solve()
SATSolver.valueOf(int)
.
If the satisfiability of this.clauses cannot be determined within
the given number of seconds, a TimeoutException is thrown.
solve
in interface kodkod.engine.satlab.SATSolver
SATSolver.solve()
,
solve(long)
final void validateVariable(int variable)
java.lang.IllegalArgumentException
- variable !in this.variablespublic final boolean valueOf(int variable)
SATSolver.solve()
.
valueOf
in interface kodkod.engine.satlab.SATSolver
SATSolver.solve()
.SATSolver.valueOf(int)
public final void free()
free
in interface kodkod.engine.satlab.SATSolver
SATSolver.free()
protected final void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |