mirror of
https://github.com/Z3Prover/z3
synced 2025-07-18 02:16:40 +00:00
working on upper bound optimziation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e5698119d7
commit
c0de1e34ac
17 changed files with 343 additions and 125 deletions
|
@ -1001,7 +1001,7 @@ void theory_diff_logic<Ext>::get_implied_bound_antecedents(edge_id bridge_edge,
|
|||
}
|
||||
|
||||
template<typename Ext>
|
||||
bool theory_diff_logic<Ext>::maximize(theory_var v) {
|
||||
inf_eps_rational<inf_rational> theory_diff_logic<Ext>::maximize(theory_var v) {
|
||||
objective_term const& objective = m_objectives[v];
|
||||
|
||||
IF_VERBOSE(1,
|
||||
|
@ -1029,12 +1029,14 @@ bool theory_diff_logic<Ext>::maximize(theory_var v) {
|
|||
for (unsigned i = 0; i < potentials.size(); ++i) {
|
||||
tout << "v" << i << " -> " << potentials[i] << "\n";
|
||||
});
|
||||
|
||||
rational r = m_objective_value.get_rational().to_rational();
|
||||
rational i = m_objective_value.get_infinitesimal().to_rational();
|
||||
return inf_eps_rational<inf_rational>(inf_rational(r, i));
|
||||
}
|
||||
else {
|
||||
std::cout << "Unbounded objective" << std::endl;
|
||||
return inf_eps_rational<inf_rational>::infinity();
|
||||
}
|
||||
return is_optimal;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
|
@ -1054,13 +1056,6 @@ theory_var theory_diff_logic<Ext>::add_objective(app* term) {
|
|||
return result;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
inf_eps_rational<inf_rational> theory_diff_logic<Ext>::get_objective_value(theory_var v) {
|
||||
rational r = m_objective_value.get_rational().to_rational();
|
||||
rational i = m_objective_value.get_infinitesimal().to_rational();
|
||||
return inf_eps_rational<inf_rational>(inf_rational(r, i));
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
expr* theory_diff_logic<Ext>::block_lower_bound(theory_var v, inf_rational const& val) {
|
||||
ast_manager& m = get_manager();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue