mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
continued re-factoring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
acbeed2e97
commit
33be06c6dc
6 changed files with 98 additions and 88 deletions
|
@ -35,43 +35,24 @@ namespace opt {
|
|||
class opt_solver;
|
||||
|
||||
class context {
|
||||
ast_manager& m;
|
||||
expr_ref_vector m_hard_constraints;
|
||||
expr_ref_vector m_soft_constraints;
|
||||
vector<rational> m_weights;
|
||||
app_ref_vector m_objectives;
|
||||
svector<bool> m_is_max;
|
||||
ref<solver> m_solver;
|
||||
params_ref m_params;
|
||||
optimize_objectives m_opt_objectives;
|
||||
maxsmt m_maxsmt;
|
||||
ast_manager& m;
|
||||
expr_ref_vector m_hard_constraints;
|
||||
ref<solver> m_solver;
|
||||
params_ref m_params;
|
||||
optimize_objectives m_optsmt;
|
||||
maxsmt m_maxsmt;
|
||||
public:
|
||||
context(ast_manager& m);
|
||||
|
||||
void add_soft_constraint(expr* f, rational const& w) {
|
||||
m_soft_constraints.push_back(f);
|
||||
m_weights.push_back(w);
|
||||
}
|
||||
|
||||
void add_objective(app* t, bool is_max);
|
||||
|
||||
void add_hard_constraint(expr* f) {
|
||||
m_hard_constraints.push_back(f);
|
||||
}
|
||||
|
||||
void set_solver(solver* s) {
|
||||
m_solver = s;
|
||||
}
|
||||
|
||||
void add_soft_constraint(expr* f, rational const& w) { m_maxsmt.add(f, w); }
|
||||
void add_objective(app* t, bool is_max) { m_optsmt.add(t, is_max); }
|
||||
void add_hard_constraint(expr* f) { m_hard_constraints.push_back(f); }
|
||||
void set_solver(solver* s) { m_solver = s; }
|
||||
void optimize();
|
||||
|
||||
void cancel();
|
||||
void reset_cancel();
|
||||
|
||||
void collect_statistics(statistics& stats);
|
||||
|
||||
static void collect_param_descrs(param_descrs & r);
|
||||
|
||||
void updt_params(params_ref& p);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue