public abstract class WLClause extends Object implements Propagatable, Constr, Serializable
Modifier and Type | Field and Description |
---|---|
protected double |
activity |
protected int[] |
lits |
protected ILits |
voc |
Constructor and Description |
---|
WLClause(IVecInt ps,
ILits voc)
Creates a new basic clause
|
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".
|
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.
|
boolean |
equals(Object obj) |
int |
get(int i)
Retourne le ieme literal de la clause.
|
double |
getActivity()
To obtain the activity of the constraint.
|
int[] |
getLits() |
ILits |
getVocabulary() |
int |
hashCode() |
boolean |
locked()
Indicate wether a constraint is responsible from an assignment.
|
boolean |
propagate(UnitPropagationListener s,
int p)
Propagate the truth value of a literal in constraints in which that
literal is falsified.
|
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
|
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() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forwardActivity, incActivity, register, setLearnt
protected double activity
protected final int[] lits
protected final ILits voc
public void calcReason(int p, IVecInt outReason)
Constr
Propagatable.propagate(UnitPropagationListener, int)
.calcReason
in interface Constr
p
- 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 void remove(UnitPropagationListener upl)
Constr
public boolean simplify()
Constr
public boolean propagate(UnitPropagationListener s, int p)
Propagatable
propagate
in interface Propagatable
s
- something able to perform unit propagationp
- the literal being propagated. Its negation must appear in the
constraint.public boolean locked()
Constr
public double getActivity()
IConstr
getActivity
in interface IConstr
public void setActivity(double d)
Constr
setActivity
in interface Constr
d
- the new activitypublic int get(int i)
public void rescaleBy(double d)
Constr
public int size()
public void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint
in interface Constr
s
- a UnitPropagationListener to use for unit propagation.public void assertConstraintIfNeeded(UnitPropagationListener s)
Constr
Constr.assertConstraint(UnitPropagationListener)
method.assertConstraintIfNeeded
in interface Constr
s
- a UnitPropagationListener to use for unit propagation.public ILits getVocabulary()
public int[] getLits()
public boolean canBePropagatedMultipleTimes()
IConstr
canBePropagatedMultipleTimes
in interface IConstr
public Constr toConstraint()
Propagatable
toConstraint
in interface Propagatable
public void calcReasonOnTheFly(int p, IVecInt trail, IVecInt outReason)
Constr
Constr.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 Constr
p
- 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.