This class is used to manipulate CNF clauses. More...
#include <clause.h>
Public Member Functions | |
Clause () | |
Builds an empty Clause instance. | |
void | addLit (int) |
Adds the code of the literal given as an argument to the Clause. | |
std::string | toString () |
Puts all the literals in a one line std::string. | |
void | clear () |
Clears the content of the clause by clearing the literals attribute. | |
Private Attributes | |
std::vector< int > | literals |
The codes of the variables of the clause. |
This class is used to manipulate CNF clauses.
A CNF clause consist of the disjunction of an arbitrary number of literals. This class makes it easier to use these in coordination with the minisat2 program.
Clause::Clause | ( | ) |
void Clause::addLit | ( | int | code | ) |
Adds the code of the literal given as an argument to the Clause.
Definition at line 23 of file clause.cpp.
{ literals.push_back(code); }
void Clause::clear | ( | ) |
Clears the content of the clause by clearing the literals attribute.
Definition at line 40 of file clause.cpp.
{ literals.clear(); }
std::string Clause::toString | ( | ) |
Puts all the literals in a one line std::string.
The aim of this method is to write a line of a DIMACS formatted file corresponding to this disjunction.
Definition at line 28 of file clause.cpp.
std::vector<int> cnf::Clause::literals [private] |