3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 21:08:46 +00:00

fix another bug reported by Mark Dunlop

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-01-15 17:57:11 -08:00
parent 3298486136
commit b33f5f879e

View file

@ -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<rational> 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)) {