|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.minisat.constraints.card.AtLeast
public class AtLeast
| Field Summary | |
|---|---|
protected int[] |
lits
constraint literals |
protected int |
maxUnsatisfied
number of allowed falsified literal |
protected ILits |
voc
|
| Constructor Summary | |
|---|---|
protected |
AtLeast(ILits voc,
IVecInt ps,
int degree)
|
| Method Summary | |
|---|---|
void |
assertConstraint(UnitPropagationListener s)
Method called when the constraint is to be asserted. |
static Constr |
atLeastNew(UnitPropagationListener s,
ILits voc,
IVecInt ps,
int n)
|
void |
calcReason(int p,
IVecInt outReason)
Compute the reason for a given assignment. |
boolean |
canBePropagatedMultipleTimes()
Partition constraints into the ones that can only be found once on the trail (e.g. clauses) and the ones that can be found several times (e.g. |
void |
forwardActivity(double claInc)
|
int |
get(int i)
returns the ith literal in the constraint |
double |
getActivity()
To obtain the activity of the constraint. |
void |
incActivity(double claInc)
Increase the constraint activity. |
boolean |
learnt()
|
boolean |
locked()
Indicate wether a constraint is responsible from an assignment. |
protected static int |
niceParameters(UnitPropagationListener s,
ILits voc,
IVecInt ps,
int deg)
|
boolean |
propagate(UnitPropagationListener s,
int p)
Propagate the truth value of a literal in constraints in which that literal is falsified. |
void |
register()
Register the constraint to the solver. |
void |
remove(UnitPropagationListener upl)
Remove a constraint from the solver. |
void |
rescaleBy(double d)
Rescale the clause activity by a value. |
void |
setActivity(double d)
Set the activity at a specific value |
void |
setLearnt()
Mark a constraint as learnt. |
boolean |
simplify()
Simplifies a constraint, by removing top level falsified literals for instance. |
int |
size()
|
Constr |
toConstraint()
Allow to access a constraint view of the propagatable to avoid casting. |
String |
toString()
Textual representation of the constraint |
void |
undo(int p)
Method called when backtracking |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int maxUnsatisfied
protected final int[] lits
protected final ILits voc
| Constructor Detail |
|---|
protected AtLeast(ILits voc,
IVecInt ps,
int degree)
ps - a vector of literalsdegree - the minimal number of satisfied literals| Method Detail |
|---|
protected static int niceParameters(UnitPropagationListener s,
ILits voc,
IVecInt ps,
int deg)
throws ContradictionException
ContradictionException
public static Constr atLeastNew(UnitPropagationListener s,
ILits voc,
IVecInt ps,
int n)
throws ContradictionException
ContradictionExceptionpublic void remove(UnitPropagationListener upl)
Constr
remove in interface Constr
public boolean propagate(UnitPropagationListener s,
int p)
Propagatable
propagate in interface Propagatables - something able to perform unit propagationp - the literal being propagated. Its negation must appear in the
constraint.
public boolean simplify()
Constr
simplify in interface Constrpublic void undo(int p)
Undoable
undo in interface Undoablep - a literal to be unassigned.
public void calcReason(int p,
IVecInt outReason)
Constr
calcReason in interface Constrp - a satisfied literal (or Lit.UNDEFINED)outReason - the list of falsified literals whose negation is the reason of
the assignment of p to true.public boolean learnt()
learnt in interface IConstrpublic double getActivity()
IConstr
getActivity in interface IConstrpublic void setActivity(double d)
Constr
setActivity in interface Constrd - the new activitypublic void incActivity(double claInc)
Constr
incActivity in interface ConstrclaInc - the value to increase the activity withpublic boolean locked()
Constr
locked in interface Constrpublic void setLearnt()
Constr
setLearnt in interface Constrpublic void register()
Constr
register in interface Constrpublic int size()
size in interface IConstrpublic int get(int i)
IConstr
get in interface IConstri - the index of the literal
public void rescaleBy(double d)
Constr
rescaleBy in interface Constrd - the value to rescale the clause activity with.public void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint in interface Constrs - a UnitPropagationListener to use for unit propagation.public String toString()
toString in class Objectpublic void forwardActivity(double claInc)
forwardActivity in interface Constrpublic boolean canBePropagatedMultipleTimes()
IConstr
canBePropagatedMultipleTimes in interface IConstrpublic Constr toConstraint()
Propagatable
toConstraint in interface Propagatable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||