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

add DDNF based engine

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-08-21 18:04:46 -07:00
parent 8822bc1755
commit b596828d23
11 changed files with 761 additions and 11 deletions

View file

@ -208,6 +208,22 @@ void bit_vector::display(std::ostream & out) const {
#endif
}
bool bit_vector::contains(bit_vector const& other) const {
unsigned n = num_words();
if (n == 0)
return true;
for (unsigned i = 0; i < n - 1; ++i) {
if ((m_data[i] & other.m_data[i]) != other.m_data[i])
return false;
}
unsigned bit_rest = m_num_bits % 32;
unsigned mask = (1U << bit_rest) - 1;
if (mask == 0) mask = UINT_MAX;
unsigned other_data = other.m_data[n-1] & mask;
return (m_data[n-1] & other_data) == other_data;
}
void fr_bit_vector::reset() {
unsigned sz = size();
unsigned_vector::const_iterator it = m_one_idxs.begin();

View file

@ -200,6 +200,9 @@ public:
bit_vector & operator&=(bit_vector const & source);
void display(std::ostream & out) const;
bool contains(const bit_vector & other) const;
};
inline std::ostream & operator<<(std::ostream & out, bit_vector const & b) {