|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SATSolver
Provides an interface to a SAT solver.
all i: [2..) | i in variables => i-1 in variables |
all c: clauses | all lit: c.literals | lit in variables || -lit in variables |
all c: clauses | all disj i,j: c.literals | abs(i) != abs(j) |
variables: set [1..) |
clauses: set Clause |
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. |
void |
addVariables(int numVars)
Adds the specified number of new variables to the solver's vocabulary. |
void |
free()
Frees the memory used by this solver. |
int |
numberOfClauses()
Returns the number of clauses in this solver. |
int |
numberOfVariables()
Returns the size of this solver's vocabulary. |
boolean |
solve()
Returns true if there is a satisfying assignment for this.clauses. |
boolean |
valueOf(int variable)
Returns the boolean value assigned to the given variable by the last successful call to solve() . |
Method Detail |
---|
int numberOfVariables()
int numberOfClauses()
void addVariables(int numVars)
java.lang.IllegalArgumentException
- - numVars < 0this.variables' = [1..#this.variables + numVars] |
numVars >= 0 |
boolean addClause(int[] lits)
java.lang.NullPointerException
- - lits = null[[this.clauses']] = ([[this.clauses]] and [[lits]]) |
all i: [0..lits.length) | abs(lits[i]) in this.variables |
all disj i,j: [0..lits.length) | abs(lits[i]) != abs(lits[j]) |
boolean solve() throws SATAbortedException
valueOf(int)
.
If the satisfiability of this.clauses cannot be determined within
the given number of seconds, a TimeoutException is thrown.
SATAbortedException
- -- the call to solve was cancelled or
could not terminate normally.boolean valueOf(int variable)
solve()
.
solve()
.
java.lang.IllegalArgumentException
- - variable !in this.variables
java.lang.IllegalStateException
- - solve()
has not been called or the
outcome of the last call was not true
.{@link #solve() } has been called and the
outcome of the last call was |
void free()
frees the memory used by this solver |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |