|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILits
That interface manages the solver's internal vocabulary. Everything related to variables and literals is available from here. For sake of efficiency, literals and variables are not object in SAT4J. They are represented by numbers. If the vocabulary contains n variables, then variables should be accessed by numbers from 1 to n and literals by numbers from 2 to 2*n+1. For a Dimacs variable v, the variable index in SAT4J is v, it's positive literal is 2*v (v << 1) and it's negative literal is 2*v+1 ((v<<1)^1). Note that one can easily access to the complementary literal of p by using bitwise operation ^. In SAT4J, literals are usualy denoted by p or q and variables by v or x.
Field Summary | |
---|---|
static int |
UNDEFINED
|
Method Summary | |
---|---|
void |
attach(int lit,
Propagatable c)
|
IVec<Propagatable> |
attaches(int lit)
|
boolean |
belongsToPool(int x)
Returns true iff the variable is used in the set of constraints. |
void |
ensurePool(int howmany)
|
int |
getFromPool(int x)
Translates a Dimacs literal into an internal representation literal. |
int |
getLevel(int lit)
|
Constr |
getReason(int lit)
|
void |
init(int nvar)
|
boolean |
isFalsified(int lit)
|
boolean |
isImplied(int lit)
|
boolean |
isSatisfied(int lit)
|
boolean |
isUnassigned(int lit)
|
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)
|
void |
resetPool()
|
void |
satisfies(int lit)
|
void |
setLevel(int lit,
int l)
|
void |
setReason(int lit,
Constr r)
|
void |
unassign(int lit)
|
IVec<Undoable> |
undos(int lit)
|
java.lang.String |
valueToString(int lit)
|
Field Detail |
---|
static final int UNDEFINED
Method Detail |
---|
void init(int nvar)
int getFromPool(int x)
x
- the Dimacs literal (a non null integer).
boolean belongsToPool(int x)
x
-
void resetPool()
void ensurePool(int howmany)
void unassign(int lit)
void satisfies(int lit)
boolean isSatisfied(int lit)
boolean isFalsified(int lit)
boolean isUnassigned(int lit)
boolean isImplied(int lit)
lit
-
int nVars()
int realnVars()
int not(int lit)
void reset(int lit)
int getLevel(int lit)
void setLevel(int lit, int l)
Constr getReason(int lit)
void setReason(int lit, Constr r)
IVec<Undoable> undos(int lit)
void attach(int lit, Propagatable c)
IVec<Propagatable> attaches(int lit)
lit
- a literal
java.lang.String valueToString(int lit)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |