#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. | |
void | clauseAddLiteral (unsigned int clausePos, Internal::Var signedVar) |
adds a literal to a clause and moves clause to the end of list | |
void | finalizeClause (const clause cl) |
adds a clause to the formula's solver. If not all variables are known, missing ones are generated auomatically | |
bool | finalizeNotExtensibleClause (const clause cl) |
adds a clause to the formula's solver if all variables are known | |
Clause * | getClause (const int pos) |
returns a clause at position pos in Formula | |
int | getClauseCount () |
count of learned clauses | |
int | getProblemClauseCount () |
count of problem clauses | |
Internal::Var | getVarFromLit (const Internal::Lit &lit) |
int | getVariableCount () |
returns varable count currently in solver | |
Clause * | newClause () |
creates a new clause within the formula. If not all variables are known, missing ones are generated auomatically | |
void | newVar () |
add a new variable to the formula | |
void | newVars (unsigned int Count) |
add multiple new variables to the formula | |
bool | readDimacs (const char *filename) |
read a formula from a DIMACS file | |
bool | readDimacs (const string &filename) |
read a formula from a DIMACS file | |
bool | readDimacs (std::istream &in) |
read a formula in DIMACS format | |
void | removeClause (int i) |
removes a complete clause | |
void | reset () |
delete all clauses and variables | |
bool | solve (Model &ReturnModel) |
tries to solve the formula | |
bool | solve (Model &ReturnModel, double &timeLimit) |
tries to solve the formula with a time limit in milliseconds | |
bool | writeDimacs (const char *filename) |
write a formula to a DIMACS file | |
bool | writeDimacs (const string &filename) |
write a formula to a DIMACS file | |
bool | writeDimacs (std::ostream &f) |
write a formula in DIMACS format | |
Additional Inherited Members | |
![]() | |
enum | AnswerType { A_TRUE , A_FALSE , A_UNDEF } |
![]() | |
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 |
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 |
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 |
bool Minisat::Formula::readDimacs | ( | std::istream & | in | ) |
read a formula in DIMACS format
void Minisat::Formula::reset | ( | ) |
delete all clauses and variables
tries to solve the formula
ReturnModel | is the model output |
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 | ( | std::ostream & | f | ) |
write a formula in DIMACS format