mirror of
https://github.com/Z3Prover/z3
synced 2025-08-17 00:32:16 +00:00
experiments with LNS
This commit is contained in:
parent
4ad95939b6
commit
489df0760f
4 changed files with 85 additions and 16 deletions
|
@ -33,24 +33,31 @@ namespace opt {
|
|||
expr_ref_vector m_soft;
|
||||
unsigned m_max_conflicts { 1000 };
|
||||
unsigned m_num_improves { 0 };
|
||||
bool m_cores_are_valid { true };
|
||||
bool m_enable_scoped_bounding { false };
|
||||
|
||||
vector<expr_ref_vector> m_cores;
|
||||
expr_mark m_in_core;
|
||||
expr_mark m_was_flipped;
|
||||
expr_mark m_is_assumption;
|
||||
|
||||
struct scoped_bounding;
|
||||
|
||||
std::function<void(model_ref& m)> m_update_model;
|
||||
std::function<void(vector<expr_ref_vector> const&)> m_relax_cores;
|
||||
|
||||
expr* soft(unsigned i) const { return m_soft[i]; }
|
||||
void set_lns_params();
|
||||
void save_defaults(params_ref& p);
|
||||
unsigned improve_step(model_ref& mdl);
|
||||
lbool improve_step(model_ref& mdl, expr* e);
|
||||
void relax_cores();
|
||||
unsigned improve_linear(model_ref& mdl);
|
||||
unsigned improve_rotate(model_ref& mdl, expr_ref_vector const& asms);
|
||||
void setup_assumptions(model_ref& mdl, expr_ref_vector const& asms);
|
||||
|
||||
public:
|
||||
lns(solver& s, std::function<void(model_ref&)>& update_model);
|
||||
void set_relax(std::function<void(vector<expr_ref_vector> const&)>& rc) { m_relax_cores = rc; }
|
||||
void set_conflicts(unsigned c) { m_max_conflicts = c; }
|
||||
unsigned climb(model_ref& mdl, expr_ref_vector const& asms);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue