3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-16 02:46:16 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-16 12:24:22 -07:00
parent e7ec842cf5
commit f86205b0e8
3 changed files with 16 additions and 6 deletions

View file

@ -297,7 +297,7 @@ namespace smt {
m_coeffs.reset();
}
void farkas_util::add(rational const & coef, app * c) {
bool farkas_util::add(rational const & coef, app * c) {
bool is_pos = true;
expr* e;
while (m.is_not(c, e)) {
@ -306,9 +306,15 @@ namespace smt {
}
if (!coef.is_zero() && !m.is_true(c)) {
m_coeffs.push_back(coef);
m_ineqs.push_back(fix_sign(is_pos, c));
if (m.is_eq(c) || a.is_le(c) || a.is_lt(c) || a.is_gt(c) || a.is_ge(c)) {
m_coeffs.push_back(coef);
m_ineqs.push_back(fix_sign(is_pos, c));
}
else {
return false;
}
}
return true;
}
expr_ref farkas_util::get() {