#include <ogdf/external/Minisat.h>
Public Member Functions | |
Formula () | |
virtual | ~Formula () |
template<class Iteratable > | |
void | addClause (const Iteratable &literals) |
Add a clause given by a list of literals. More... | |
void | clauseAddLiteral (unsigned int clausePos, Internal::Var signedVar) |
adds a literal to a clause and moves clause to the end of list More... | |
void | finalizeClause (const clause cl) |
adds a clause to the formula's solver. If not all variables are known, missing ones are generated auomatically More... | |
bool | finalizeNotExtensibleClause (const clause cl) |
adds a clause to the formula's solver if all variables are known More... | |
Clause * | getClause (const int pos) |
returns a clause at position pos in Formula More... | |
int | getClauseCount () |
count of learned clauses More... | |
int | getProblemClauseCount () |
count of problem clauses More... | |
Internal::Var | getVarFromLit (const Internal::Lit &lit) |
int | getVariableCount () |
returns varable count currently in solver More... | |
Clause * | newClause () |
creates a new clause within the formula. If not all variables are known, missing ones are generated auomatically More... | |
void | newVar () |
add a new variable to the formula More... | |
void | newVars (unsigned int Count) |
add multiple new variables to the formula More... | |
bool | readDimacs (const char *filename) |
read a formula from a DIMACS file More... | |
bool | readDimacs (const string &filename) |
read a formula from a DIMACS file More... | |
bool | readDimacs (std::istream &in) |
read a formula in DIMACS format More... | |
void | removeClause (int i) |
removes a complete clause More... | |
void | reset () |
delete all clauses and variables More... | |
bool | solve (Model &ReturnModel) |
tries to solve the formula More... | |
bool | solve (Model &ReturnModel, double &timeLimit) |
tries to solve the formula with a time limit in milliseconds More... | |
bool | writeDimacs (const char *filename) |
write a formula to a DIMACS file More... | |
bool | writeDimacs (const string &filename) |
write a formula to a DIMACS file More... | |
bool | writeDimacs (std::ostream &f) |
write a formula in DIMACS format More... | |
Private Member Functions | |
void | free () |
Private Member Functions inherited from Minisat::Internal::Solver | |
Solver () | |
virtual | ~Solver () |
bool | addClause (const vec< Lit > &ps) |
bool | addClause (Lit p) |
bool | addClause (Lit p, Lit q) |
bool | addClause (Lit p, Lit q, Lit r) |
bool | addClause_ (vec< Lit > &ps) |
bool | addEmptyClause () |
void | budgetOff () |
void | checkGarbage () |
void | checkGarbage (double gf) |
void | clearInterrupt () |
virtual void | garbageCollect () |
void | interrupt () |
lbool | modelValue (Lit p) const |
lbool | modelValue (Var x) const |
int | nAssigns () const |
int | nClauses () const |
Var | newVar (bool polarity=true, bool dvar=true) |
int | nFreeVars () const |
int | nLearnts () const |
int | nVars () const |
bool | okay () const |
void | setConfBudget (int64_t x) |
void | setDecisionVar (Var v, bool b) |
void | setPolarity (Var v, bool b) |
void | setPropBudget (int64_t x) |
bool | simplify () |
bool | solve () |
bool | solve (const vec< Lit > &assumps) |
bool | solve (double t, SolverStatus &st) |
bool | solve (Lit p) |
bool | solve (Lit p, Lit q) |
bool | solve (Lit p, Lit q, Lit r) |
lbool | solveLimited (const vec< Lit > &assumps) |
void | toDimacs (const char *file) |
void | toDimacs (const char *file, const vec< Lit > &assumps) |
void | toDimacs (const char *file, Lit p) |
void | toDimacs (const char *file, Lit p, Lit q) |
void | toDimacs (const char *file, Lit p, Lit q, Lit r) |
void | toDimacs (std::ostream &out, Clause &c, vec< Var > &map, Var &max) |
void | toDimacs (std::ostream &out, const vec< Lit > &assumps) |
lbool | value (Lit p) const |
lbool | value (Var x) const |
uint32_t | abstractLevel (Var x) const |
void | analyze (CRef confl, vec< Lit > &out_learnt, int &out_btlevel) |
void | analyzeFinal (Lit p, vec< Lit > &out_conflict) |
void | attachClause (CRef cr) |
void | cancelUntil (int level) |
void | claBumpActivity (Clause &c) |
void | claDecayActivity () |
int | decisionLevel () const |
void | detachClause (CRef cr, bool strict=false) |
bool | enqueue (Lit p, CRef from=CRef_Undef) |
void | insertVarOrder (Var x) |
int | level (Var x) const |
bool | litRedundant (Lit p, uint32_t abstract_levels) |
bool | locked (const Clause &c) const |
void | newDecisionLevel () |
Lit | pickBranchLit () |
double | progressEstimate () const |
CRef | propagate () |
CRef | reason (Var x) const |
void | rebuildOrderHeap () |
void | reduceDB () |
void | relocAll (ClauseAllocator &to) |
void | removeClause (CRef cr) |
void | removeSatisfied (vec< CRef > &cs) |
bool | satisfied (const Clause &c) const |
lbool | search (int nof_conflicts) |
lbool | search (int nof_conflicts, double &time) |
lbool | solve_ () |
lbool | solve_ (double &t) |
void | uncheckedEnqueue (Lit p, CRef from=CRef_Undef) |
void | varBumpActivity (Var v) |
void | varBumpActivity (Var v, double inc) |
void | varDecayActivity () |
bool | withinBudget () const |
Additional Inherited Members | |
Private Types inherited from Minisat::Internal::Solver | |
enum | AnswerType { A_TRUE, A_FALSE, A_UNDEF } |
Static Private Member Functions inherited from Minisat::Internal::Solver | |
static double | drand (double &seed) |
static int | irand (double &seed, int size) |
static VarData | mkVarData (CRef cr, int l) |
The Formula class.
Variables and Clauses are added to the Formula. The clauses can be resolved to solve a SAT problem. Variables are linear indexed.
|
inline |
|
inline |
void Minisat::Formula::finalizeClause | ( | const clause | cl | ) |
adds a clause to the formula's solver. If not all variables are known, missing ones are generated auomatically
cl | is a reference to the clause to be added to the formula |
bool Minisat::Formula::finalizeNotExtensibleClause | ( | const clause | cl | ) |
adds a clause to the formula's solver if all variables are known
cl | is a reference to an existing clause within the formula |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
Clause* Minisat::Formula::newClause | ( | ) |
creates a new clause within the formula. If not all variables are known, missing ones are generated auomatically
|
inline |
|
inline |
bool Minisat::Formula::readDimacs | ( | const char * | filename | ) |
read a formula from a DIMACS file
bool Minisat::Formula::readDimacs | ( | const string & | filename | ) |
read a formula from a DIMACS file
bool Minisat::Formula::readDimacs | ( | std::istream & | in | ) |
read a formula in DIMACS format
void Minisat::Formula::removeClause | ( | int | i | ) |
removes a complete clause
void Minisat::Formula::reset | ( | ) |
delete all clauses and variables
bool Minisat::Formula::solve | ( | Model & | ReturnModel | ) |
tries to solve the formula
ReturnModel | is the model output |
bool Minisat::Formula::solve | ( | Model & | ReturnModel, |
double & | timeLimit | ||
) |
tries to solve the formula with a time limit in milliseconds
ReturnModel | is the model output |
timeLimit | is the time limit in milliseconds |
bool Minisat::Formula::writeDimacs | ( | const char * | filename | ) |
write a formula to a DIMACS file
bool Minisat::Formula::writeDimacs | ( | const string & | filename | ) |
write a formula to a DIMACS file
bool Minisat::Formula::writeDimacs | ( | std::ostream & | f | ) |
write a formula in DIMACS format