mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
fix bcd2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c3b7c738f8
commit
182fea2d7b
|
@ -91,7 +91,7 @@ namespace opt {
|
||||||
rational r = m_lower;
|
rational r = m_lower;
|
||||||
if (m_msolver) {
|
if (m_msolver) {
|
||||||
rational q = m_msolver->get_lower();
|
rational q = m_msolver->get_lower();
|
||||||
if (r < q) r = q;
|
if (q > r) r = q;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ namespace opt {
|
||||||
rational r = m_upper;
|
rational r = m_upper;
|
||||||
if (m_msolver) {
|
if (m_msolver) {
|
||||||
rational q = m_msolver->get_upper();
|
rational q = m_msolver->get_upper();
|
||||||
if (r > q) r = q;
|
if (q < r) r = q;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -612,7 +612,6 @@ namespace opt {
|
||||||
return mk_objective_fn(index, O_MAXSMT, num_fmls, fmls);
|
return mk_objective_fn(index, O_MAXSMT, num_fmls, fmls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void context::from_fmls(expr_ref_vector const& fmls) {
|
void context::from_fmls(expr_ref_vector const& fmls) {
|
||||||
TRACE("opt",
|
TRACE("opt",
|
||||||
for (unsigned i = 0; i < fmls.size(); ++i) {
|
for (unsigned i = 0; i < fmls.size(); ++i) {
|
||||||
|
@ -625,7 +624,7 @@ namespace opt {
|
||||||
app_ref tr(m);
|
app_ref tr(m);
|
||||||
expr_ref_vector terms(m);
|
expr_ref_vector terms(m);
|
||||||
vector<rational> weights;
|
vector<rational> weights;
|
||||||
rational offset;
|
rational offset(0);
|
||||||
unsigned index;
|
unsigned index;
|
||||||
symbol id;
|
symbol id;
|
||||||
bool neg;
|
bool neg;
|
||||||
|
@ -737,7 +736,7 @@ namespace opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
m_maxsmts.find(obj.m_id)->update_lower(r, override);
|
m_maxsmts.find(obj.m_id)->update_upper(r, override);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +748,6 @@ namespace opt {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void context::display_assignment(std::ostream& out) {
|
void context::display_assignment(std::ostream& out) {
|
||||||
for (unsigned i = 0; i < m_objectives.size(); ++i) {
|
for (unsigned i = 0; i < m_objectives.size(); ++i) {
|
||||||
objective const& obj = m_objectives[i];
|
objective const& obj = m_objectives[i];
|
||||||
|
@ -763,7 +761,6 @@ namespace opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void context::display_objective(std::ostream& out, objective const& obj) const {
|
void context::display_objective(std::ostream& out, objective const& obj) const {
|
||||||
switch(obj.m_type) {
|
switch(obj.m_type) {
|
||||||
case O_MAXSMT: {
|
case O_MAXSMT: {
|
||||||
|
|
|
@ -300,6 +300,7 @@ namespace opt {
|
||||||
unsigned s = *subC.begin();
|
unsigned s = *subC.begin();
|
||||||
wcore& c_s = m_cores[s];
|
wcore& c_s = m_cores[s];
|
||||||
c_s.m_lower = refine(c_s.m_R, c_s.m_mid);
|
c_s.m_lower = refine(c_s.m_R, c_s.m_mid);
|
||||||
|
c_s.m_mid = div(c_s.m_lower + c_s.m_upper, rational(2));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wcore c_s;
|
wcore c_s;
|
||||||
|
|
Loading…
Reference in a new issue