|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sat4j.minisat.constraints.cnf.WLClause
public final class WLClause
Lazy data structure for clause using Watched Literals.
Constructor Summary | |
---|---|
WLClause(IVecInt ps,
ILits voc)
Creates a new basic clause |
Method Summary | |
---|---|
void |
assertConstraint(UnitPropagationListener s)
Method called when the constraint is to be asserted. |
static WLClause |
brandNewClause(UnitPropagationListener s,
ILits voc,
IVecInt literals)
Creates a brand new clause, presumably from external data. |
void |
calcReason(int p,
IVecInt outReason)
Calcule la cause de l'affection d'un litt? |
int |
get(int i)
Retourne le ieme literal de la clause. |
double |
getActivity()
|
int |
getId()
|
void |
incActivity(double claInc)
|
static int |
lastid()
|
boolean |
learnt()
|
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 |
register()
Register this clause which means watching the necessary literals If the clause is learnt, setLearnt() must be called before a call to register() |
void |
remove()
Enl? |
void |
rescaleBy(double d)
Rescale the clause activity by a value. |
static void |
resetIds()
|
static IVecInt |
sanityCheck(IVecInt ps,
ILits voc,
UnitPropagationListener s)
Perform some sanity check before constructing a clause a) if a literal is assigned true, return null (the clause is satisfied) b) if a literal is assigned false, remove it c) if a clause contains a literal and its opposite (tautology) return null d) remove duplicate literals e) if the clause is empty, return null f) if the clause if unit, transmit it to the object responsible for unit propagation |
void |
setLearnt()
declares this clause as learnt |
boolean |
simplify()
Simplifie une contrainte, par exemple en enlevant les litt? |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WLClause(IVecInt ps, ILits voc)
voc
- the vocabulary of the formulaps
- A VecInt that WILL BE EMPTY after calling that method.Method Detail |
---|
public int getId()
public static void resetIds()
public static IVecInt sanityCheck(IVecInt ps, ILits voc, UnitPropagationListener s) throws ContradictionException
ps
- the list of literalsvoc
- the vocabulary useds
- the object responsible for unit propagation
ContradictionException
- if discovered by unit propagationpublic void setLearnt()
setLearnt
in interface Constr
public void register()
register
in interface Constr
setLearnt()
public static WLClause brandNewClause(UnitPropagationListener s, ILits voc, IVecInt literals)
s
- the object responsible for unit propagationvoc
- the vocabularyliterals
- the literals to store in the clause
public void calcReason(int p, IVecInt outReason)
Constr
calcReason
in interface Constr
p
- un litt?ral falsifi? (ou Lit.UNDEFINED)outReason
- la liste des litt?raux falsifi?s dont la n?gation correspond ?
la raison de l'affectation.public void remove()
Constr
remove
in interface Constr
public boolean simplify()
Constr
simplify
in interface 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
locked
in interface Constr
public double getActivity()
getActivity
in interface Constr
public java.lang.String toString()
toString
in class java.lang.Object
public int get(int i)
get
in interface IConstr
i
- the index of the literal
public void incActivity(double claInc)
incActivity
in interface Constr
claInc
- public void rescaleBy(double d)
Constr
rescaleBy
in interface Constr
d
- public boolean learnt()
learnt
in interface IConstr
public int size()
size
in interface IConstr
public static int lastid()
public void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint
in interface Constr
s
- a UnitPropagationListener to use for unit propagation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |