3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

work on random_updates

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-04-07 18:28:17 -07:00
parent ae8c6acc1a
commit 5c9fd90031
3 changed files with 27 additions and 23 deletions

View file

@ -265,7 +265,6 @@ class theory_lra::imp {
svector<std::pair<theory_var, theory_var> > m_assume_eq_candidates;
unsigned m_assume_eq_head;
std::unordered_map<lp::impq, theory_var> m_var_value_table;
lp::u_set m_tmp_var_set;
unsigned m_num_conflicts;
@ -1588,7 +1587,7 @@ public:
bool assume_eqs() {
svector<lpvar> vars;
m_var_value_table.clear();
m_model_eqs.reset();
m_tmp_var_set.clear();
m_tmp_var_set.resize(th.get_num_vars());
theory_var sz = static_cast<theory_var>(th.get_num_vars());
@ -1600,37 +1599,26 @@ public:
if (!th.is_relevant_and_shared(n1)) {
continue;
}
lpvar vi = lp().external_to_local(v);
if (vi == lp::null_lpvar)
lpvar vj = lp().external_to_column_index(v);
if (vj == lp::null_lpvar)
continue;
if (lp::tv::is_term(vi)) {
vi = lp().map_term_index_to_column_index(vi);
}
const auto& vi_val = lp().get_column_value(vi);
auto it = m_var_value_table.find(vi_val);
if (it == m_var_value_table.end()) {
m_var_value_table[vi_val] = v;
theory_var other = m_model_eqs.insert_if_not_there(v);
if (other == v) {
continue;
}
theory_var other = it->second;
SASSERT(other != v);
enode * n2 = get_enode(other);
if (n1->get_root() == n2->get_root())
continue;
if (!lp().column_is_fixed(vi)) {
vars.push_back(vi);
if (!lp().column_is_fixed(vj)) {
vars.push_back(vj);
}
else if (!m_tmp_var_set.contains(other)) {
m_tmp_var_set.insert(other);
lpvar other_j = lp().external_to_local(other);
if (lp::tv::is_term(other_j)) {
other_j = lp().map_term_index_to_column_index(other_j);
}
else if (!m_tmp_var_set.contains(other) ) {
unsigned other_j = lp().external_to_column_index(other);
if (!lp().column_is_fixed(other_j)) {
m_tmp_var_set.insert(other);
vars.push_back(other_j);
}
}
}
}
if (vars.empty()) {
return false;