void MinisatSatSolver::toSatClause(Minisat::vec<Minisat::Lit>& clause, SatClause& sat_clause) { for (int i = 0; i < clause.size(); ++i) { sat_clause.push_back(toSatLiteral(clause[i])); } Assert((unsigned)clause.size() == sat_clause.size()); }
void MinisatSatSolver::toMinisatClause(SatClause& clause, Minisat::vec<Minisat::Lit>& minisat_clause) { for (unsigned i = 0; i < clause.size(); ++i) { minisat_clause.push(toMinisatLit(clause[i])); } Assert(clause.size() == (unsigned)minisat_clause.size()); }
void convert(const bvt &bv, Minisat::vec<Minisat::Lit> &dest) { dest.capacity(bv.size()); forall_literals(it, bv) if(!it->is_false()) dest.push(Minisat::mkLit(it->var_no(), it->sign())); }
void MiniSolver::AddClause(std::initializer_list<VarId> list) { Minisat::vec<Minisat::Lit> v; for (int i = 0; i < contexts_.size(); i++) v.push(~contexts_[i]); for (auto var : list) v.push(Minisat::mkLit(abs(var) - 1, var > 0)); minisat_.addClause(v); }
bool CryptoMinisat::addClause(const vec_literals& ps) // Add a clause to the solver. { // Cryptominisat uses a slightly different vec class. // Cryptominisat uses a slightly different Lit class too. // VERY SLOW> MINISAT::vec<MINISAT::Lit> v; for (int i =0; i<ps.size();i++) v.push(MINISAT::Lit(var(ps[i]), sign(ps[i]))); return s->addClause(v); }