3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-03 01:40:22 +00:00

remove deprecated maxsat solvers, adjust values inline

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-14 11:55:47 -07:00
parent 770d0d58fe
commit a96fa0c555
13 changed files with 66 additions and 408 deletions

View file

@ -27,6 +27,7 @@ Notes:
#include"smt_context.h"
#include"smt_theory.h"
#include"theory_wmaxsat.h"
#include"opt_solver.h"
namespace opt {
@ -35,6 +36,8 @@ namespace opt {
class context;
class maxsmt_solver {
protected:
adjust_value m_adjust_value;
public:
virtual ~maxsmt_solver() {}
virtual lbool operator()() = 0;
@ -45,6 +48,7 @@ namespace opt {
virtual void collect_statistics(statistics& st) const = 0;
virtual void get_model(model_ref& mdl) = 0;
virtual void updt_params(params_ref& p) = 0;
void set_adjust_value(adjust_value& adj) { m_adjust_value = adj; }
};
@ -100,6 +104,7 @@ namespace opt {
protected:
void enable_sls(expr_ref_vector const& soft, weights_t& ws);
void set_enable_sls(bool f);
void trace_bounds(char const* solver);
};
@ -119,6 +124,7 @@ namespace opt {
vector<rational> m_weights;
rational m_lower;
rational m_upper;
adjust_value m_adjust_value;
model_ref m_model;
params_ref m_params;
public:
@ -127,15 +133,16 @@ namespace opt {
void set_cancel(bool f);
void updt_params(params_ref& p);
void add(expr* f, rational const& w);
void set_adjust_value(adjust_value& adj) { m_adjust_value = adj; }
unsigned size() const { return m_soft_constraints.size(); }
expr* operator[](unsigned idx) const { return m_soft_constraints[idx]; }
rational weight(unsigned idx) const { return m_weights[idx]; }
void commit_assignment();
rational get_value() const;
rational get_lower() const;
rational get_upper() const;
void update_lower(rational const& r, bool override);
void update_upper(rational const& r, bool override);
rational get_upper() const;
void update_lower(rational const& r);
void update_upper(rational const& r);
void get_model(model_ref& mdl);
bool get_assignment(unsigned index) const;
void display_answer(std::ostream& out) const;