choco.cp.solver.constraints.integer.bool.sat
Class WLClause
java.lang.Object
choco.cp.solver.constraints.integer.bool.sat.WLClause
- Direct Known Subclasses:
- BinaryWLClause, DynWLClause
public class WLClause
- extends Object
A clause is a set of litterals used within the watched literals
propagation based global constraint for clauses (ClauseStore)
lits
protected final int[] lits
voc
protected final Lits voc
isreg
protected boolean isreg
nogood
protected boolean nogood
idx
protected int idx
propagator
protected ClauseStore propagator
WLClause
public WLClause(int[] ps,
Lits voc)
setIdx
public void setIdx(int id)
getIdx
public int getIdx()
getLitZero
public int getLitZero()
findLiteral
public void findLiteral(int start)
register
public boolean register(ClauseStore propagator)
throws ContradictionException
- register this clause in the watching lists of the propagator.
Basically find two literals to watch
- Parameters:
propagator
-
- Throws:
ContradictionException
unregister
public void unregister()
propagate
public boolean propagate(int p,
int idxcl)
throws ContradictionException
- propagate the clause because one of the watched literals has changed
- Parameters:
p
- the watched literals that has just changedidxcl
- the index of the clause within the propagator
- Returns:
- if the literals being watche have changed
- Throws:
ContradictionException
updateDomain
public void updateDomain()
throws ContradictionException
- Throws:
ContradictionException
simplePropagation
public void simplePropagation(ClauseStore propagator)
throws ContradictionException
- propagate the clause from scratch
- Parameters:
propagator
-
- Throws:
ContradictionException
update
public boolean update()
throws ContradictionException
- Returns:
- true if the clause is properly watched by two free literals
- Throws:
ContradictionException
learnt
public boolean learnt()
size
public int size()
getVocabulary
public Lits getVocabulary()
getLits
public int[] getLits()
isSatisfied
public boolean isSatisfied()
isEntailed
public Boolean isEntailed()
isSatisfied
public boolean isSatisfied(int[] tuple)
isRegistered
public boolean isRegistered()
isNogood
public boolean isNogood()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012. All Rights Reserved.