mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
do not use nl variables in random_update()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
3ab7477663
commit
06173aa4d7
7 changed files with 57 additions and 7 deletions
|
@ -325,6 +325,8 @@ public:
|
|||
|
||||
bool is_monic_var(lpvar v) const { return m_var2index.get(v, UINT_MAX) != UINT_MAX; }
|
||||
|
||||
bool is_used_in_monic(lpvar v) const { return v < m_use_lists.size() && m_use_lists[v].m_head != nullptr; }
|
||||
|
||||
bool elists_are_consistent(std::unordered_map<unsigned_vector, std::unordered_set<lpvar>, hash_svector> &lists) const;
|
||||
|
||||
}; // end of emonics
|
||||
|
|
|
@ -1439,15 +1439,11 @@ void lar_solver::fill_var_set_for_random_update(unsigned sz, var_index const * v
|
|||
for (unsigned i = 0; i < sz; i++) {
|
||||
var_index var = vars[i];
|
||||
if (var >= m_terms_start_index) { // handle the term
|
||||
lpvar j = adjust_term_index(var);
|
||||
if (column_is_int(j))
|
||||
continue;
|
||||
for (auto it : *m_terms[var - m_terms_start_index]) {
|
||||
column_list.push_back(it.var());
|
||||
}
|
||||
} else {
|
||||
if (!column_is_int(var))
|
||||
column_list.push_back(var);
|
||||
column_list.push_back(var);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1712,4 +1712,25 @@ unsigned core::get_var_weight(lpvar j) const {
|
|||
}
|
||||
|
||||
|
||||
bool core::is_nl_var(lpvar j) const {
|
||||
if (is_monic_var(j))
|
||||
return true;
|
||||
return m_emons.is_used_in_monic(j);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool core::influences_nl_var(lpvar j) const {
|
||||
if (m_lar_solver.is_term(j))
|
||||
j = m_lar_solver.adjust_term_index(j);
|
||||
if (is_nl_var(j))
|
||||
return true;
|
||||
for (const auto & c : m_lar_solver.A_r().m_columns[j]) {
|
||||
lpvar basic_in_row = m_lar_solver.r_basis()[c.var()];
|
||||
if (is_nl_var(basic_in_row))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // end of nla
|
||||
|
|
|
@ -412,6 +412,9 @@ public:
|
|||
dd::pdd pdd_expr(const rational& c, lpvar j, u_dependency*&);
|
||||
void set_level2var_for_grobner();
|
||||
void configure_grobner();
|
||||
bool influences_nl_var(lpvar) const;
|
||||
bool is_nl_var(lpvar) const;
|
||||
bool is_used_in_monic(lpvar) const;
|
||||
}; // end of core
|
||||
|
||||
struct pp_mon {
|
||||
|
|
|
@ -51,6 +51,10 @@ void solver::pop(unsigned n) {
|
|||
solver::solver(lp::lar_solver& s): m_core(alloc(core, s, m_res_limit)) {
|
||||
}
|
||||
|
||||
bool solver::influences_nl_var(lpvar j) const {
|
||||
return m_core->influences_nl_var(j);
|
||||
}
|
||||
|
||||
solver::~solver() {
|
||||
dealloc(m_core);
|
||||
}
|
||||
|
|
|
@ -44,5 +44,6 @@ public:
|
|||
bool need_check();
|
||||
lbool check(vector<lemma>&);
|
||||
bool is_monic_var(lpvar) const;
|
||||
bool influences_nl_var(lpvar) const;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue