|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.tools.SolverDecorator<T> org.sat4j.tools.ClausalCardinalitiesDecorator<T>
T
- public class ClausalCardinalitiesDecorator<T extends ISolver>
A decorator for clausal cardinalities constraints.
Constructor Summary | |
---|---|
ClausalCardinalitiesDecorator(T solver)
|
|
ClausalCardinalitiesDecorator(T solver,
EncodingStrategyAdapter encodingAd)
|
Method Summary | |
---|---|
IConstr |
addAtLeast(IVecInt literals,
int k)
Create a cardinality constraint of the type "at least n of those literals must be satisfied" |
IConstr |
addAtMost(IVecInt literals,
int k)
Create a cardinality constraint of the type "at most n of those literals must be satisfied" |
IConstr |
addExactly(IVecInt literals,
int k)
Create a cardinality constraint of the type "exactly n of those literals must be satisfied". |
String |
toString()
|
String |
toString(String prefix)
Display a textual representation of the solver configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClausalCardinalitiesDecorator(T solver)
public ClausalCardinalitiesDecorator(T solver, EncodingStrategyAdapter encodingAd)
Method Detail |
---|
public IConstr addAtLeast(IVecInt literals, int k) 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.k
- the degree (n) of the cardinality constraint
ContradictionException
- iff the vector of literals is empty or if degree literals are
not remaining unfalsified after unit propagationISolver.removeConstr(IConstr)
public IConstr addAtMost(IVecInt literals, int k) 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.k
- the degree (n) of the cardinality constraint
ContradictionException
- iff the vector of literals is empty or if it contains more
than degree satisfied literals after unit propagationISolver.removeConstr(IConstr)
public IConstr addExactly(IVecInt literals, int k) 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.k
- the number of literals that must be satisfied
ContradictionException
- iff the constraint is trivially unsatisfiable.public String toString()
toString
in class SolverDecorator<T extends ISolver>
public String toString(String prefix)
ISolver
toString
in interface ISolver
toString
in class SolverDecorator<T extends ISolver>
prefix
- the prefix to use on each line.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |