You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
621 B

#ifndef KSAT_CLAUSE_2_MINISAT_CLAUSE
#define KSAT_CLAUSE_2_MINISAT_CLAUSE
#include "util/convert.h"
#include "util/ksatinstance.h"
#include "core/SolverTypes.h"
#include <cmath>
namespace satlab
{
namespace types
{
template<typename = Minisat::vec<Minisat::Lit>, typename = KSATinstance::CLAUSE>
void convert(Minisat::vec<Minisat::Lit>& clauseVec,
const KSATinstance::CLAUSE& clause)
{
clauseVec.clear();
int var;
for(auto lit : clause)
{
var = abs(lit) - 1;
clauseVec.push(Minisat::mkLit(var, lit < 0));
}
}
}
}
#endif // KSAT_CLAUSE_2_MINISAT_CLAUSE