3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-22 02:57:50 +00:00

bug fixes to pb; working on model extraction

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-12-10 15:16:58 -08:00
parent 26bf64a0c3
commit 2c577a304d
15 changed files with 348 additions and 197 deletions

View file

@ -35,6 +35,7 @@ namespace opt {
virtual expr_ref_vector get_assignment() const = 0;
virtual void set_cancel(bool f) = 0;
virtual void collect_statistics(statistics& st) const = 0;
virtual void get_model(model_ref& mdl) = 0;
};
/**
Takes solver with hard constraints added.
@ -52,6 +53,7 @@ namespace opt {
rational m_upper;
scoped_ptr<maxsmt_solver> m_msolver;
symbol m_maxsat_engine;
model_ref m_model;
public:
maxsmt(ast_manager& m): m(m), m_s(0), m_cancel(false), m_soft_constraints(m), m_answer(m) {}
@ -78,15 +80,11 @@ namespace opt {
rational get_lower() const;
rational get_upper() const;
void update_lower(rational const& r);
void get_model(model_ref& mdl);
expr_ref_vector get_assignment() const;
void display_answer(std::ostream& out) const;
void display_answer(std::ostream& out) const;
void collect_statistics(statistics& st) const;
private:
bool is_maxsat_problem(vector<rational> const& ws) const;