3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-29 03:48:51 +00:00

Parallel tactic (#9824)

Co-authored-by: Ilana Shapiro <ilanashapiro@Ilanas-MacBook-Pro.local>
Co-authored-by: Ilana Shapiro <ilanashapiro@Ilanas-MBP.localdomain>
This commit is contained in:
Nikolaj Bjorner 2026-06-11 09:14:00 -07:00 committed by GitHub
parent 677abb589e
commit 6ef8660adb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 1889 additions and 280 deletions

View file

@ -57,7 +57,15 @@ solver* mk_smt2_solver(ast_manager& m, params_ref const& p, symbol const& logic
class solver : public check_sat_result, public user_propagator::core {
params_ref m_params;
symbol m_cancel_backup_file;
statistics m_parallel_stats;
public:
struct scored_literal {
expr_ref lit;
double score = 0.0;
scored_literal(ast_manager& m, expr* e, double s): lit(e, m), score(s) {}
scored_literal(expr_ref const& e, double s): lit(e), score(s) {}
};
solver(ast_manager& m): check_sat_result(m) {}
/**
@ -298,9 +306,47 @@ public:
expr_ref_vector get_non_units();
virtual expr_ref_vector get_trail(unsigned max_level) = 0; // { return expr_ref_vector(get_manager()); }
virtual expr_ref_vector get_assigned_literals() { return get_trail(UINT_MAX); }
virtual unsigned get_assign_level(expr* e) const { return UINT_MAX; }
virtual bool is_relevant(expr* e) const { return true; }
virtual unsigned get_num_bool_vars() const { return UINT_MAX; }
virtual unsigned get_bool_var(expr* e) const { return UINT_MAX; }
virtual expr* bool_var2expr(unsigned) const { return nullptr; }
virtual lbool get_assignment(unsigned) const { return l_undef; }
virtual double get_activity(unsigned) const { return 0.0; }
virtual bool was_eliminated(unsigned) const { return false; }
virtual void pop_to_base_level() {}
virtual void setup_for_parallel() {}
virtual void set_preprocess(bool) {}
virtual void set_max_conflicts(unsigned max_conflicts) {
params_ref p;
p.set_uint("max_conflicts", max_conflicts);
updt_params(p);
}
virtual unsigned get_max_conflicts() const { return UINT_MAX; }
virtual void reset_parallel_statistics() {
m_parallel_stats.reset();
}
virtual void add_parallel_statistics(statistics const& st) {
m_parallel_stats.copy(st);
}
virtual void collect_parallel_statistics(statistics& st) const {
st.copy(m_parallel_stats);
collect_statistics(st);
}
virtual void get_levels(ptr_vector<expr> const& vars, unsigned_vector& depth) = 0;
virtual void get_backbone_candidates(vector<scored_literal>&, unsigned) {}
class scoped_push {
solver& s;
bool m_nopop;