3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

experiment with substituting zeros in Horner&Grobner

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-01-11 15:43:54 -08:00
parent 45c0f2225c
commit f0b530b0e4
4 changed files with 26 additions and 12 deletions

View file

@ -1553,10 +1553,14 @@ const rational& core::val_of_fixed_var_with_deps(lpvar j, u_dependency*& dep) {
}
dd::pdd core::pdd_expr(const rational& c, lpvar j, u_dependency*& dep) {
if (m_nla_settings.grobner_subs_fixed() && var_is_fixed(j)) {
if (m_nla_settings.grobner_subs_fixed() == 1 && var_is_fixed(j)) {
return m_pdd_manager.mk_val(c * val_of_fixed_var_with_deps(j, dep));
}
if (m_nla_settings.grobner_subs_fixed() == 2 && var_is_fixed_to_zero(j)) {
return m_pdd_manager.mk_val(val_of_fixed_var_with_deps(j, dep));
}
if (!is_monic_var(j))
return c * m_pdd_manager.mk_var(j);
@ -1566,6 +1570,8 @@ dd::pdd core::pdd_expr(const rational& c, lpvar j, u_dependency*& dep) {
for (lpvar k : m.vars()) {
if (m_nla_settings.grobner_subs_fixed() && var_is_fixed(k)) {
r *= m_pdd_manager.mk_val(val_of_fixed_var_with_deps(k, dep));
} else if (m_nla_settings.grobner_subs_fixed() == 2 && var_is_fixed_to_zero(k)) {
return m_pdd_manager.mk_val(val_of_fixed_var_with_deps(k, dep));
} else {
r *= m_pdd_manager.mk_var(k);
}