예제 #1
0
파일: minisat.cpp 프로젝트: Dunedune/CVC4
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());
}
예제 #2
0
파일: minisat.cpp 프로젝트: Dunedune/CVC4
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());
}
예제 #3
0
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()));
}
예제 #4
0
파일: minisolver.cpp 프로젝트: myreg/cobra
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);
}
예제 #5
0
  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);
  }