|
|
- #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
|