|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
choco.cp.solver.constraints.integer.bool.sat.ClauseStore
public final class ClauseStore
A global constraint to store and propagate all clauses
Field Summary | |
---|---|
protected int[][][] |
clause_entailed
|
protected IStateIntVector |
clauses_not_entailed
|
boolean |
efficient_entailment_test
|
protected int[] |
fineDegree
|
protected LinkedList<IntDomainVar> |
instToOne
|
protected LinkedList<IntDomainVar> |
instToZero
|
protected ArrayList<WLClause> |
listclause
|
protected LinkedList<WLClause> |
listToPropagate
|
protected int |
nbNonBinaryClauses
|
static boolean |
nonincprop
|
protected Lits |
voc
|
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
cIndices, constraintType, extensions, vars |
Fields inherited from class choco.kernel.solver.propagation.Propagator |
---|
active, constAwakeEvent, priority, propagationEngine |
Fields inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
LOGGER |
Constructor Summary | |
---|---|
ClauseStore(IntDomainVar[] vars,
ArrayList<WLClause> listclause,
Lits voc,
IEnvironment environment)
|
|
ClauseStore(IntDomainVar[] vars,
IEnvironment environment)
|
Method Summary | |
---|---|
void |
addClause(int[] lits)
|
void |
addClause(IntDomainVar[] positivelits,
IntDomainVar[] negativelits)
add a clause in the store WARNING : this method assumes that the variables are in the scope of the ClauseStore |
void |
addNoGood(IntDomainVar[] positivelits,
IntDomainVar[] negativelits)
|
void |
awake()
Propagation: Propagating the constraint for the very first time until local consistency is reached. |
void |
awakeOnInst(int idx)
Default propagation on instantiation: full constraint re-propagation. |
void |
clearEfficientEntailmentTest()
|
int[] |
computeLits(IntDomainVar[] plit,
IntDomainVar[] nlit)
|
void |
createEntailmentStructures()
|
void |
delete(WLClause wlc)
Remove a clause from the store |
DynWLClause |
fast_addNoGood(int[] lits)
Add a clause given the set of literals |
void |
filterFromScratch()
|
void |
filterOnInst(int idx)
|
int |
findIndex(IntDomainVar v)
|
ArrayList<WLClause> |
getClauses()
|
int |
getFilteredEventMask(int idx)
|
int |
getFineDegree(int idx)
Some global constraint might be able to provide some fine grained information about the "real" degree of a variables. |
int |
getNbClause()
|
int |
getNbEntailedClauseFrom(int idx,
int val)
|
Lits |
getVoc()
|
void |
initEntailmentStructures()
|
Boolean |
isEntailed()
Indicates if the constraint is entailed, from now on will be always satisfied |
boolean |
isSatisfied()
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple) |
boolean |
isSatisfied(int[] tuple)
TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet ! |
void |
maintainEfficientEntailment(int idx,
int val)
|
void |
printClauses()
|
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
void |
propagateUnitClause()
|
static IntDomainVar[] |
removeRedundantVars(IntDomainVar[] vs)
|
void |
setEfficientEntailmentTest()
|
void |
updateDegree(int[] lit)
|
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnInf, awakeOnRem, awakeOnRemovals, awakeOnSup, getConstraintType, isConsistent |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, opposite, pretty, setConstraintIndex, setExtension, setVar, toString |
Methods inherited from class choco.kernel.solver.propagation.Propagator |
---|
activate, constAwake, fail, getEvent, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean nonincprop
public boolean efficient_entailment_test
protected final Lits voc
protected final ArrayList<WLClause> listclause
protected final LinkedList<WLClause> listToPropagate
protected final LinkedList<IntDomainVar> instToOne
protected final LinkedList<IntDomainVar> instToZero
protected final int[] fineDegree
protected int nbNonBinaryClauses
protected int[][][] clause_entailed
protected IStateIntVector clauses_not_entailed
Constructor Detail |
---|
public ClauseStore(IntDomainVar[] vars, IEnvironment environment)
vars
- must be a table of BooleanVarImplenvironment
- public ClauseStore(IntDomainVar[] vars, ArrayList<WLClause> listclause, Lits voc, IEnvironment environment)
Method Detail |
---|
public ArrayList<WLClause> getClauses()
public void setEfficientEntailmentTest()
public void clearEfficientEntailmentTest()
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
public Lits getVoc()
public void awakeOnInst(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
ContradictionException
public void filterOnInst(int idx) throws ContradictionException
ContradictionException
public void maintainEfficientEntailment(int idx, int val)
public void addClause(int[] lits)
public static IntDomainVar[] removeRedundantVars(IntDomainVar[] vs)
public int[] computeLits(IntDomainVar[] plit, IntDomainVar[] nlit)
public void updateDegree(int[] lit)
public void addClause(IntDomainVar[] positivelits, IntDomainVar[] negativelits)
positivelits
- negativelits
- public int findIndex(IntDomainVar v)
public void addNoGood(IntDomainVar[] positivelits, IntDomainVar[] negativelits)
public DynWLClause fast_addNoGood(int[] lits)
lits
-
public void delete(WLClause wlc)
wlc
- public void createEntailmentStructures()
public void initEntailmentStructures()
public void awake() throws ContradictionException
Propagator
awake
in class Propagator
ContradictionException
- contradiction exceptionpublic void propagateUnitClause() throws ContradictionException
ContradictionException
public void propagate() throws ContradictionException
Propagator
propagate
in class Propagator
ContradictionException
- contradiction exceptionpublic void filterFromScratch() throws ContradictionException
ContradictionException
public Boolean isEntailed()
AbstractSConstraint
isEntailed
in class AbstractSConstraint<IntDomainVar>
public boolean isSatisfied()
AbstractIntSConstraint
isSatisfied
in interface SConstraint<IntDomainVar>
isSatisfied
in class AbstractIntSConstraint
public boolean isSatisfied(int[] tuple)
AbstractIntSConstraint
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
public int getFineDegree(int idx)
AbstractSConstraint
getFineDegree
in interface SConstraint<IntDomainVar>
getFineDegree
in class AbstractSConstraint<IntDomainVar>
idx
- index of the variable in the constraint
public int getNbEntailedClauseFrom(int idx, int val)
public int getNbClause()
public final void printClauses()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |