mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
bug fix in init and getting explanations
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
59e2dab69a
commit
f5e646cbcb
|
@ -134,12 +134,14 @@ namespace lp {
|
||||||
if (all_vars_are_int) {
|
if (all_vars_are_int) {
|
||||||
term_o t;
|
term_o t;
|
||||||
const auto lcm = get_denominators_lcm(row);
|
const auto lcm = get_denominators_lcm(row);
|
||||||
for (const auto & p: row) {
|
for (const auto & p: row)
|
||||||
t.add_monomial(lcm * p.coeff(), p.var());
|
if (lia.is_fixed(p.var()))
|
||||||
if(lia.is_fixed(p.var())) {
|
|
||||||
t.c() += lia.lower_bound(p.var()).x;
|
t.c() += lia.lower_bound(p.var()).x;
|
||||||
}
|
else
|
||||||
}
|
t.add_monomial(lcm * p.coeff(), p.var());
|
||||||
|
|
||||||
|
t.j() = i; //hijach this field to point to the original tableau row
|
||||||
|
|
||||||
unsigned lvar = static_cast<unsigned>(m_f.size());
|
unsigned lvar = static_cast<unsigned>(m_f.size());
|
||||||
lar_term lt = lar_term(lvar);
|
lar_term lt = lar_term(lvar);
|
||||||
eprime_pair pair = {t, lt};
|
eprime_pair pair = {t, lt};
|
||||||
|
@ -293,16 +295,17 @@ namespace lp {
|
||||||
|
|
||||||
}
|
}
|
||||||
void explain(lp::explanation& ex) {
|
void explain(lp::explanation& ex) {
|
||||||
|
SASSERT(ex.empty());
|
||||||
auto & ep = m_eprime[m_conflict_index];
|
auto & ep = m_eprime[m_conflict_index];
|
||||||
for (const auto & p : ep.m_l) {
|
for (const auto & p : ep.m_l) {
|
||||||
remove_fresh_variables(m_eprime[p.j()].m_e);
|
remove_fresh_variables(m_eprime[p.j()].m_e);
|
||||||
}
|
}
|
||||||
u_dependency* dep = nullptr;
|
u_dependency* dep = nullptr;
|
||||||
for (const auto & pl : ep.m_l)
|
for (const auto & pl : ep.m_l) {
|
||||||
for (const auto & p : m_eprime[pl.j()].m_e)
|
for (const auto & p : lra.get_row(m_eprime[pl.j()].m_e.j()))
|
||||||
if (lra.column_is_fixed(p.j()))
|
if (lra.column_is_fixed(p.var()))
|
||||||
lra.explain_fixed_column(p.j(), ex);
|
lra.explain_fixed_column(p.var(), ex);
|
||||||
|
}
|
||||||
TRACE("dioph_eq", lra.print_expl(tout, ex););
|
TRACE("dioph_eq", lra.print_expl(tout, ex););
|
||||||
}
|
}
|
||||||
void remove_fresh_variables(term_o& t) {
|
void remove_fresh_variables(term_o& t) {
|
||||||
|
|
Loading…
Reference in a new issue