@@ -64,6 +64,11 @@ void SIGINT_interrupt(int signum) {
6464#endif
6565}
6666
67+ void set_interrupted (bool cpu_interrupted) {
68+ pb_solver->asynch_interrupt = true ;
69+ if (cpu_interrupted) pb_solver->cpu_interrupt = true ;
70+ }
71+
6772extern int verbosity;
6873
6974static void clear_assumptions (Minisat::vec<Lit>& assump_ps, vec<Int>& assump_Cs)
@@ -115,6 +120,7 @@ static
115120void core_minimization (SimpSolver &sat_solver, Minisat::vec<Lit> &mus)
116121{
117122 int last_size = mus.size ();
123+ uint64_t totalConflicts = sat_solver.conflicts + 5000 ;
118124
119125 int verb = sat_solver.verbosity ; sat_solver.verbosity = 0 ;
120126 for (int i = 0 ; last_size > 1 && i < last_size; ) {
@@ -127,6 +133,7 @@ void core_minimization(SimpSolver &sat_solver, Minisat::vec<Lit> &mus)
127133 for (int j = last_size - 1 ; j > i; j--) mus[j] = mus[j-1 ];
128134 mus[i] = p; i++;
129135 } else last_size--;
136+ if (sat_solver.conflicts > totalConflicts) break ;
130137 }
131138 sat_solver.budgetOff (); sat_solver.verbosity = verb;
132139
@@ -481,6 +488,7 @@ void MsSolver::maxsat_solve(solve_Command cmd)
481488 if (goal_gcd != 1 ) {
482489 if (LB_goalvalue != Int_MIN) LB_goalvalue /= Int (goal_gcd);
483490 if (UB_goalvalue != Int_MAX) UB_goalvalue /= Int (goal_gcd);
491+ if (best_goalvalue != Int_MAX) best_goalvalue /= Int (goal_gcd);
484492 }
485493
486494 opt_sort_thres *= opt_goal_bias;
@@ -705,8 +713,8 @@ void MsSolver::maxsat_solve(solve_Command cmd)
705713 sat_conflicts.clear ();
706714 if (use_base_assump) for (int i = 0 ; i < base_assump.size (); i++) assump_ps.push (base_assump[i]);
707715 if (opt_minimization == 1 && opt_to_bin_search && opt_unsat_conflicts >= 100000 &&
708- sat_solver.conflicts < opt_unsat_conflicts - 500 )
709- sat_solver.setConfBudget (opt_unsat_conflicts - sat_solver.conflicts );
716+ sat_solver.conflicts < opt_unsat_conflicts)
717+ sat_solver.setConfBudget (max ( opt_unsat_conflicts - sat_solver.conflicts , uint64_t ( 500 )) );
710718 else sat_solver.budgetOff ();
711719 status =
712720 base_assump.size () == 1 && base_assump[0 ] == assump_lit ? l_True :
@@ -729,10 +737,11 @@ void MsSolver::maxsat_solve(solve_Command cmd)
729737 if (ipamir_used && termCallback != nullptr && 0 != termCallback (termCallbackState)) {
730738 asynch_interrupt = true ; break ;
731739 }
732- if (!ipamir_used && asynch_interrupt && !cpu_interrupt) {
733- reportf (" *** Interrupted ***\n " );
734- break ;
735- }
740+ if (!ipamir_used && asynch_interrupt)
741+ if (!cpu_interrupt) {
742+ reportf (" *** Interrupted ***\n " );
743+ break ;
744+ } else if (cpuTime () > opt_cpu_lim) break ;
736745#ifdef USE_SCIP
737746 if (scip_solver.must_be_started ) {
738747 if (asynch_interrupt && cpu_interrupt) {
@@ -1173,6 +1182,7 @@ void MsSolver::maxsat_solve(solve_Command cmd)
11731182 cpuTime (), sat_solver.conflicts , goal_ps.size (), assump_ps.size ());
11741183 }
11751184 opt_minimization = 2 ;
1185+ opt_core_minimization = false ;
11761186 if (assump_ps.size () == 0 ) opt_reuse_sorters = false ;
11771187 if (opt_convert_goal != ct_Undef) opt_convert = opt_convert_goal;
11781188 if (assump_ps.size () == 0 && gbmo_splitting_weights.size () > 0 &&
0 commit comments