T
- public class NegationDecorator<T extends ISolver> extends AbstractClauseSelectorSolver<T>
Constructor and Description |
---|
NegationDecorator(T decorated) |
Modifier and Type | Method and Description |
---|---|
IConstr |
addAtLeast(IVecInt literals,
int degree)
Create a cardinality constraint of the type "at least n of those literals
must be satisfied"
|
IConstr |
addAtMost(IVecInt literals,
int degree)
Create a cardinality constraint of the type "at most n of those literals
must be satisfied"
|
IConstr |
addClause(IVecInt literals)
Create a clause from a set of literals The literals are represented by
non null integers such that opposite literals a represented by opposite
values.
|
IConstr |
addExactly(IVecInt literals,
int n)
Create a cardinality constraint of the type
"exactly n of those literals must be satisfied".
|
Collection<Integer> |
getAddedVars() |
boolean |
isSatisfiable(IVecInt assumps,
boolean global)
Check the satisfiability of the set of constraints contained inside the
solver.
|
createNewVar, discardLastestVar, externalState, internalState, isSatisfiable, isSatisfiable, isSatisfiable
addAllClauses, addBlockingClause, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, model, model, modelWithInternalVariables, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, reset, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setVerbose, toString, toString, unsatExplanation
public NegationDecorator(T decorated)
public IConstr addClause(IVecInt literals) throws ContradictionException
ISolver
addClause
in interface ISolver
addClause
in class SolverDecorator<T extends ISolver>
literals
- a set of literalsContradictionException
- iff the vector of literals is empty or if it contains only
falsified literals after unit propagationISolver.removeConstr(IConstr)
public IConstr addAtMost(IVecInt literals, int degree) throws ContradictionException
ISolver
addAtMost
in interface ISolver
addAtMost
in class SolverDecorator<T extends ISolver>
literals
- a set of literals The vector can be reused since the solver is
not supposed to keep a reference to that vector.degree
- the degree (n) of the cardinality constraintContradictionException
- iff the vector of literals is empty or if it contains more
than degree satisfied literals after unit propagationISolver.removeConstr(IConstr)
public IConstr addAtLeast(IVecInt literals, int degree) throws ContradictionException
ISolver
addAtLeast
in interface ISolver
addAtLeast
in class SolverDecorator<T extends ISolver>
literals
- a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.degree
- the degree (n) of the cardinality constraintContradictionException
- iff the vector of literals is empty or if degree literals are
not remaining unfalsified after unit propagationISolver.removeConstr(IConstr)
public IConstr addExactly(IVecInt literals, int n) throws ContradictionException
ISolver
addExactly
in interface ISolver
addExactly
in class SolverDecorator<T extends ISolver>
literals
- a set of literals. The vector can be reused since the solver
is not supposed to keep a reference to that vector.n
- the number of literals that must be satisfiedContradictionException
- iff the constraint is trivially unsatisfiable.public boolean isSatisfiable(IVecInt assumps, boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class AbstractClauseSelectorSolver<T extends 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 Collection<Integer> getAddedVars()
getAddedVars
in class AbstractClauseSelectorSolver<T extends ISolver>
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.