3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-31 11:13:28 -07:00
parent 696a178c08
commit 43e7242e35
2 changed files with 16 additions and 13 deletions

View file

@ -42,11 +42,7 @@ class ll_printer {
} }
void display_name(func_decl * decl) { void display_name(func_decl * decl) {
symbol n = decl->get_name(); m_out << decl->get_name();
if (decl->is_skolem() && n.is_numerical())
m_out << "z3.sk." << n.get_num();
else
m_out << n;
} }
bool process_numeral(expr * n) { bool process_numeral(expr * n) {

View file

@ -695,8 +695,10 @@ class theory_lra::imp {
if (!_has_var) { if (!_has_var) {
svector<lpvar> vars; svector<lpvar> vars;
for (expr* n : *t) { for (expr* n : *t) {
if (is_app(n)) VERIFY(internalize_term(to_app(n)));
SASSERT(ctx().e_internalized(n)); SASSERT(ctx().e_internalized(n));
vars.push_back(register_theory_var_in_lar_solver(mk_var(n))); theory_var v = mk_var(n);
vars.push_back(register_theory_var_in_lar_solver(v));
} }
TRACE("arith", tout << "v" << v << " := " << mk_pp(t, m) << "\n" << vars << "\n";); TRACE("arith", tout << "v" << v << " := " << mk_pp(t, m) << "\n" << vars << "\n";);
m_solver->register_existing_terms(); m_solver->register_existing_terms();
@ -769,8 +771,8 @@ class theory_lra::imp {
enode* e = get_enode(n); enode* e = get_enode(n);
theory_var v; theory_var v;
if (!th.is_attached_to_var(e)) { if (!th.is_attached_to_var(e)) {
TRACE("arith", tout << "fresh var: " << mk_pp(n, m) << "\n";);
v = th.mk_var(e); v = th.mk_var(e);
TRACE("arith", tout << "fresh var: v" << v << " " << mk_pp(n, m) << "\n";);
SASSERT(m_bounds.size() <= static_cast<unsigned>(v) || m_bounds[v].empty()); SASSERT(m_bounds.size() <= static_cast<unsigned>(v) || m_bounds[v].empty());
if (m_bounds.size() <= static_cast<unsigned>(v)) { if (m_bounds.size() <= static_cast<unsigned>(v)) {
m_bounds.push_back(lp_bounds()); m_bounds.push_back(lp_bounds());
@ -875,13 +877,15 @@ class theory_lra::imp {
theory_var z = internalize_linearized_def(term, st); theory_var z = internalize_linearized_def(term, st);
lpvar vi = register_theory_var_in_lar_solver(z); lpvar vi = register_theory_var_in_lar_solver(z);
add_def_constraint(lp().add_var_bound(vi, lp::LE, rational::zero())); add_def_constraint(lp().add_var_bound(vi, lp::LE, rational::zero()));
// if (is_infeasible()) { if (is_infeasible()) {
IF_VERBOSE(0, verbose_stream() << "infeasible\n";);
// process_conflict(); // exit here? // process_conflict(); // exit here?
// } }
add_def_constraint(lp().add_var_bound(vi, lp::GE, rational::zero())); add_def_constraint(lp().add_var_bound(vi, lp::GE, rational::zero()));
// if (is_infeasible()) { if (is_infeasible()) {
// process_conflict(); IF_VERBOSE(0, verbose_stream() << "infeasible\n";);
// } // process_conflict(); // exit here?
}
TRACE("arith", TRACE("arith",
{ {
expr* o1 = get_enode(v1)->get_owner(); expr* o1 = get_enode(v1)->get_owner();
@ -969,7 +973,7 @@ class theory_lra::imp {
} }
theory_var v = mk_var(term); theory_var v = mk_var(term);
lpvar vi = get_lpvar(v); lpvar vi = get_lpvar(v);
TRACE("arith", tout << mk_bounded_pp(term, m) << " v" << v << " vi " << vi << "\n";); TRACE("arith", tout << mk_bounded_pp(term, m) << " v" << v << " j" << vi << "\n";);
if (vi == UINT_MAX) { if (vi == UINT_MAX) {
rational const& offset = st.offset(); rational const& offset = st.offset();
if (!offset.is_zero()) { if (!offset.is_zero()) {
@ -981,6 +985,9 @@ class theory_lra::imp {
TRACE("arith_verbose", tout << "v" << v << " := " << mk_pp(term, m) << " slack: " << vi << " scopes: " << m_scopes.size() << "\n"; TRACE("arith_verbose", tout << "v" << v << " := " << mk_pp(term, m) << " slack: " << vi << " scopes: " << m_scopes.size() << "\n";
lp().print_term(lp().get_term(vi), tout) << "\n";); lp().print_term(lp().get_term(vi), tout) << "\n";);
} }
else {
SASSERT(lp::tv::is_term(vi));
}
rational val; rational val;
if (a.is_numeral(term, val)) { if (a.is_numeral(term, val)) {
m_fixed_var_table.insert(value_sort_pair(val, is_int(v)), v); m_fixed_var_table.insert(value_sort_pair(val, is_int(v)), v);