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

fix bugs related to emons

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-04-25 12:00:44 -07:00
parent f78a2058fc
commit 8303d8c9ae
5 changed files with 9 additions and 10 deletions

View file

@ -143,7 +143,7 @@ namespace nla {
}
}
unsigned idx = m_monomials.size();
m_monomials.push_back(monomial(v, vars.size(), vars.c_ptr(), idx));
m_monomials.push_back(monomial(v, vars, idx));
m_var2index.setx(v, idx, UINT_MAX);
do_canonize(m_monomials[idx]);
monomial const* result = nullptr;

View file

@ -104,7 +104,7 @@ struct const_iterator_mon {
};
struct factorization_factory {
const svector<lpvar>& m_vars;
const svector<lpvar> m_vars;
const monomial* m_monomial;
// returns true if found
virtual bool find_rm_monomial_of_vars(const svector<lpvar>& vars, unsigned& i) const = 0;

View file

@ -740,7 +740,7 @@ bool basics::basic_lemma_for_mon_neutral_from_factors_to_monomial_model_based(co
explain(f);
TRACE("nla_solver",
c().print_lemma(tout);
tout << "rm = " << rm;
tout << "rm = " << pp_rmon(c(), rm);
);
return true;
}

View file

@ -173,8 +173,7 @@ std::ostream & core::print_factor_with_vars(const factor& f, std::ostream& out)
print_var(f.var(), out);
}
else {
out << " RM = " << m_emons[f.var()];
out << "\n orig mon = " << m_emons[f.var()];
out << " RM = " << pp_rmon(*this, m_emons[f.var()]);
}
return out;
}
@ -1447,8 +1446,8 @@ void core::trace_print_ol(const monomial& ac,
const monomial& bc,
const factor& b,
std::ostream& out) {
out << "ac = " << ac << "\n";
out << "bc = " << bc << "\n";
out << "ac = " << pp_mon(*this, ac) << "\n";
out << "bc = " << pp_mon(*this, bc) << "\n";
out << "a = ";
print_factor_with_vars(a, out);
out << ", \nb = ";
@ -1585,7 +1584,7 @@ bool core::find_bfc_to_refine(bfc& bf, lpvar &j, rational& sign, const monomial*
j = rm.var();
sign = rm.rsign();
TRACE("nla_solver", tout << "found bf";
tout << ":rm:" << rm << "\n";
tout << ":rm:" << pp_rmon(*this, rm) << "\n";
tout << "bf:"; print_bfc(bf, tout);
tout << ", product = " << val(rm) << ", but should be =" << val(bf.m_x)*val(bf.m_y);
tout << ", j == "; print_var(j, tout) << "\n";);

View file

@ -187,8 +187,8 @@ bool order::order_lemma_on_ac_and_bc(const monomial& rm_ac,
bool k,
const monomial& rm_bd) {
TRACE("nla_solver",
tout << "rm_ac = " << rm_ac << "\n";
tout << "rm_bd = " << rm_bd << "\n";
tout << "rm_ac = " << pp_rmon(_(), rm_ac) << "\n";
tout << "rm_bd = " << pp_rmon(_(), rm_bd) << "\n";
tout << "ac_f[k] = ";
c().print_factor_with_vars(ac_f[k], tout););
factor b;