3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

rebase with Z3Prover

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-12-31 12:46:26 -08:00
parent 7eac995824
commit d310ae9060
15 changed files with 156 additions and 149 deletions

View file

@ -82,7 +82,7 @@ struct gomory_test {
expl.push_justification(column_upper_bound_constraint(x_j), new_a);
}
TRACE("gomory_cut_detail_real", tout << a << "*v" << x_j << " k: " << k << "\n";);
pol.add_coeff_var(new_a, x_j);
pol.add_monomial(new_a, x_j);
}
void int_case_in_gomory_cut(const mpq & a, unsigned x_j, mpq & k, lar_term & t, explanation& expl, mpq & lcm_den, const mpq& f_0, const mpq& one_minus_f_0) {
@ -122,7 +122,7 @@ struct gomory_test {
expl.push_justification(column_upper_bound_constraint(x_j), new_a);
}
TRACE("gomory_cut_detail", tout << "new_a: " << new_a << " k: " << k << "\n";);
t.add_coeff_var(new_a, x_j);
t.add_monomial(new_a, x_j);
lcm_den = lcm(lcm_den, denominator(new_a));
}
@ -145,12 +145,12 @@ struct gomory_test {
if (!k.is_int())
k = ceil(k);
// switch size
t.add_coeff_var(- mpq(1), v);
t.add_monomial(- mpq(1), v);
k.neg();
} else {
if (!k.is_int())
k = floor(k);
t.add_coeff_var(mpq(1), v);
t.add_monomial(mpq(1), v);
}
} else {
TRACE("gomory_cut_detail", tout << "pol.size() > 1" << std::endl;);
@ -177,7 +177,7 @@ struct gomory_test {
// negate everything to return -pol <= -k
for (const auto & pi: pol)
t.add_coeff_var(-pi.first, pi.second);
t.add_monomial(-pi.first, pi.second);
k.neg();
}
TRACE("gomory_cut_detail", tout << "k = " << k << std::endl;);

View file

@ -118,10 +118,10 @@ void test_basic_lemma_for_mon_neutral_from_factors_to_monomial_0() {
i0.m_term.add_var(lp_ac);
ineq i1(llc::EQ, lp::lar_term(), rational(0));
i1.m_term.add_var(lp_bde);
i1.m_term.add_coeff_var(-rational(1), lp_abcde);
i1.m_term.add_monomial(-rational(1), lp_abcde);
ineq i2(llc::EQ, lp::lar_term(), rational(0));
i2.m_term.add_var(lp_abcde);
i2.m_term.add_coeff_var(-rational(1), lp_bde);
i2.m_term.add_monomial(-rational(1), lp_bde);
bool found0 = false;
bool found1 = false;
bool found2 = false;
@ -428,7 +428,7 @@ void test_horner() {
lp::lar_term t;
t.add_var(lp_c);
t.add_coeff_var(rational(-1), lp_b);
t.add_monomial(rational(-1), lp_b);
lpvar lp_c_min_b = s.add_term(t.coeffs_as_vector(), c_min_b);
reslimit l;
@ -573,7 +573,7 @@ void test_order_lemma_params(bool var_equiv, int sign) {
if (var_equiv) { // make k equivalent to j
lp::lar_term t;
t.add_var(lp_k);
t.add_coeff_var(-rational(1), lp_j);
t.add_monomial(-rational(1), lp_j);
lpvar kj = s.add_term(t.coeffs_as_vector(), -1);
s.add_var_bound(kj, llc::LE, rational(0));
s.add_var_bound(kj, llc::GE, rational(0));
@ -630,15 +630,15 @@ void test_order_lemma_params(bool var_equiv, int sign) {
SASSERT(nla.get_core()->test_check(lemma) == l_false);
// lp::lar_term t;
// t.add_coeff_var(lp_bde);
// t.add_coeff_var(lp_acd);
// t.add_monomial(lp_bde);
// t.add_monomial(lp_acd);
// ineq q(llc::EQ, t, rational(0));
nla.get_core()->print_lemma(std::cout);
// SASSERT(q == lemma.back());
// ineq i0(llc::EQ, lp::lar_term(), rational(0));
// i0.m_term.add_coeff_var(lp_bde);
// i0.m_term.add_coeff_var(rational(1), lp_acd);
// i0.m_term.add_monomial(lp_bde);
// i0.m_term.add_monomial(rational(1), lp_acd);
// bool found = false;
// for (const auto& k : lemma){
// if (k == i0) {