public class OptToSatAdapter extends SolverDecorator<ISolver>
Constructor and Description |
---|
OptToSatAdapter(IOptimizationProblem problem) |
Modifier and Type | Method and Description |
---|---|
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 assumps)
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(IVecInt assumps,
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.
|
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, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, modelWithInternalVariables, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setVerbose, toString, unsatExplanation
public OptToSatAdapter(IOptimizationProblem problem)
public boolean isSatisfiable() throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
TimeoutException
public void reset()
ISolver
reset
in interface ISolver
reset
in class SolverDecorator<ISolver>
public boolean isSatisfiable(boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
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.TimeoutException
public boolean isSatisfiable(IVecInt assumps, boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
assumps
- 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.TimeoutException
public boolean isSatisfiable(IVecInt assumps) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
assumps
- a set of literals (represented by usual non null integers in
Dimacs format).TimeoutException
public int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public boolean model(int var)
RandomAccessModel
model
in interface RandomAccessModel
model
in class SolverDecorator<ISolver>
var
- the variable id in Dimacs format#model()
public String toString(String prefix)
ISolver
toString
in interface ISolver
toString
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.