3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Polysat disjunctive lemmas (WIP) (#5275)

* Extend search state by boolean literals

* Only resolve against positive equality

* mk_dep_ref

* Make clause non-owning

* scoped_clause

* Use scoped_clause

* minor

* scoped_ptr move assignment

* WIP: internal handling of disjunctive constraints

* leaf_value

* disjunctive constraints continued

* Fix bool_lit

* Actually add constraints to storage

* Some fixes

* more fixes

* constraint should have a bool_lit instead of a bool_var

* propagate(bool_lit)

* updates

* interface changes

* small fixes

* Make sat::dimacs_lit's constructor explicit

(otherwise, calling operator<< with sat::literal is ambiguous)

* Use sat::literal

* Print test name at the beginning

* Convention: constraint corresponds to the positive boolean literal

* Make constraint ownership more explicit

* clause stores literals
This commit is contained in:
Jakob Rath 2021-05-21 22:50:25 +02:00 committed by GitHub
parent 49e9782238
commit 28996429df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 1196 additions and 360 deletions

View file

@ -44,6 +44,7 @@ public:
public:
unsigned get_ref_count() const { return m_ref_count; }
bool is_leaf() const { return m_leaf == 1; }
value const& leaf_value() const { SASSERT(is_leaf()); return static_cast<leaf const*>(this)->m_value; }
};
private:

View file

@ -17,6 +17,7 @@ Author:
#pragma once
#include "util/lbool.h"
#include "util/approx_set.h"
#include "util/vector.h"
#include "util/uint_set.h"
@ -93,6 +94,8 @@ namespace sat {
inline bool operator==(literal const & l1, literal const & l2) { return l1.m_val == l2.m_val; }
inline bool operator!=(literal const & l1, literal const & l2) { return l1.m_val != l2.m_val; }
inline std::ostream & operator<<(std::ostream & out, sat::literal l) { if (l == sat::null_literal) out << "null"; else out << (l.sign() ? "-" : "") << l.var(); return out; }
typedef svector<literal> literal_vector;
typedef std::pair<literal, literal> literal_pair;
@ -160,7 +163,7 @@ namespace sat {
struct dimacs_lit {
literal m_lit;
dimacs_lit(literal l):m_lit(l) {}
explicit dimacs_lit(literal l):m_lit(l) {}
};
inline std::ostream & operator<<(std::ostream & out, dimacs_lit const & dl) {
@ -189,6 +192,3 @@ namespace sat {
}
};
inline std::ostream & operator<<(std::ostream & out, sat::literal l) { if (l == sat::null_literal) out << "null"; else out << (l.sign() ? "-" : "") << l.var(); return out; }

View file

@ -269,6 +269,11 @@ public:
return *this;
}
scoped_ptr& operator=(scoped_ptr&& other) {
*this = other.detach();
return *this;
};
T * detach() {
T* tmp = m_ptr;
m_ptr = nullptr;