|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.minisat.constraints.pb.WatchPb
public abstract class WatchPb
Field Summary | |
---|---|
protected double |
activity
constraint activity |
static boolean |
ATLEAST
constant for the initial type of inequality more than or equal |
static boolean |
ATMOST
constant for the initial type of inequality less than or equal |
protected java.math.BigInteger[] |
coefs
coefficients of the literals of the constraint |
protected java.math.BigInteger |
degree
degree of the pseudo-boolean constraint |
protected boolean |
learnt
true if the constraint is a learned constraint |
protected int[] |
lits
literals of the constraint |
protected boolean |
locked
true if the constraint is the origin of unit propagation |
protected ILits |
voc
constraint's vocabulary |
protected java.math.BigInteger |
watchCumul
sum of the coefficients of the literals satisfied or unvalued |
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 the assignment of a literal |
boolean |
coefficientsEqualToOne()
|
IVecInt |
computeAnImpliedClause()
compute an implied clause on the literals with the greater coefficients |
protected abstract void |
computePropagation(UnitPropagationListener s)
|
protected abstract void |
computeWatches()
|
int |
get(int i)
to obtain the i-th literal of the constraint |
double |
getActivity()
to obtain the activity value of the constraint |
java.math.BigInteger |
getCoef(int i)
to obtain the coefficient of the i-th literal of the constraint |
java.math.BigInteger[] |
getCoefs()
|
java.math.BigInteger |
getDegree()
|
int[] |
getLits()
|
ILits |
getVocabulary()
|
void |
incActivity(double claInc)
increase activity value of the constraint |
boolean |
isAssertive(int dl)
This predicate tests wether the constraint is assertive at decision level dl |
protected boolean |
isSatisfiable()
D? |
boolean |
learnt()
is the constraint a learnt constrainte ? |
boolean |
locked()
The constraint is the reason of a unit propagation. |
static IDataStructurePB |
niceCheckedParameters(IVecInt ps,
IVec<java.math.BigInteger> bigCoefs,
boolean moreThan,
java.math.BigInteger bigDeg,
ILits voc)
|
static IDataStructurePB |
niceParameters(IVecInt ps,
IVec<java.math.BigInteger> bigCoefs,
boolean moreThan,
java.math.BigInteger bigDeg,
ILits voc)
|
protected static java.math.BigInteger |
ppcm(java.math.BigInteger a,
java.math.BigInteger b)
Calcule le ppcm de deux nombres |
java.math.BigInteger |
recalcLeftSide()
compute the sum of the coefficients of the satisfied or non-assigned literals of the current constraint (usually called poss) |
java.math.BigInteger |
recalcLeftSide(java.math.BigInteger[] coefs)
compute the sum of the coefficients of the satisfied or non-assigned literals of a described constraint (usually called poss) |
void |
register()
Register the constraint to the solver. |
void |
rescaleBy(double d)
Permet le r?????? |
void |
setLearnt()
La contrainte est apprise |
boolean |
simplify()
Simplifie la contrainte(l'all??? |
int |
size()
|
java.math.BigInteger |
slackConstraint()
compute the slack of the current constraint slack = poss - degree of the constraint |
java.math.BigInteger |
slackConstraint(java.math.BigInteger[] coefs,
java.math.BigInteger degree)
compute the slack of a described constraint slack = poss - degree of the constraint |
protected void |
sort()
sort coefficient and literal arrays |
protected void |
sort(int from,
int to)
sort partially coefficient and literal arrays |
static java.math.BigInteger |
toBigInt(int i)
|
java.lang.String |
toString()
|
static IVec<java.math.BigInteger> |
toVecBigInt(IVecInt vec)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.sat4j.minisat.core.Constr |
---|
remove |
Methods inherited from interface org.sat4j.minisat.core.Propagatable |
---|
propagate |
Methods inherited from interface org.sat4j.minisat.core.Undoable |
---|
undo |
Field Detail |
---|
public static final boolean ATMOST
public static final boolean ATLEAST
protected double activity
protected java.math.BigInteger[] coefs
protected java.math.BigInteger degree
protected int[] lits
protected boolean learnt
protected boolean locked
protected java.math.BigInteger watchCumul
protected ILits voc
Method Detail |
---|
public boolean isAssertive(int dl)
dl
-
public void calcReason(int p, IVecInt outReason)
calcReason
in interface Constr
p
- a falsified literal (or Lit.UNDEFINED)outReason
- list of falsified literals for which the negation is the reason of the assignmentConstr.calcReason(int, IVecInt)
protected abstract void computeWatches() throws ContradictionException
ContradictionException
protected abstract void computePropagation(UnitPropagationListener s) throws ContradictionException
ContradictionException
public int get(int i)
get
in interface IConstr
i
- index of the literal
public java.math.BigInteger getCoef(int i)
getCoef
in interface PBConstr
i
- index of the literal
public double getActivity()
getActivity
in interface Constr
Constr.getActivity()
public static IDataStructurePB niceParameters(IVecInt ps, IVec<java.math.BigInteger> bigCoefs, boolean moreThan, java.math.BigInteger bigDeg, ILits voc) throws ContradictionException
ContradictionException
public static IDataStructurePB niceCheckedParameters(IVecInt ps, IVec<java.math.BigInteger> bigCoefs, boolean moreThan, java.math.BigInteger bigDeg, ILits voc)
public void incActivity(double claInc)
incActivity
in interface Constr
claInc
- the value to increase the activity withConstr.incActivity(double)
public java.math.BigInteger slackConstraint()
public java.math.BigInteger slackConstraint(java.math.BigInteger[] coefs, java.math.BigInteger degree)
coefs
- coefficients of the constraintdegree
- degree of the constraint
public java.math.BigInteger recalcLeftSide(java.math.BigInteger[] coefs)
coefs
- coefficients of the constraint
public java.math.BigInteger recalcLeftSide()
protected boolean isSatisfiable()
public boolean learnt()
learnt
in interface IConstr
IConstr.learnt()
public boolean locked()
locked
in interface Constr
protected static java.math.BigInteger ppcm(java.math.BigInteger a, java.math.BigInteger b)
a
- premier nombre de l'op?rationb
- second nombre de l'op?ration
public void rescaleBy(double d)
rescaleBy
in interface Constr
d
- facteur d'ajustementpublic void setLearnt()
setLearnt
in interface Constr
public boolean simplify()
simplify
in interface Constr
public int size()
size
in interface IConstr
protected final void sort()
protected final void sort(int from, int to)
from
- index for the beginning of the sortto
- index for the end of the sortpublic java.lang.String toString()
toString
in class java.lang.Object
public void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint
in interface Constr
s
- a UnitPropagationListener to use for unit propagation.public java.math.BigInteger getDegree()
getDegree
in interface PBConstr
public void register()
Constr
register
in interface Constr
public static IVec<java.math.BigInteger> toVecBigInt(IVecInt vec)
public static java.math.BigInteger toBigInt(int i)
public java.math.BigInteger[] getCoefs()
getCoefs
in interface PBConstr
public int[] getLits()
getLits
in interface PBConstr
public ILits getVocabulary()
getVocabulary
in interface PBConstr
public IVecInt computeAnImpliedClause()
computeAnImpliedClause
in interface PBConstr
public boolean coefficientsEqualToOne()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |