mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
add an assert
Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
parent
c1e0c79a69
commit
9407c4e96f
2 changed files with 13 additions and 0 deletions
|
@ -1709,8 +1709,19 @@ void lar_solver::push_and_register_term(lar_term* t) {
|
|||
m_terms.push_back(t);
|
||||
}
|
||||
|
||||
|
||||
// terms
|
||||
bool lar_solver::all_vars_are_registered(const vector<std::pair<mpq, var_index>> & coeffs) {
|
||||
for (const auto & p : coeffs) {
|
||||
if (p.second >= m_var_register.size()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var_index lar_solver::add_term(const vector<std::pair<mpq, var_index>> & coeffs) {
|
||||
lp_assert(all_vars_are_registered(coeffs));
|
||||
if (strategy_is_undecided())
|
||||
return add_term_undecided(coeffs);
|
||||
|
||||
|
|
|
@ -176,6 +176,8 @@ public:
|
|||
|
||||
|
||||
// terms
|
||||
bool all_vars_are_registered(const vector<std::pair<mpq, var_index>> & coeffs);
|
||||
|
||||
var_index add_term(const vector<std::pair<mpq, var_index>> & coeffs);
|
||||
|
||||
var_index add_term_undecided(const vector<std::pair<mpq, var_index>> & coeffs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue