21#include <spot/misc/common.hh>
22#include <spot/misc/tmpfile.hh>
26#include <initializer_list>
86 void add(std::initializer_list<int> values);
98 std::pair<int, int>
stats()
const;
103 void comment_rec(T single);
107 template<
typename T,
typename... Args>
108 void comment_rec(T first, Args... args);
113 void comment(T single);
117 template<
typename T,
typename... Args>
118 void comment(T first, Args... args);
146 picosat_get_sol(
int res);
150 satsolver_get_sol(
const char* filename);
163 std::ostream* cnf_stream_;
166 int nassumptions_vars_;
177 std::ofstream* xcnf_tmp_;
178 std::ofstream* xcnf_stream_;
187 *cnf_stream_ <<
' ' << single;
190 template<
typename T,
typename... Args>
196 *cnf_stream_ <<
' ' << first;
206 *cnf_stream_ <<
"c " << single;
209 template<
typename T,
typename... Args>
215 *cnf_stream_ <<
"c " << first;
Abstract base class for objects that can be printed to a stream via a format string.
Definition formater.hh:35
Interface with a given sat solver.
Definition satsolver.hh:44
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:71
std::vector< bool > solution
Definition satsolver.hh:124
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::pair<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.
std::pair< int, solution > solution_pair
Return code paired with a solution.
Definition satsolver.hh:126
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:203
void comment_rec(T single)
Add a comment. It should be used only in debug mode after providing a satsolver.
Definition satsolver.hh:184
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