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

port to emonomials (#90)

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-04-18 13:17:24 -07:00 committed by Lev Nachmanson
parent b52e79b648
commit e28e83a25e
20 changed files with 666 additions and 683 deletions

View file

@ -30,22 +30,22 @@ typedef unsigned lpvar;
enum class factor_type { VAR, RM }; // RM stands for rooted monomial
class factor {
unsigned m_index;
unsigned m_var;
factor_type m_type;
public:
factor() {}
explicit factor(unsigned j) : factor(j, factor_type::VAR) {}
factor(unsigned i, factor_type t) : m_index(i), m_type(t) {}
unsigned index() const { return m_index; }
unsigned& index() { return m_index; }
factor(unsigned i, factor_type t) : m_var(i), m_type(t) {}
unsigned var() const { return m_var; }
unsigned& var() { return m_var; }
factor_type type() const { return m_type; }
factor_type& type() { return m_type; }
bool is_var() const { return m_type == factor_type::VAR; }
bool operator==(factor const& other) const {
return m_index == other.index() && m_type == other.type();
return m_var == other.var() && m_type == other.type();
}
bool operator!=(factor const& other) const {
return m_index != other.index() || m_type != other.type();
return m_var != other.var() || m_type != other.type();
}
};