3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-26 07:29:33 +00:00

remove lp_assert

This commit is contained in:
Nikolaj Bjorner 2025-04-14 11:10:26 -07:00
parent 1510b3112e
commit 8035edbe65
35 changed files with 332 additions and 329 deletions

View file

@ -113,7 +113,7 @@ namespace lp {
}
// if bj == v, then, because we are patching the lra.get_value(v),
// we just need to assert that the lra.get_value(v) would be integral.
lp_assert(bj != v || lra.from_model_in_impq_to_mpq(new_val).is_int());
SASSERT(bj != v || lra.from_model_in_impq_to_mpq(new_val).is_int());
}
lra.set_value_for_nbasic_column(j, lia.get_value(j) + impq(delta));
@ -142,8 +142,8 @@ namespace lp {
return false;
mpq a = fractional_part(c.coeff());
mpq r = fractional_part(lra.get_value(v));
lp_assert(0 < r && r < 1);
lp_assert(0 < a && a < 1);
SASSERT(0 < r && r < 1);
SASSERT(0 < a && a < 1);
mpq delta_plus, delta_minus;
if (!get_patching_deltas(r, a, delta_plus, delta_minus))
return false;
@ -159,7 +159,7 @@ namespace lp {
lia_move patch_basic_columns() {
lia.settings().stats().m_patches++;
lra.remove_fixed_vars_from_base();
lp_assert(lia.is_feasible());
SASSERT(lia.is_feasible());
for (unsigned j : lra.r_basis())
if (!lra.get_value(j).is_int() && lra.column_is_int(j) && !lia.is_fixed(j))
patch_basic_column(j);
@ -405,16 +405,16 @@ namespace lp {
// coprime. We can find u and v such that u*a1 + v*x2 = 1.
rational u, v;
gcd(a1, x2, u, v);
lp_assert(gcd(a1, x2, u, v).is_one());
lp_assert((x + (a1 / a2) * (-u * t) * x1).is_int());
SASSERT(gcd(a1, x2, u, v).is_one());
SASSERT((x + (a1 / a2) * (-u * t) * x1).is_int());
// 1 = (u- l*x2 ) * a1 + (v + l*a1)*x2, for every integer l.
rational d = u * t * x1;
// We can prove that x+alpha*d is integral,
// and any other delta, satisfying x+alpha*delta, is equal to d modulo a2.
delta_plus = mod(d, a2);
lp_assert(delta_plus > 0);
SASSERT(delta_plus > 0);
delta_minus = delta_plus - a2;
lp_assert(delta_minus < 0);
SASSERT(delta_minus < 0);
return true;
}
@ -551,7 +551,7 @@ namespace lp {
const mpq & a = c.coeff();
unsigned i = lrac.m_r_basis[row_index];
impq const & xi = get_value(i);
lp_assert(lrac.m_r_solver.column_is_feasible(i));
SASSERT(lrac.m_r_solver.column_is_feasible(i));
if (column_is_int(i) && !a.is_int() && xi.is_int())
m = lcm(m, denominator(a));
@ -591,7 +591,7 @@ namespace lp {
bool int_solver::is_feasible() const {
lp_assert(
SASSERT(
lrac.m_r_solver.calc_current_x_is_feasible_include_non_basis() ==
lrac.m_r_solver.current_x_is_feasible());
return lrac.m_r_solver.current_x_is_feasible();