public class OptToSatAdapter extends SolverDecorator<ISolver>
| Constructor and Description |
|---|
OptToSatAdapter(IOptimizationProblem problem) |
OptToSatAdapter(IOptimizationProblem problem,
SolutionFoundListener sfl) |
| Modifier and Type | Method and Description |
|---|---|
int[] |
findModel()
Look for a model satisfying all the clauses available in the problem.
|
int[] |
findModel(IVecInt assumps)
Look for a model satisfying all the clauses available in the problem.
|
boolean |
isOptimal()
Allow to easily check is the solution returned by isSatisfiable is
optimal or not.
|
boolean |
isSatisfiable()
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(boolean global)
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(IVecInt myAssumps)
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(IVecInt myAssumps,
boolean global)
Check the satisfiability of the set of constraints contained inside the
solver.
|
int[] |
model()
Provide a model (if any) for a satisfiable formula.
|
boolean |
model(int var)
Provide the truth value of a specific variable in the model.
|
int[] |
modelWithInternalVariables()
That method is designed to be used to retrieve the real model of the
current set of constraints, i.e. to provide the truth value of boolean
variables used internally in the solver (for encoding purposes for
instance).
|
void |
reset()
Clean up the internal state of the solver.
|
String |
toString(String prefix)
Display a textual representation of the solver configuration.
|
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setUnitClauseProvider, setVerbose, toString, unsatExplanationpublic OptToSatAdapter(IOptimizationProblem problem)
public OptToSatAdapter(IOptimizationProblem problem, SolutionFoundListener sfl)
public void reset()
ISolverreset in interface ISolverreset in class SolverDecorator<ISolver>public boolean isSatisfiable()
throws TimeoutException
IProblemisSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<ISolver>TimeoutExceptionpublic boolean isSatisfiable(boolean global)
throws TimeoutException
IProblemisSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<ISolver>global - whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.TimeoutExceptionpublic boolean isSatisfiable(IVecInt myAssumps, boolean global) throws TimeoutException
IProblemisSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<ISolver>myAssumps - a set of literals (represented by usual non null integers in
Dimacs format).global - whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.TimeoutExceptionpublic boolean isSatisfiable(IVecInt myAssumps) throws TimeoutException
IProblemisSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<ISolver>myAssumps - a set of literals (represented by usual non null integers in
Dimacs format).TimeoutExceptionpublic int[] model()
IProblemmodel in interface IProblemmodel in class SolverDecorator<ISolver>IProblem.isSatisfiable(),
IProblem.isSatisfiable(IVecInt)public boolean model(int var)
RandomAccessModelmodel in interface RandomAccessModelmodel in class SolverDecorator<ISolver>var - the variable id in Dimacs format#model()public int[] modelWithInternalVariables()
ISolvermodelWithInternalVariables in interface ISolvermodelWithInternalVariables in class SolverDecorator<ISolver>IProblem.model(),
ModelIteratorpublic int[] findModel()
throws TimeoutException
IProblem
if (isSatisfiable()) {
return model();
}
return null;
findModel in interface IProblemfindModel in class SolverDecorator<ISolver>null if no model is foundTimeoutException - if a model cannot be found within the given timeout.public int[] findModel(IVecInt assumps) throws TimeoutException
IProblem
if (isSatisfiable(assumpt)) {
return model();
}
return null;
findModel in interface IProblemfindModel in class SolverDecorator<ISolver>null if no model is foundTimeoutException - if a model cannot be found within the given timeout.public String toString(String prefix)
ISolvertoString in interface ISolvertoString in class SolverDecorator<ISolver>prefix - the prefix to use on each line.public boolean isOptimal()
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.