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

add bailout option for code review #5208

@levnach
Could you review and maybe make this much more streamlined?
The patch is to simply bail out the iterator if it fails to find canonical monics.
If m_ff could produce the existing canonical monics up front this kind of bail-out could maybe avoided.
This commit is contained in:
Nikolaj Bjorner 2021-04-22 11:30:00 -07:00
parent a52b485d9c
commit d67919373e
2 changed files with 17 additions and 7 deletions

View file

@ -30,12 +30,12 @@ struct factorization_factory;
enum class factor_type { VAR, MON };
class factor {
lpvar m_var;
factor_type m_type;
bool m_sign;
lpvar m_var{ UINT_MAX };
factor_type m_type{ factor_type::VAR };
bool m_sign{ false };
public:
factor(): factor(false) {}
factor(bool sign): m_var(UINT_MAX), m_type(factor_type::VAR), m_sign(sign) {}
factor(bool sign): m_sign(sign) {}
explicit factor(lpvar v, factor_type t) : m_var(v), m_type(t), m_sign(false) {}
unsigned var() const { return m_var; }
factor_type type() const { return m_type; }
@ -77,9 +77,10 @@ public:
struct const_iterator_mon {
// fields
bool_vector m_mask;
mutable bool_vector m_mask;
const factorization_factory * m_ff;
bool m_full_factorization_returned;
mutable bool m_full_factorization_returned;
mutable unsigned m_num_failures{ 0 };
// typedefs
typedef const_iterator_mon self_type;