mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
update lower bounds from feasible solutiosn
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e307c5fdda
commit
370a4b66de
14 changed files with 123 additions and 44 deletions
|
@ -79,21 +79,29 @@ namespace opt {
|
|||
if (m_msolver) {
|
||||
return inf_eps(m_msolver->get_value());
|
||||
}
|
||||
return inf_eps();
|
||||
return inf_eps(m_upper);
|
||||
}
|
||||
|
||||
inf_eps maxsmt::get_lower() const {
|
||||
rational r = m_lower;
|
||||
if (m_msolver) {
|
||||
return inf_eps(m_msolver->get_lower());
|
||||
rational q = m_msolver->get_lower();
|
||||
if (r < q) r = q;
|
||||
}
|
||||
return inf_eps();
|
||||
return inf_eps(r);
|
||||
}
|
||||
|
||||
inf_eps maxsmt::get_upper() const {
|
||||
rational r = m_upper;
|
||||
if (m_msolver) {
|
||||
return inf_eps(m_msolver->get_upper());
|
||||
rational q = m_msolver->get_upper();
|
||||
if (r > q) r = q;
|
||||
}
|
||||
return inf_eps(rational(m_soft_constraints.size()));
|
||||
return inf_eps(r);
|
||||
}
|
||||
|
||||
void maxsmt::update_lower(rational const& r) {
|
||||
if (m_lower > r) m_lower = r;
|
||||
}
|
||||
|
||||
void maxsmt::commit_assignment() {
|
||||
|
@ -130,5 +138,11 @@ namespace opt {
|
|||
m_maxsat_engine = _p.maxsat_engine();
|
||||
}
|
||||
|
||||
void maxsmt::collect_statistics(statistics& st) const {
|
||||
if (m_msolver) {
|
||||
m_msolver->collect_statistics(st);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue