3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +00:00

init of m_active_vars_weights and fixes in is_simplified

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-10-07 16:19:28 -07:00
parent b2d1bcc8cd
commit 0c126031b0
12 changed files with 129 additions and 92 deletions

View file

@ -34,8 +34,8 @@ class cross_nested {
ptr_vector<nex> m_b_split_vec;
int m_reported;
bool m_random_bit;
nex_creator m_nex_creator;
std::function<nex_scalar*()> m_mk_scalar;
nex_creator& m_nex_creator;
#ifdef Z3DEBUG
nex* m_e_clone;
#endif
@ -45,13 +45,15 @@ public:
cross_nested(std::function<bool (const nex*)> call_on_result,
std::function<bool (unsigned)> var_is_fixed,
std::function<unsigned ()> random) :
std::function<unsigned ()> random,
nex_creator& nex_cr) :
m_call_on_result(call_on_result),
m_var_is_fixed(var_is_fixed),
m_random(random),
m_done(false),
m_reported(0),
m_mk_scalar([this]{return m_nex_creator.mk_scalar(rational(1));})
m_mk_scalar([this]{return m_nex_creator.mk_scalar(rational(1));}),
m_nex_creator(nex_cr)
{}
@ -369,15 +371,15 @@ public:
// all factors of j go to a, the rest to b
void pre_split(nex_sum * e, lpvar j, nex_sum*& a, nex*& b) {
TRACE("nla_cn_details", tout << "e = " << * e << ", j = " << m_nex_creator.ch(j) << std::endl;);
SASSERT(m_nex_creator.is_simplified(e));
a = m_nex_creator.mk_sum();
m_b_split_vec.clear();
for (nex * ce: *e) {
TRACE("nla_cn_details", tout << "ce = " << *ce << "\n";);
if (is_divisible_by_var(ce, j)) {
a->add_child(m_nex_creator.mk_div(ce , j));
} else {
m_b_split_vec.push_back(ce);
TRACE("nla_cn_details", tout << "ce = " << *ce << "\n";);
}
}
TRACE("nla_cn_details", tout << "a = " << *a << "\n";);