mirror of
https://github.com/Z3Prover/z3
synced 2025-06-05 21:53:23 +00:00
adding nra solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
d45c56da3f
3 changed files with 18 additions and 3 deletions
|
@ -1387,8 +1387,14 @@ void lar_solver::shrink_explanation_to_minimum(vector<std::pair<mpq, constraint_
|
||||||
lean_assert(this->explanation_is_correct(explanation));
|
lean_assert(this->explanation_is_correct(explanation));
|
||||||
}
|
}
|
||||||
|
|
||||||
final_check_status check_int_feasibility() {
|
final_check_status lar_solver::check_int_feasibility() {
|
||||||
return final_check_status::GIVEUP;
|
unsigned n = A_r().column_count();
|
||||||
|
for (unsigned j = 0; j < n; j++) {
|
||||||
|
if (column_is_integer(j) && column_value_is_integer(j))
|
||||||
|
continue;
|
||||||
|
return final_check_status::GIVEUP;
|
||||||
|
}
|
||||||
|
return final_check_status::DONE;
|
||||||
}
|
}
|
||||||
} // namespace lean
|
} // namespace lean
|
||||||
|
|
||||||
|
|
|
@ -406,6 +406,16 @@ public:
|
||||||
unsigned ext_var = m_columns_to_ext_vars_or_term_indices[j];
|
unsigned ext_var = m_columns_to_ext_vars_or_term_indices[j];
|
||||||
return m_ext_vars_to_columns.find(ext_var)->second.is_integer();
|
return m_ext_vars_to_columns.find(ext_var)->second.is_integer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool impq_is_int(const impq& v) {
|
||||||
|
return v.x.is_int() && is_zero(v.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool column_value_is_integer(unsigned j) const {
|
||||||
|
const impq & v = m_mpq_lar_core_solver.m_r_x[j];
|
||||||
|
return impq_is_int(v);
|
||||||
|
}
|
||||||
inline bool column_is_real(unsigned j) const { return !column_is_integer(j); }
|
inline bool column_is_real(unsigned j) const { return !column_is_integer(j); }
|
||||||
final_check_status check_int_feasibility();
|
final_check_status check_int_feasibility();
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,6 +42,5 @@ namespace nra {
|
||||||
void push();
|
void push();
|
||||||
|
|
||||||
void pop(unsigned n);
|
void pop(unsigned n);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue