-
- All Known Implementing Classes:
DnnfMiniSatStyleSolver
public interface DnnfSatSolverInterface for a DNNF SAT Solver.- Since:
- 2.0.0
- Version:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(Formula formula)Adds a formula to the solver.booleanassertCdLiteral()Enqueues the literal which was computed by the latest backtracking, performs UP and returnfalseif UP finds a contradiction, otherwisetrue.booleanatAssertionLevel()Returnstrueif the current decision level was previously selected as backtrack level.booleandecide(int var, boolean phase)Performs a decision of the given variable to the given phase and performs UP.LiterallitForIdx(int var)Returns the literal corresponding to the given variable index.FormulanewlyImplied(BitSet knownVariables)Returns a conjunction of all literals in the known variables which were propagated by the last UP.booleanstart()Initializes the solver by performing unit propagation and returnsfalseif UP finds a contradiction, otherwisetrue.voidundoDecide(int var)Reverts the decision of the given variable.TristatevalueOf(int lit)Returns the current assignment of the given literal.intvariableIndex(Literal lit)Returns the index of the variable of the given literal.
-
-
-
Method Detail
-
add
void add(Formula formula)
Adds a formula to the solver. The formula is first converted to CNF.- Parameters:
formula- the formula
-
start
boolean start()
Initializes the solver by performing unit propagation and returnsfalseif UP finds a contradiction, otherwisetrue.- Returns:
falseif UP finds a contradiction, otherwisetrue
-
decide
boolean decide(int var, boolean phase)Performs a decision of the given variable to the given phase and performs UP.- Parameters:
var- the variablephase- the phase- Returns:
falseif UP finds a contradiction, otherwisetrue
-
undoDecide
void undoDecide(int var)
Reverts the decision of the given variable.- Parameters:
var- the variable
-
atAssertionLevel
boolean atAssertionLevel()
Returnstrueif the current decision level was previously selected as backtrack level.- Returns:
trueif the current decision level was previously selected as backtrack level, otherwisefalse
-
assertCdLiteral
boolean assertCdLiteral()
Enqueues the literal which was computed by the latest backtracking, performs UP and returnfalseif UP finds a contradiction, otherwisetrue.- Returns:
falseif UP finds a contradiction, otherwisetrue
-
newlyImplied
Formula newlyImplied(BitSet knownVariables)
Returns a conjunction of all literals in the known variables which were propagated by the last UP.- Parameters:
knownVariables- the known variables- Returns:
- a conjunction of the relevant propagated literals
-
variableIndex
int variableIndex(Literal lit)
Returns the index of the variable of the given literal.- Parameters:
lit- the literal- Returns:
- the index of the literal's variable
-
litForIdx
Literal litForIdx(int var)
Returns the literal corresponding to the given variable index.- Parameters:
var- the variable index- Returns:
- the literal corresponding to the given variable index
-
valueOf
Tristate valueOf(int lit)
Returns the current assignment of the given literal.- Parameters:
lit- the literal- Returns:
- the current assignment of the given literal
-
-