16#include <core/Solver.h>
17#include <simp/SimpSolver.h>
20#error "Expected HAVE_GLUCOSE"
23void convert(
const bvt &bv, Glucose::vec<Glucose::Lit> &dest)
25 dest.capacity(bv.size());
23void convert(
const bvt &bv, Glucose::vec<Glucose::Lit> &dest) {
…}
36 dest.capacity(bv.size());
55 if(
a.var_no()>=(
unsigned)
solver->model.size())
81 solver->setPolarity(
a.var_no(), value);
83 catch(Glucose::OutOfMemoryException)
86 status = statust::ERROR;
87 throw std::bad_alloc();
93 return "Glucose Syrup without simplifier";
98 return "Glucose Syrup with simplifier";
104 while((
unsigned)
solver->nVars()<no_variables())
123 "variable not added yet");
127 Glucose::vec<Glucose::Lit>
c;
151 solver_hardness->register_clause(
157 catch(Glucose::OutOfMemoryException)
160 status = statust::ERROR;
161 throw std::bad_alloc();
171 log.statistics() << (no_variables() - 1) <<
" variables, "
180 log.status() <<
"SAT checker inconsistent: instance is UNSATISFIABLE"
188 for(
const auto &
literal : assumptions)
196 log.status() <<
"got FALSE as assumption: instance is UNSATISFIABLE"
206 log.status() <<
"SAT checker: instance is SATISFIABLE"
208 status = statust::SAT;
209 return resultt::P_SATISFIABLE;
213 log.status() <<
"SAT checker: instance is UNSATISFIABLE"
219 status = statust::UNSAT;
220 return resultt::P_UNSATISFIABLE;
222 catch(Glucose::OutOfMemoryException)
225 status = statust::ERROR;
226 throw std::bad_alloc();
58 using Glucose::lbool; {
…}
237 unsigned v =
a.var_no();
238 bool sign =
a.sign();
241 solver->model.growTo(v + 1);
243 solver->model[v] = Glucose::lbool(value);
245 catch(Glucose::OutOfMemoryException)
248 status = statust::ERROR;
249 throw std::bad_alloc();
268 for(
int i=0; i<
solver->conflict.size(); i++)
269 if(var(
solver->conflict[i])==v)
285 solver->setFrozen(
a.var_no(),
true);
288 catch(Glucose::OutOfMemoryException)
292 throw std::bad_alloc();
300 return solver->isEliminated(
a.var_no());
45template<
typename T> {
…}
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.
~satcheck_glucose_baset() override
A default destructor defined in the .cpp is used to ensure the unique_ptr to the solver is correctly ...
void lcnf(const bvt &bv) override
std::unique_ptr< Glucose::SimpSolver > solver
void set_polarity(literalt a, bool value)
satcheck_glucose_baset(message_handlert &message_handler)
tvt l_get(literalt a) const override
resultt do_prop_solve(const bvt &assumptions) override
void set_assignment(literalt a, bool value) override
std::string solver_text() const override
void set_frozen(literalt a) override
std::string solver_text() const override
bool is_eliminated(literalt a) const
std::vector< literalt > bvt
void convert(const bvt &bv, Glucose::vec< Glucose::Lit > &dest)
void convert_assumptions(const bvt &bv, Glucose::vec< Glucose::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 PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.