Skip to content

Commit

Permalink
Rearranging the dumped CNF
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Oct 3, 2023
1 parent 8512f7f commit e50609b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ void Counter::dump_cnf_from_solver(const vector<Lit>& assumps, const uint32_t it
std::ofstream f;
f.open(ss.str(), std::ios::out);
f << "p cnf " << solver->nVars()+1 << " " << cls_in_solver.size()+xors_in_solver.size()+assumps.size() << endl;
for(const auto& l: assumps) f << l << " 0" << endl;
for(const auto& cl: cls_in_solver) f << cl << " 0" << endl;
f << "c XORs below" << endl;
for(const auto& x: xors_in_solver) {
f << "x";
for(uint32_t i = 0; i < x.first.size(); i++) {
Expand All @@ -185,6 +185,8 @@ void Counter::dump_cnf_from_solver(const vector<Lit>& assumps, const uint32_t it
}
f << "0" << endl;
}
f << "c assumptions below" << endl;
for(const auto& l: assumps) f << l << " 0" << endl;
f.close();
}

Expand Down

0 comments on commit e50609b

Please sign in to comment.