Skip to content

Commit

Permalink
A few further fixes to issues found while testing with CaDiCal
Browse files Browse the repository at this point in the history
  • Loading branch information
marekpiotrow committed May 8, 2024
1 parent 79ec525 commit b4ba41f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions MsSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ void MsSolver::maxsat_solve(solve_Command cmd)
convertPbs(false);
}
} else { // UNSAT returned
if (sat_solver.conflict.size() == 0) break; // unconditional UNSAT
sat_solver.conflict.copyTo(sat_conflicts);
if (global_assumptions.size() > 0 || harden_assump.size() > 0) {
int j = 0;
Expand Down Expand Up @@ -1196,10 +1197,10 @@ void MsSolver::maxsat_solve(solve_Command cmd)
if (ipamir_used) reset_soft_cls(soft_cls, fixed_soft_cls, modified_soft_cls, goal_gcd);
#ifdef USE_SCIP
char test = OPT_NONE;
bool MSAT_found_opt = satisfied && !asynch_interrupt && cmd != sc_FirstSolution && best_goalvalue < Int_MAX
bool MSAT_found_opt = (!satisfied || satisfied && !asynch_interrupt && cmd != sc_FirstSolution && best_goalvalue < Int_MAX)
&& opt_finder.compare_exchange_strong(test, OPT_MSAT);
#else
bool MSAT_found_opt = satisfied && !asynch_interrupt && cmd != sc_FirstSolution && best_goalvalue < Int_MAX;
bool MSAT_found_opt = !satisfied || satisfied && !asynch_interrupt && cmd != sc_FirstSolution && best_goalvalue < Int_MAX;
#endif
;
if (opt_verbosity >= 1 && opt_output_top < 0){
Expand Down
8 changes: 5 additions & 3 deletions ScipSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ lbool scip_solve_async(SCIP *scip, std::vector<SCIP_VAR *> vars, std::vector<lbo
solver->printStats(true);
return l_True;
} else {
std::lock_guard<std::mutex> lck(optsol_mtx);
found_opt = l_False;
if (opt_verbosity > 0) reportf("SCIP result: UNSATISFIABLE\n");
if (!solver->ipamir_used) {
printf("s UNSATISFIABLE\n");
char test = OPT_NONE;
if (!solver->ipamir_used && opt_finder.compare_exchange_strong(test, OPT_SCIP) ) {
if (opt_verbosity > 0) reportf("SCIP result: UNSATISFIABLE\n");
printf("s UNSATISFIABLE\n"); fflush(stdout);
std::_Exit(20);
}
}
Expand Down

0 comments on commit b4ba41f

Please sign in to comment.