3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 05:48:44 +00:00

fix constant offset and handling of ite in difference logic optimizer code-path. Issue #946

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-03-24 02:23:50 -07:00
parent 5d11a1cdb2
commit ec47706226
2 changed files with 10 additions and 3 deletions

View file

@ -273,7 +273,8 @@ namespace opt {
display_benchmark(); display_benchmark();
IF_VERBOSE(1, verbose_stream() << "(optimize:check-sat)\n";); IF_VERBOSE(1, verbose_stream() << "(optimize:check-sat)\n";);
lbool is_sat = s.check_sat(0,0); lbool is_sat = s.check_sat(0,0);
TRACE("opt", tout << "initial search result: " << is_sat << "\n";); TRACE("opt", tout << "initial search result: " << is_sat << "\n";
s.display(tout););
if (is_sat != l_false) { if (is_sat != l_false) {
s.get_model(m_model); s.get_model(m_model);
s.get_labels(m_labels); s.get_labels(m_labels);
@ -1037,6 +1038,10 @@ namespace opt {
TRACE("opt", tout << "Purifying " << term << "\n";); TRACE("opt", tout << "Purifying " << term << "\n";);
term = purify(fm, term); term = purify(fm, term);
} }
else if (m.is_ite(term)) {
TRACE("opt", tout << "Purifying " << term << "\n";);
term = purify(fm, term);
}
if (fm) { if (fm) {
m_model_converter = concat(m_model_converter.get(), fm.get()); m_model_converter = concat(m_model_converter.get(), fm.get());
} }

View file

@ -868,7 +868,8 @@ namespace smt {
e = ctx.get_enode(to_app(n)); e = ctx.get_enode(to_app(n));
} }
else { else {
e = ctx.mk_enode(to_app(n), false, false, true); ctx.internalize(n, false);
e = ctx.get_enode(n);
} }
v = e->get_th_var(get_id()); v = e->get_th_var(get_id());
if (v == null_theory_var) { if (v == null_theory_var) {
@ -1008,7 +1009,8 @@ namespace smt {
inf_eps result(rational(0), r); inf_eps result(rational(0), r);
blocker = mk_gt(v, result); blocker = mk_gt(v, result);
IF_VERBOSE(10, verbose_stream() << blocker << "\n";); IF_VERBOSE(10, verbose_stream() << blocker << "\n";);
return result; r += m_objective_consts[v];
return inf_eps(rational(0), r);
} }
default: default:
TRACE("opt", tout << "unbounded\n"; ); TRACE("opt", tout << "unbounded\n"; );