21#include <minisat/core/Solver.h>
22#include <minisat/simp/SimpSolver.h>
25# define l_False Minisat::l_False
26# define l_True Minisat::l_True
30#error "Expected HAVE_MINISAT2"
33void convert(
const bvt &bv, Minisat::vec<Minisat::Lit> &dest)
36 bv.size() <=
static_cast<std::size_t
>(std::numeric_limits<int>::max()));
37 dest.capacity(
static_cast<int>(bv.size()));
49 bv.size() <=
static_cast<std::size_t
>(std::numeric_limits<int>::max()));
50 dest.capacity(
static_cast<int>(bv.size()));
70 if(
a.var_no()>=(
unsigned)
solver->model.size())
100 catch(Minisat::OutOfMemoryException)
103 status = statust::ERROR;
104 throw std::bad_alloc();
122 return "MiniSAT 2.2.1 without simplifier";
127 return "MiniSAT 2.2.1 with simplifier";
133 while((
unsigned)
solver->nVars()<no_variables())
152 "variable not added yet");
156 Minisat::vec<Minisat::Lit>
c;
180 solver_hardness->register_clause(
186 catch(
const Minisat::OutOfMemoryException &)
189 status = statust::ERROR;
190 throw std::bad_alloc();
211 log.statistics() << (no_variables() - 1) <<
" variables, "
220 log.status() <<
"SAT checker inconsistent: instance is UNSATISFIABLE"
222 status = statust::UNSAT;
223 return resultt::P_UNSATISFIABLE;
227 for(
const auto &assumption : assumptions)
229 if(assumption.is_false())
231 log.status() <<
"got FALSE as assumption: instance is UNSATISFIABLE"
233 status = statust::UNSAT;
234 return resultt::P_UNSATISFIABLE;
241 using Minisat::lbool;
247 if(time_limit_seconds != 0)
254 alarm(time_limit_seconds);
268 if(time_limit_seconds != 0)
270 log.warning() <<
"Time limit ignored (not supported on Win32 yet)"
282 status = statust::SAT;
283 return resultt::P_SATISFIABLE;
289 status = statust::UNSAT;
290 return resultt::P_UNSATISFIABLE;
294 status = statust::ERROR;
295 return resultt::P_ERROR;
297 catch(
const Minisat::OutOfMemoryException &)
300 status=statust::ERROR;
301 return resultt::P_ERROR;
312 unsigned v =
a.var_no();
313 bool sign =
a.sign();
316 solver->model.growTo(v + 1);
318 solver->model[v] = Minisat::lbool(value);
320 catch(
const Minisat::OutOfMemoryException &)
323 status = statust::ERROR;
324 throw std::bad_alloc();
333 time_limit_seconds(0)
345 for(
int i=0; i<
solver->conflict.size(); i++)
346 if(var(
solver->conflict[i])==v)
362 solver->setFrozen(
a.var_no(),
true);
365 catch(
const Minisat::OutOfMemoryException &)
369 throw std::bad_alloc();
377 return solver->isEliminated(
a.var_no());
static bool convert(const irep_idt &identifier, const std::ostringstream &s, symbol_table_baset &symbol_table, message_handlert &message_handler)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
bool is_in_conflict(literalt a) const override
Returns true if an assumption is in the final conflict.
std::unique_ptr< Minisat::SimpSolver > solver
~satcheck_minisat2_baset() override
A default destructor defined in the .cpp is used to ensure the unique_ptr to the solver is correctly ...
resultt do_prop_solve(const bvt &) override
satcheck_minisat2_baset(message_handlert &message_handler)
void set_polarity(literalt a, bool value)
void lcnf(const bvt &bv) override final
tvt l_get(literalt a) const override final
void set_assignment(literalt a, bool value) override
std::string solver_text() const override
void set_frozen(literalt a) override final
bool is_eliminated(literalt a) const
std::string solver_text() const override final
std::vector< literalt > bvt
void convert_assumptions(const bvt &bv, Glucose::vec< Glucose::Lit > &dest)
static Minisat::Solver * solver_to_interrupt
static void interrupt_solver(int signum)
void convert_assumptions(const bvt &bv, Minisat::vec< Minisat::Lit > &dest)
void convert(const bvt &bv, Minisat::vec< Minisat::Lit > &dest)
void solver(std::vector< framet > &frames, const std::unordered_set< symbol_exprt, irep_hash > &address_taken, const solver_optionst &solver_options, const namespacet &ns, std::vector< propertyt > &properties, std::size_t property_index)
#define CHECK_RETURN(CONDITION)
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.