22 #include <spot/misc/common.hh>
23 #include <spot/misc/tmpfile.hh>
27 #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);
124 typedef std::vector<bool> solution;
125 typedef std::pair<int, solution> solution_pair;
140 picosat_get_sol(
int res);
144 satsolver_get_sol(
const char* filename);
157 std::ostream* cnf_stream_;
160 int nassumptions_vars_;
171 std::ofstream* xcnf_tmp_;
172 std::ofstream* xcnf_stream_;
181 *cnf_stream_ <<
' ' << single;
184 template<
typename T,
typename... Args>
190 *cnf_stream_ <<
' ' << first;
200 *cnf_stream_ <<
"c " << single;
203 template<
typename T,
typename... Args>
209 *cnf_stream_ <<
"c " << first;
Definition: formater.hh:31
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::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 itinialize 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:197
void comment_rec(T single)
Add a comment. It should be used only in debug mode after providing a satsolver.
Definition: satsolver.hh:178
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 litteral 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:50
Definition: automata.hh:27