3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 11:25:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-05-06 09:26:08 -07:00
parent 5ca8295dcc
commit bd5aa2ac21
2 changed files with 68 additions and 3 deletions

View file

@ -140,6 +140,8 @@ namespace polysat {
var_t select_smallest_var() { return m_to_patch.empty()?null_var:m_to_patch.erase_min(); }
lbool make_var_feasible(var_t x_i);
bool is_infeasible_row(var_t x);
bool is_parity_infeasible_row(var_t x);
bool is_offset_row(row const& r, var_t& x, var_t & y) const;
void pivot(var_t x_i, var_t x_j, numeral const& b, numeral const& value);
numeral value2delta(var_t v, numeral const& new_value) const;
void update_value(var_t v, numeral const& delta);
@ -206,8 +208,16 @@ namespace polysat {
void swap(numeral& a, numeral& b) { std::swap(a, b); }
// treat numerals as signed and check for overflow/underflow
bool signed_mul(numeral& r, numeral const& x, numeral const& y) { r = x * y; return true; }
bool signed_add(numeral& r, numeral const& x, numeral const& y) { r = x + y; return true; }
bool signed_mul(numeral& r, numeral const& x, numeral const& y) {
r = x * y;
if (y != 0 && x != r / y)
return false;
return true;
}
bool signed_add(numeral& r, numeral const& x, numeral const& y) {
r = x + y;
return x <= r;
}
std::ostream& display(std::ostream& out, numeral const& x) const { return out << x; }
};
typedef _scoped_numeral<manager> scoped_numeral;