3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-16 15:15:35 +00:00

simplify parallel_tactical2: use std::min and consistent mk_not

- Replace manual conflict cap with std::min in update_max_conflicts()
- Use mk_not(m, c) instead of mk_not(expr_ref(c, m)) for consistency
  with the existing call pattern at line 349

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2026-05-14 05:35:11 +00:00 committed by GitHub
parent 09b75d2122
commit 7ea6e9bed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -471,11 +471,9 @@ class parallel_solver {
unsigned m_shared_clause_limit = 0;
void update_max_conflicts() {
m_config.m_threads_max_conflicts = static_cast<unsigned>(
m_config.m_max_conflict_mul * m_config.m_threads_max_conflicts);
/* cap at the configured global maximum to prevent runaway cube checks */
if (m_config.m_threads_max_conflicts > m_config.m_max_conflicts)
m_config.m_threads_max_conflicts = m_config.m_max_conflicts;
m_config.m_threads_max_conflicts = std::min(
static_cast<unsigned>(m_config.m_max_conflict_mul * m_config.m_threads_max_conflicts),
m_config.m_max_conflicts);
}
/* Check the current cube (passed as additional assumptions).
@ -675,7 +673,7 @@ class parallel_solver {
* as a learned clause: ¬(c cₙ) ¬c ¬cₙ */
expr_ref_vector neg_lits(m);
for (expr* c : cube_core)
neg_lits.push_back(mk_not(expr_ref(c, m)));
neg_lits.push_back(mk_not(m, c));
expr_ref clause(mk_or(neg_lits), m);
b.collect_clause(m_l2g, id, clause.get());
}