org.sat4j.minisat.core
Interface ILits

All Known Subinterfaces:
ILits2, ILits23, IMarkableLits
All Known Implementing Classes:
Lits, Lits2, Lits23, MarkableLits

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.

Author:
leberre

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

UNDEFINED

static final int UNDEFINED
See Also:
Constant Field Values
Method Detail

init

void init(int nvar)

getFromPool

int getFromPool(int x)
Translates a Dimacs literal into an internal representation literal.

Parameters:
x - the Dimacs literal (a non null integer).
Returns:
the literal in the internal representation.

belongsToPool

boolean belongsToPool(int x)
Returns true iff the variable is used in the set of constraints.

Parameters:
x -
Returns:
true iff the variable belongs to the formula.

resetPool

void resetPool()

ensurePool

void ensurePool(int howmany)

unassign

void unassign(int lit)

satisfies

void satisfies(int lit)

isSatisfied

boolean isSatisfied(int lit)

isFalsified

boolean isFalsified(int lit)

isUnassigned

boolean isUnassigned(int lit)

isImplied

boolean isImplied(int lit)
Parameters:
lit -
Returns:
true iff the truth value of that literal is due to a unit propagation or a decision.

nVars

int nVars()
to obtain the max id of the variable

Returns:
the maximum number of variables in the formula

realnVars

int realnVars()
to obtain the real number of variables appearing in the formula

Returns:
the number of variables used in the pool

not

int not(int lit)

reset

void reset(int lit)

getLevel

int getLevel(int lit)

setLevel

void setLevel(int lit,
              int l)

getReason

Constr getReason(int lit)

setReason

void setReason(int lit,
               Constr r)

undos

IVec<Undoable> undos(int lit)

attach

void attach(int lit,
            Propagatable c)

attaches

IVec<Propagatable> attaches(int lit)
Parameters:
lit - a literal
Returns:
the list of all the constraints that watch the negation of lit

valueToString

java.lang.String valueToString(int lit)


Copyright © 2009 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.