mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
use pattern of matching with undef instead of matching with conflict to reduce assumptions on procedure contracts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
676a536e9e
commit
a41bd38a3a
|
@ -1513,17 +1513,12 @@ namespace lp {
|
||||||
// here g is the common gcd of the m_espace coefficients and the fixed var coeffs gcd
|
// here g is the common gcd of the m_espace coefficients and the fixed var coeffs gcd
|
||||||
// we can ignore the sum of the fixed
|
// we can ignore the sum of the fixed
|
||||||
lia_move tighten_bounds_for_common_gcd(const mpq& g, unsigned j) {
|
lia_move tighten_bounds_for_common_gcd(const mpq& g, unsigned j) {
|
||||||
if (tighten_one_bound_for_common_gcd(g, j, true) != lia_move::undef) {
|
auto r = tighten_one_bound_for_common_gcd(g, j, true);
|
||||||
return lia_move::conflict;
|
if (r == lia_move::undef)
|
||||||
}
|
r = tighten_one_bound_for_common_gcd(g, j, false);
|
||||||
if (tighten_one_bound_for_common_gcd(g, j, false) != lia_move::undef) {
|
if (r == lia_move::undef && m_changed_columns.contains(j))
|
||||||
return lia_move::conflict;
|
r = lia_move::continue_with_check;
|
||||||
}
|
return r;
|
||||||
if (m_changed_columns.contains(j)) {
|
|
||||||
return lia_move::continue_with_check;
|
|
||||||
}
|
|
||||||
return lia_move::undef;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lia_move tighten_on_espace(unsigned j) {
|
lia_move tighten_on_espace(unsigned j) {
|
||||||
|
@ -1534,9 +1529,8 @@ namespace lp {
|
||||||
return lia_move::undef;
|
return lia_move::undef;
|
||||||
if (g.is_zero()) {
|
if (g.is_zero()) {
|
||||||
handle_constant_term(j);
|
handle_constant_term(j);
|
||||||
if (!m_infeas_explanation.empty()) {
|
if (!m_infeas_explanation.empty())
|
||||||
return lia_move::conflict;
|
return lia_move::conflict;
|
||||||
}
|
|
||||||
return lia_move::undef;
|
return lia_move::undef;
|
||||||
}
|
}
|
||||||
if (create_branch_report(j, g)) {
|
if (create_branch_report(j, g)) {
|
||||||
|
@ -1546,20 +1540,17 @@ namespace lp {
|
||||||
|
|
||||||
mpq fg = gcd(gcd_of_fixed_vars_coeffs(j), g);
|
mpq fg = gcd(gcd_of_fixed_vars_coeffs(j), g);
|
||||||
|
|
||||||
if (!fg.is_one() && tighten_bounds_for_common_gcd(fg, j) == lia_move::conflict)
|
auto r = lia_move::undef;
|
||||||
return lia_move::conflict;
|
if (!fg.is_one())
|
||||||
|
r = tighten_bounds_for_common_gcd(fg, j);
|
||||||
// g is not trivial, trying to tighten the bounds
|
// g is not trivial, trying to tighten the bounds
|
||||||
if (tighten_bounds_for_non_trivial_gcd(g, j, true) != lia_move::undef) {
|
if (r == lia_move::undef)
|
||||||
return lia_move::conflict;
|
r = tighten_bounds_for_non_trivial_gcd(g, j, true);
|
||||||
}
|
if (r == lia_move::undef)
|
||||||
if (tighten_bounds_for_non_trivial_gcd(g, j, false) != lia_move::undef) {
|
r = tighten_bounds_for_non_trivial_gcd(g, j, false);
|
||||||
return lia_move::conflict;
|
if (r == lia_move::undef && m_changed_columns.contains(j))
|
||||||
}
|
r = lia_move::continue_with_check;
|
||||||
if (m_changed_columns.contains(j)) {
|
return r;
|
||||||
return lia_move::continue_with_check;
|
|
||||||
}
|
|
||||||
return lia_move::undef;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* j is the index of the column representing a term
|
/* j is the index of the column representing a term
|
||||||
|
|
Loading…
Reference in a new issue