mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
smarter explanation.h (#4385)
* smarter explanation.h Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * clean explanation API Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * suppress warnings Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * disable the warnings Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
3b0c40044f
commit
af2f74c05f
16 changed files with 109 additions and 89 deletions
|
@ -67,7 +67,7 @@ struct gomory_test {
|
|||
}
|
||||
k.addmul(new_a, lower_bound(x_j).x); // is it a faster operation than
|
||||
// k += lower_bound(x_j).x * new_a;
|
||||
expl.push_justification(column_lower_bound_constraint(x_j), new_a);
|
||||
expl.add_with_coeff(column_lower_bound_constraint(x_j), new_a);
|
||||
}
|
||||
else {
|
||||
lp_assert(at_upper(x_j));
|
||||
|
@ -79,7 +79,7 @@ struct gomory_test {
|
|||
new_a = a / (mpq(1) - f_0);
|
||||
}
|
||||
k.addmul(new_a, upper_bound(x_j).x); // k += upper_bound(x_j).x * new_a;
|
||||
expl.push_justification(column_upper_bound_constraint(x_j), new_a);
|
||||
expl.add_with_coeff(column_upper_bound_constraint(x_j), new_a);
|
||||
}
|
||||
TRACE("gomory_cut_detail_real", tout << a << "*v" << x_j << " k: " << k << "\n";);
|
||||
pol.add_monomial(new_a, x_j);
|
||||
|
@ -107,7 +107,7 @@ struct gomory_test {
|
|||
new_a = (1 - f_j) / f_0;
|
||||
}
|
||||
k.addmul(new_a, lower_bound(x_j).x);
|
||||
expl.push_justification(column_lower_bound_constraint(x_j), new_a);
|
||||
expl.add_with_coeff(column_lower_bound_constraint(x_j), new_a);
|
||||
}
|
||||
else {
|
||||
lp_assert(at_upper(x_j));
|
||||
|
@ -119,7 +119,7 @@ struct gomory_test {
|
|||
}
|
||||
new_a.neg(); // the upper terms are inverted
|
||||
k.addmul(new_a, upper_bound(x_j).x);
|
||||
expl.push_justification(column_upper_bound_constraint(x_j), new_a);
|
||||
expl.add_with_coeff(column_upper_bound_constraint(x_j), new_a);
|
||||
}
|
||||
TRACE("gomory_cut_detail", tout << "new_a: " << new_a << " k: " << k << "\n";);
|
||||
t.add_monomial(new_a, x_j);
|
||||
|
|
|
@ -78,6 +78,7 @@ void test_cn_on_expr(nex_sum *t, cross_nested& cn) {
|
|||
}
|
||||
|
||||
void test_nex_order() {
|
||||
#if Z3DEBUG
|
||||
enable_trace("nla_cn");
|
||||
enable_trace("nla_cn_details");
|
||||
// enable_trace("nla_cn_details_");
|
||||
|
@ -116,6 +117,7 @@ void test_nex_order() {
|
|||
nex_mul * poly = r.mk_mul(five_a_pl_one, b);
|
||||
nex * p = r.simplify(poly);
|
||||
std::cout << "poly = " << *poly << " , p = " << *p << "\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_simplify() {
|
||||
|
|
|
@ -218,7 +218,7 @@ void test_basic_lemma_for_mon_neutral_from_factors_to_monomial_0() {
|
|||
}
|
||||
}
|
||||
|
||||
SASSERT(found0 && (found1 || found2));
|
||||
VERIFY(found0 && (found1 || found2));
|
||||
|
||||
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ void test_basic_lemma_for_mon_neutral_from_factors_to_monomial_1() {
|
|||
|
||||
}
|
||||
|
||||
SASSERT(found0 && found1 && found2 && found3);
|
||||
VERIFY(found0 && found1 && found2 && found3);
|
||||
|
||||
}
|
||||
void test_basic_lemma_for_mon_neutral_from_factors_to_monomial() {
|
||||
|
@ -364,7 +364,7 @@ void test_basic_lemma_for_mon_zero_from_factors_to_monomial() {
|
|||
}
|
||||
}
|
||||
|
||||
SASSERT(found0 && found1);
|
||||
VERIFY(found0 && found1);
|
||||
}
|
||||
|
||||
void test_basic_lemma_for_mon_zero_from_monomial_to_factors() {
|
||||
|
@ -416,7 +416,7 @@ void test_basic_lemma_for_mon_zero_from_monomial_to_factors() {
|
|||
}
|
||||
}
|
||||
|
||||
SASSERT(found0 && found1 && found2);
|
||||
VERIFY(found0 && found1 && found2);
|
||||
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ void test_basic_lemma_for_mon_neutral_from_monomial_to_factors() {
|
|||
}
|
||||
}
|
||||
|
||||
SASSERT(found0 && found1);
|
||||
VERIFY(found0 && found1);
|
||||
}
|
||||
|
||||
void test_horner() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue