mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
expose labels from optimization. Move printing of objectives to after sat/unsat. Cahnge format to something that is somewhat related to how other output is created. Issue #325.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d7c3e77b66
commit
1575dd06a7
3 changed files with 19 additions and 7 deletions
|
@ -167,6 +167,12 @@ namespace opt {
|
|||
m_hard_constraints.reset();
|
||||
}
|
||||
|
||||
void context::get_labels(svector<symbol> & r) {
|
||||
if (m_solver) {
|
||||
m_solver->get_labels(r);
|
||||
}
|
||||
}
|
||||
|
||||
void context::set_hard_constraints(ptr_vector<expr>& fmls) {
|
||||
if (m_scoped_state.set(fmls)) {
|
||||
clear_state();
|
||||
|
@ -1121,16 +1127,20 @@ namespace opt {
|
|||
}
|
||||
|
||||
void context::display_assignment(std::ostream& out) {
|
||||
out << "(objectives\n";
|
||||
for (unsigned i = 0; i < m_scoped_state.m_objectives.size(); ++i) {
|
||||
objective const& obj = m_scoped_state.m_objectives[i];
|
||||
out << " (";
|
||||
display_objective(out, obj);
|
||||
if (get_lower_as_num(i) != get_upper_as_num(i)) {
|
||||
out << " |-> [" << get_lower(i) << ":" << get_upper(i) << "]\n";
|
||||
out << " (" << get_lower(i) << " " << get_upper(i) << ")";
|
||||
}
|
||||
else {
|
||||
out << " |-> " << get_lower(i) << "\n";
|
||||
out << " " << get_lower(i);
|
||||
}
|
||||
out << ")\n";
|
||||
}
|
||||
out << ")\n";
|
||||
}
|
||||
|
||||
void context::display_objective(std::ostream& out, objective const& obj) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue