From b33f5f879e5cf662b854d9c9e3ff968abdb50f1a Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Tue, 15 Jan 2019 17:57:11 -0800 Subject: [PATCH] fix another bug reported by Mark Dunlop Signed-off-by: Nikolaj Bjorner --- src/opt/opt_context.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opt/opt_context.cpp b/src/opt/opt_context.cpp index ffb8754a2..55b2a33ec 100644 --- a/src/opt/opt_context.cpp +++ b/src/opt/opt_context.cpp @@ -854,7 +854,10 @@ namespace opt { bool& neg, symbol& id, expr_ref& orig_term, unsigned& index) { if (!is_app(fml)) return false; neg = false; + orig_term = nullptr; + index = 0; app* a = to_app(fml); + if (m_objective_fns.find(a->get_decl(), index) && m_objectives[index].m_type == O_MAXSMT) { for (unsigned i = 0; i < a->get_num_args(); ++i) { expr_ref arg(a->get_arg(i), m); @@ -996,13 +999,13 @@ namespace opt { void context::from_fmls(expr_ref_vector const& fmls) { TRACE("opt", tout << fmls << "\n";); m_hard_constraints.reset(); - expr_ref orig_term(m); for (expr * fml : fmls) { app_ref tr(m); + expr_ref orig_term(m); expr_ref_vector terms(m); vector weights; rational offset(0); - unsigned index; + unsigned index = 0; symbol id; bool neg; if (is_maxsat(fml, terms, weights, offset, neg, id, orig_term, index)) {