public class AtLeast extends Object implements Propagatable, Constr, Undoable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
lits
constraint literals
|
protected int |
maxUnsatisfied
number of allowed falsified literal
|
protected ILits |
voc |
| Constructor and Description |
|---|
AtLeast(ILits voc,
IVecInt ps,
int degree) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertConstraint(UnitPropagationListener s)
Method called when the constraint is to be asserted.
|
void |
assertConstraintIfNeeded(UnitPropagationListener s)
Method called when the constraint is added to the solver "on the fly".
|
static Constr |
atLeastNew(UnitPropagationListener s,
ILits voc,
IVecInt ps,
int n) |
void |
calcReason(int p,
IVecInt outReason)
Compute the reason for a given assignment.
|
void |
calcReasonOnTheFly(int p,
IVecInt trail,
IVecInt outReason)
Compute the reason for a given assignment in a the constraint created on
the fly in the solver.
|
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
|
protected int maxUnsatisfied
protected final int[] lits
protected final ILits voc
protected static int niceParameters(UnitPropagationListener s, ILits voc, IVecInt ps, int deg) throws ContradictionException
ContradictionExceptionpublic static Constr atLeastNew(UnitPropagationListener s, ILits voc, IVecInt ps, int n) throws ContradictionException
ContradictionExceptionpublic void remove(UnitPropagationListener upl)
Constrpublic boolean propagate(UnitPropagationListener s, int p)
Propagatablepropagate in interface Propagatables - something able to perform unit propagationp - the literal being propagated. Its negation must appear in the
constraint.public boolean simplify()
Constrpublic void undo(int p)
Undoablepublic void calcReason(int p,
IVecInt outReason)
ConstrPropagatable.propagate(UnitPropagationListener, int).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()
public double getActivity()
IConstrgetActivity in interface IConstrpublic void setActivity(double d)
ConstrsetActivity in interface Constrd - the new activitypublic void incActivity(double claInc)
ConstrincActivity in interface ConstrclaInc - the value to increase the activity withpublic boolean locked()
Constrpublic void setLearnt()
Constrpublic void register()
Constrpublic int size()
public int get(int i)
IConstrpublic void rescaleBy(double d)
Constrpublic void assertConstraint(UnitPropagationListener s)
ConstrassertConstraint in interface Constrs - a UnitPropagationListener to use for unit propagation.public void assertConstraintIfNeeded(UnitPropagationListener s)
ConstrConstr.assertConstraint(UnitPropagationListener) method.assertConstraintIfNeeded in interface Constrs - a UnitPropagationListener to use for unit propagation.public String toString()
public void forwardActivity(double claInc)
forwardActivity in interface Constrpublic boolean canBePropagatedMultipleTimes()
IConstrcanBePropagatedMultipleTimes in interface IConstrpublic Constr toConstraint()
PropagatabletoConstraint in interface Propagatablepublic void calcReasonOnTheFly(int p,
IVecInt trail,
IVecInt outReason)
ConstrConstr.calcReason(int, IVecInt), the falsification may not have been
detected as soon as possible. As such, it is necessary to take into
account the order of the literals in the trail.calcReasonOnTheFly in interface Constrp - a satisfied literal (or Lit.UNDEFINED)trail - all the literals satisfied in the solvers, should not be
modified.outReason - a list of falsified literals whose negation is the reason of
the assignment of p to true.Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.