public class ObjectiveReducerPBSolverDecorator extends Object implements IPBSolver
| Constructor and Description |
|---|
ObjectiveReducerPBSolverDecorator(IPBSolver decorated) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllClauses(IVec<IVecInt> clauses) |
IConstr |
addAtLeast(IVecInt literals,
int degree) |
IConstr |
addAtLeast(IVecInt literals,
IVec<BigInteger> coeffs,
BigInteger degree)
Create a pseudo-boolean constraint of the type "at least".
|
IConstr |
addAtLeast(IVecInt literals,
IVecInt coeffs,
int degree)
Create a pseudo-boolean constraint of the type "at least".
|
IConstr |
addAtMost(IVecInt literals,
int degree) |
IConstr |
addAtMost(IVecInt literals,
IVec<BigInteger> coeffs,
BigInteger degree)
Create a pseudo boolean constraint of the type "at most".
|
IConstr |
addAtMost(IVecInt literals,
IVecInt coeffs,
int degree)
Create a pseudo boolean constraint of the type "at most".
|
IConstr |
addBlockingClause(IVecInt literals) |
IConstr |
addClause(IVecInt literals) |
IConstr |
addConstr(Constr constr) |
IConstr |
addExactly(IVecInt literals,
int n) |
IConstr |
addExactly(IVecInt literals,
IVec<BigInteger> coeffs,
BigInteger weight)
Create a pseudo-boolean constraint of the type "subset sum".
|
IConstr |
addExactly(IVecInt literals,
IVecInt coeffs,
int weight)
Create a pseudo-boolean constraint of the type "subset sum".
|
IConstr |
addParity(IVecInt literals,
boolean even) |
IConstr |
addPseudoBoolean(IVecInt lits,
IVec<BigInteger> coeffs,
boolean moreThan,
BigInteger d)
Create a Pseudo-Boolean constraint of the type "at least n or at most n
of those literals must be satisfied"
|
void |
clearLearntClauses() |
IVecInt |
createBlockingClauseForCurrentModel() |
IConstr |
discardCurrentModel() |
void |
expireTimeout() |
int[] |
findModel() |
int[] |
findModel(IVecInt assumps) |
String |
getLogPrefix() |
ObjectiveFunction |
getObjectiveFunction()
Retrieve the objective function from the solver.
|
AssignmentOrigin |
getOriginInModel(int p) |
<S extends ISolverService> |
getSearchListener() |
ISolver |
getSolvingEngine() |
Map<String,Number> |
getStat() |
int |
getTimeout() |
long |
getTimeoutMs() |
boolean |
isDBSimplificationAllowed() |
boolean |
isSatisfiable() |
boolean |
isSatisfiable(boolean globalTimeout) |
boolean |
isSatisfiable(IVecInt assumps) |
boolean |
isSatisfiable(IVecInt assumps,
boolean globalTimeout) |
boolean |
isSolverKeptHot() |
boolean |
isVerbose() |
int[] |
model() |
boolean |
model(int var) |
int[] |
modelWithInternalVariables() |
int |
nConstraints() |
int |
newVar() |
int |
newVar(int howmany) |
int |
nextFreeVarId(boolean reserve) |
int |
nVars() |
int[] |
primeImplicant() |
boolean |
primeImplicant(int p) |
void |
printInfos(PrintWriter out) |
void |
printInfos(PrintWriter out,
String prefix) |
void |
printStat(PrintStream out,
String prefix) |
void |
printStat(PrintWriter out) |
void |
printStat(PrintWriter out,
String prefix) |
int |
realNumberOfVariables() |
void |
registerLiteral(int p) |
boolean |
removeConstr(IConstr c) |
boolean |
removeSubsumedConstr(IConstr c) |
void |
reset() |
void |
setDBSimplificationAllowed(boolean status) |
void |
setExpectedNumberOfClauses(int nb) |
void |
setKeepSolverHot(boolean keepHot) |
void |
setLogPrefix(String prefix) |
void |
setObjectiveFunction(ObjectiveFunction obj)
Provide an objective function to the solver.
|
<S extends ISolverService> |
setSearchListener(SearchListener<S> sl) |
void |
setTimeout(int t) |
void |
setTimeoutMs(long t) |
void |
setTimeoutOnConflicts(int count) |
void |
setUnitClauseConsumer(UnitClauseConsumer ucc) |
void |
setUnitClauseProvider(UnitClauseProvider ucp) |
void |
setVerbose(boolean value) |
String |
toString(String prefix) |
IVecInt |
unsatExplanation() |
public ObjectiveReducerPBSolverDecorator(IPBSolver decorated)
public IConstr addPseudoBoolean(IVecInt lits, IVec<BigInteger> coeffs, boolean moreThan, BigInteger d) throws ContradictionException
IPBSolveraddPseudoBoolean in interface IPBSolverlits - a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.moreThan - true if it is a constraint >= degree, false if it is a
constraint <= degreed - the degree of the cardinality constraintContradictionException - iff the vector of literals is empty or if the constraint is
falsified after unit propagationISolver.removeConstr(IConstr)public boolean model(int var)
model in interface RandomAccessModelpublic int nextFreeVarId(boolean reserve)
nextFreeVarId in interface ISolverpublic int[] primeImplicant()
primeImplicant in interface IProblempublic boolean primeImplicant(int p)
primeImplicant in interface IProblempublic IConstr addAtMost(IVecInt literals, IVecInt coeffs, int degree) throws ContradictionException
IPBSolveraddAtMost in interface IPBSolverliterals - a set of literals The vector can be reused since the solver is
not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.degree - the degree of the pseudo-boolean constraintContradictionException - iff the constraint is found trivially unsat.ISolver.removeConstr(IConstr)public boolean isSatisfiable()
throws TimeoutException
isSatisfiable in interface IProblemTimeoutExceptionpublic boolean isSatisfiable(IVecInt assumps, boolean globalTimeout) throws TimeoutException
isSatisfiable in interface IProblemTimeoutExceptionpublic void registerLiteral(int p)
registerLiteral in interface ISolverpublic void setExpectedNumberOfClauses(int nb)
setExpectedNumberOfClauses in interface ISolverpublic IConstr addAtMost(IVecInt literals, IVec<BigInteger> coeffs, BigInteger degree) throws ContradictionException
IPBSolveraddAtMost in interface IPBSolverliterals - a set of literals The vector can be reused since the solver is
not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.degree - the degree of the pseudo-boolean constraintContradictionException - iff the constraint is found trivially unsat.ISolver.removeConstr(IConstr)public boolean isSatisfiable(boolean globalTimeout)
throws TimeoutException
isSatisfiable in interface IProblemTimeoutExceptionpublic IConstr addClause(IVecInt literals) throws ContradictionException
addClause in interface ISolverContradictionExceptionpublic boolean isSatisfiable(IVecInt assumps) throws TimeoutException
isSatisfiable in interface IProblemTimeoutExceptionpublic IConstr addAtLeast(IVecInt literals, IVecInt coeffs, int degree) throws ContradictionException
IPBSolveraddAtLeast in interface IPBSolverliterals - a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.degree - the degree of the pseudo-boolean constraintContradictionException - iff the constraint is found trivially unsat.ISolver.removeConstr(IConstr)public int[] findModel()
throws TimeoutException
findModel in interface IProblemTimeoutExceptionpublic IConstr addBlockingClause(IVecInt literals) throws ContradictionException
addBlockingClause in interface ISolverContradictionExceptionpublic IConstr discardCurrentModel() throws ContradictionException
discardCurrentModel in interface ISolverContradictionExceptionpublic IVecInt createBlockingClauseForCurrentModel()
createBlockingClauseForCurrentModel in interface ISolverpublic boolean removeConstr(IConstr c)
removeConstr in interface ISolverpublic int[] findModel(IVecInt assumps) throws TimeoutException
findModel in interface IProblemTimeoutExceptionpublic IConstr addAtLeast(IVecInt literals, IVec<BigInteger> coeffs, BigInteger degree) throws ContradictionException
IPBSolveraddAtLeast in interface IPBSolverliterals - a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.degree - the degree of the pseudo-boolean constraintContradictionException - iff the constraint is found trivially unsat.ISolver.removeConstr(IConstr)public boolean removeSubsumedConstr(IConstr c)
removeSubsumedConstr in interface ISolverpublic int nConstraints()
nConstraints in interface IProblempublic void addAllClauses(IVec<IVecInt> clauses) throws ContradictionException
addAllClauses in interface ISolverContradictionExceptionpublic IConstr addExactly(IVecInt literals, IVecInt coeffs, int weight) throws ContradictionException
IPBSolveraddExactly in interface IPBSolverliterals - a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.weight - the number of literals that must be satisfiedContradictionException - iff the constraint is trivially unsatisfiable.public void printInfos(PrintWriter out, String prefix)
printInfos in interface IProblempublic IConstr addAtMost(IVecInt literals, int degree) throws ContradictionException
addAtMost in interface ISolverContradictionExceptionpublic IConstr addExactly(IVecInt literals, IVec<BigInteger> coeffs, BigInteger weight) throws ContradictionException
IPBSolveraddExactly in interface IPBSolverliterals - a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.coeffs - the coefficients of the literals. The vector can be reused
since the solver is not supposed to keep a reference to that
vector.weight - the number of literals that must be satisfiedContradictionException - iff the constraint is trivially unsatisfiable.public void printInfos(PrintWriter out)
printInfos in interface IProblempublic IConstr addAtLeast(IVecInt literals, int degree) throws ContradictionException
addAtLeast in interface ISolverContradictionExceptionpublic void setObjectiveFunction(ObjectiveFunction obj)
IPBSolversetObjectiveFunction in interface IPBSolverobj - the objective functionpublic ObjectiveFunction getObjectiveFunction()
IPBSolvergetObjectiveFunction in interface IPBSolverpublic IConstr addExactly(IVecInt literals, int n) throws ContradictionException
addExactly in interface ISolverContradictionExceptionpublic void setTimeout(int t)
setTimeout in interface ISolverpublic void setTimeoutOnConflicts(int count)
setTimeoutOnConflicts in interface ISolverpublic void setTimeoutMs(long t)
setTimeoutMs in interface ISolverpublic int getTimeout()
getTimeout in interface ISolverpublic long getTimeoutMs()
getTimeoutMs in interface ISolverpublic void expireTimeout()
expireTimeout in interface ISolverpublic void printStat(PrintStream out, String prefix)
public void printStat(PrintWriter out, String prefix)
public void printStat(PrintWriter out)
public void clearLearntClauses()
clearLearntClauses in interface ISolverpublic void setDBSimplificationAllowed(boolean status)
setDBSimplificationAllowed in interface ISolverpublic boolean isDBSimplificationAllowed()
isDBSimplificationAllowed in interface ISolverpublic <S extends ISolverService> void setSearchListener(SearchListener<S> sl)
setSearchListener in interface ISolverpublic <S extends ISolverService> SearchListener<S> getSearchListener()
getSearchListener in interface ISolverpublic void setVerbose(boolean value)
setVerbose in interface ISolverpublic void setLogPrefix(String prefix)
setLogPrefix in interface ISolverpublic String getLogPrefix()
getLogPrefix in interface ISolverpublic IVecInt unsatExplanation()
unsatExplanation in interface ISolverpublic int[] modelWithInternalVariables()
modelWithInternalVariables in interface ISolverpublic int realNumberOfVariables()
realNumberOfVariables in interface ISolverpublic boolean isSolverKeptHot()
isSolverKeptHot in interface ISolverpublic void setKeepSolverHot(boolean keepHot)
setKeepSolverHot in interface ISolverpublic ISolver getSolvingEngine()
getSolvingEngine in interface ISolverpublic void setUnitClauseProvider(UnitClauseProvider ucp)
setUnitClauseProvider in interface ISolverpublic AssignmentOrigin getOriginInModel(int p)
getOriginInModel in interface ISolverpublic void setUnitClauseConsumer(UnitClauseConsumer ucc)
setUnitClauseConsumer in interface ISolverCopyright © 2020 Centre de Recherche en Informatique de Lens (CRIL). All rights reserved.