21#include <spot/misc/common.hh>
22#include <spot/misc/tmpfile.hh>
26#include <initializer_list>
85 void add(std::initializer_list<int> values);
97 std::pair<int, int>
stats()
const;
102 void comment_rec(T single);
106 template<
typename T,
typename... Args>
107 void comment_rec(T first, Args... args);
112 void comment(T single);
116 template<
typename T,
typename... Args>
117 void comment(T first, Args... args);
123 typedef std::vector<bool> solution;
124 typedef std::pair<int, solution> solution_pair;
139 picosat_get_sol(
int res);
143 satsolver_get_sol(
const char* filename);
156 std::ostream* cnf_stream_;
159 int nassumptions_vars_;
170 std::ofstream* xcnf_tmp_;
171 std::ofstream* xcnf_stream_;
180 *cnf_stream_ <<
' ' << single;
183 template<
typename T,
typename... Args>
189 *cnf_stream_ <<
' ' << first;
199 *cnf_stream_ <<
"c " << single;
202 template<
typename T,
typename... Args>
208 *cnf_stream_ <<
"c " << first;
Definition: formater.hh:30
Interface with a given sat solver.
Definition: satsolver.hh:43
bool command_given()
Return true if a satsolver is given, false otherwise.
int run(printable *in, printable *out)
Run the given satsolver.
Interface with a SAT solver.
Definition: satsolver.hh:70
std::pair< int, int > stats() const
Returns std::pair<nvars, nclauses>;.
void add(std::initializer_list< int > values)
Add a list of lit. to the current clause.
void add(int v)
Add a single lit. to the current clause.
solution_pair get_solution()
Return std::vector<solving_return_code, solution>.
satsolver()
Construct the sat solver and initialize variables. If no satsolver is provided through SPOT_SATSOLVER...
int get_nb_vars() const
Get the current number of variables.
void comment(T single)
Add a comment. It will start with "c ". It should be used only in debug mode after providing a satsol...
Definition: satsolver.hh:196
void comment_rec(T single)
Add a comment. It should be used only in debug mode after providing a satsolver.
Definition: satsolver.hh:177
void set_nassumptions_vars(int nassumptions_vars)
Declare the number of vars reserved for assumptions.
int get_nb_clauses() const
Get the current number of clauses.
void assume(int lit)
Assume a literal value. Must only be used with distributed picolib.
void adjust_nvars(int nvars)
Adjust the number of variables used in the cnf formula.
Temporary file name.
Definition: tmpfile.hh:49
Definition: automata.hh:26