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

fixing bugs in refactored code exposed from White's example

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-04-17 11:06:43 -07:00
parent c84ab2fc01
commit 7237be768b
7 changed files with 117 additions and 131 deletions

View file

@ -64,14 +64,7 @@ namespace opt {
void updt_params(params_ref& p);
void add(expr* f, rational const& w) {
SASSERT(m.is_bool(f));
SASSERT(w.is_pos());
m_soft_constraints.push_back(f);
m_weights.push_back(w);
m_upper += w;
}
void add(expr* f, rational const& w);
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]; }