|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.minisat.constraints.cnf.Lits
public final class Lits
Field Summary |
---|
Fields inherited from interface org.sat4j.minisat.core.ILits |
---|
UNDEFINED |
Constructor Summary | |
---|---|
Lits()
|
Method Summary | |
---|---|
boolean |
belongsToPool(int x)
Returns true iff the variable is used in the set of constraints. |
protected int |
capacity()
To get the capacity of the current vocabulary. |
void |
ensurePool(int howmany)
Make sure that all data structures are ready to manage howmany boolean variables. |
void |
forgets(int var)
Removes a variable from the formula. |
int |
getFromPool(int x)
Translates a Dimacs literal into an internal representation literal. |
int |
getLevel(int lit)
Returns the level at which that literal has been assigned a value, else -1. |
Constr |
getReason(int lit)
Returns the reason of the assignment of a literal. |
void |
init(int nvar)
|
boolean |
isFalsified(int lit)
Check if a literal is falsified. |
boolean |
isImplied(int lit)
|
boolean |
isSatisfied(int lit)
Check if a literal is satisfied. |
boolean |
isUnassigned(int lit)
Check if a literal is assigned a truth value. |
int |
nextFreeVarId(boolean reserve)
Ask the solver for a free variable identifier, in Dimacs format (i.e. a positive number). |
int |
not(int lit)
|
int |
nVars()
to obtain the max id of the variable |
int |
realnVars()
to obtain the real number of variables appearing in the formula |
void |
reset(int lit)
Reset a literal in the vocabulary. |
void |
resetPool()
reset the vocabulary. |
void |
satisfies(int lit)
Satisfies a boolean variable (truth value is TRUE). |
void |
setLevel(int lit,
int l)
Sets the decision level of a literal. |
void |
setReason(int lit,
Constr r)
Sets the reason of the assignment of a literal. |
static String |
toString(int lit)
|
void |
unassign(int lit)
Unassigns a boolean variable (truth value if UNDEF). |
IVec<Undoable> |
undos(int lit)
Retrieve the methods to call when the solver backtracks. |
String |
valueToString(int lit)
Returns a textual representation of the truth value of that literal. |
void |
watch(int lit,
Propagatable c)
Record a new constraint to watch when a literal is satisfied. |
IVec<Propagatable> |
watches(int lit)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lits()
Method Detail |
---|
public final void init(int nvar)
init
in interface ILits
public int getFromPool(int x)
ILits
getFromPool
in interface ILits
x
- the Dimacs literal (a non null integer).
public boolean belongsToPool(int x)
ILits
belongsToPool
in interface ILits
public void resetPool()
ILits
resetPool
in interface ILits
public void ensurePool(int howmany)
ILits
ensurePool
in interface ILits
howmany
- the new capacity (in boolean variables) of the vocabulary.public void unassign(int lit)
ILits
unassign
in interface ILits
lit
- a literal in internal format.public void satisfies(int lit)
ILits
satisfies
in interface ILits
lit
- a literal in internal format.public void forgets(int var)
ILits
forgets
in interface ILits
var
- a variable in Dimacs format.public boolean isSatisfied(int lit)
ILits
isSatisfied
in interface ILits
lit
- a literal in internal format.
public final boolean isFalsified(int lit)
ILits
isFalsified
in interface ILits
lit
- a literal in internal format.
public boolean isUnassigned(int lit)
ILits
isUnassigned
in interface ILits
lit
- a literal in internal format.
public String valueToString(int lit)
ILits
valueToString
in interface ILits
lit
- a literal in internal representation.
public int nVars()
ILits
nVars
in interface ILits
public int not(int lit)
public static String toString(int lit)
public void reset(int lit)
ILits
reset
in interface ILits
lit
- a literal in internal representation.public int getLevel(int lit)
ILits
getLevel
in interface ILits
lit
- a literal in internal representation.
public void setLevel(int lit, int l)
ILits
setLevel
in interface ILits
lit
- a literal in internal representation.l
- a decision level, or -1public Constr getReason(int lit)
ILits
getReason
in interface ILits
lit
- a literal in internal representation.
public void setReason(int lit, Constr r)
ILits
setReason
in interface ILits
lit
- a literal in internal representation.r
- the constraint that forces the assignment of that literal,
null if there are none.public IVec<Undoable> undos(int lit)
ILits
undos
in interface ILits
lit
- a literal in internal representation.
public void watch(int lit, Propagatable c)
ILits
watch
in interface ILits
lit
- a literal in internal representation.c
- a constraint that contains the negation of that literal.public IVec<Propagatable> watches(int lit)
watches
in interface ILits
lit
- a literal in internal representation.
public boolean isImplied(int lit)
isImplied
in interface ILits
public int realnVars()
ILits
realnVars
in interface ILits
protected int capacity()
public int nextFreeVarId(boolean reserve)
ILits
nextFreeVarId
in interface ILits
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |