|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.minisat.constraints.cnf.HTClause
public abstract class HTClause
Lazy data structure for clause using the Head Tail data structure from SATO, The original scheme is improved by avoiding moving pointers to literals but moving the literals themselves. We suppose here that the clause contains at least 3 literals. Use the BinaryClause or UnaryClause clause data structures to deal with binary and unit clauses.
BinaryClause,
UnitClause,
Serialized Form| Field Summary | |
|---|---|
protected double |
activity
|
protected int |
head
|
protected int[] |
middleLits
|
protected int |
tail
|
protected ILits |
voc
|
| Constructor Summary | |
|---|---|
HTClause(IVecInt ps,
ILits voc)
Creates a new basic clause |
|
| Method Summary | |
|---|---|
void |
assertConstraint(UnitPropagationListener s)
Method called when the constraint is to be asserted. |
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. |
boolean |
equals(Object obj)
|
int |
get(int i)
Return the ith literal of the 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. |
boolean |
simplify()
Simplifies a constraint, by removing top level falsified literals for instance. |
int |
size()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.sat4j.minisat.core.Constr |
|---|
forwardActivity, incActivity, register, setLearnt |
| Methods inherited from interface org.sat4j.specs.IConstr |
|---|
learnt |
| Field Detail |
|---|
protected double activity
protected final int[] middleLits
protected final ILits voc
protected int head
protected int tail
| Constructor Detail |
|---|
public HTClause(IVecInt ps,
ILits voc)
voc - the vocabulary of the formulaps - A VecInt that WILL BE EMPTY after calling that method.| Method Detail |
|---|
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 void remove(UnitPropagationListener upl)
Constr
remove in interface Constrpublic boolean simplify()
Constr
simplify 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 locked()
Constr
locked in interface Constrpublic double getActivity()
IConstr
getActivity in interface IConstrpublic String toString()
toString in class Objectpublic int get(int i)
get in interface IConstri - the index of the literal
public void rescaleBy(double d)
Constr
rescaleBy in interface Constrd - public int size()
size in interface IConstrpublic void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint in interface Constrs - a UnitPropagationListener to use for unit propagation.public ILits getVocabulary()
public int[] getLits()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean canBePropagatedMultipleTimes()
IConstr
canBePropagatedMultipleTimes in interface IConstr
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||