Beispiel #1
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);
  }
Beispiel #2
0
bool
CryptoMinisat4::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.

  vector<CMSat::Lit>& real_temp_cl = *(vector<CMSat::Lit>*)temp_cl;
  real_temp_cl.clear();
  for (int i = 0; i < ps.size(); i++)
  {
    real_temp_cl.push_back(CMSat::Lit(var(ps[i]), sign(ps[i])));
  }

  return s->add_clause(real_temp_cl);
}