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

adding dt-solver (#4739)

* adding dt-solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move mbp to self-contained module

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* files

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* Create CMakeLists.txt

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* rename to bool_var2expr to indicate type class

* mbp

* na
This commit is contained in:
Nikolaj Bjorner 2020-10-18 15:28:21 -07:00 committed by GitHub
parent b77c57451f
commit 2f756da294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 2309 additions and 1257 deletions

View file

@ -101,7 +101,7 @@ namespace euf {
public:
th_solver(ast_manager& m, symbol const& name, euf::theory_id id) : extension(name, id), m(m) {}
virtual th_solver* clone(sat::solver* s, euf::solver& ctx) = 0;
virtual th_solver* clone(euf::solver& ctx) = 0;
virtual void new_eq_eh(euf::th_eq const& eq) {}
@ -150,7 +150,7 @@ namespace euf {
sat::literal eq_internalize(expr* a, expr* b);
euf::enode* e_internalize(expr* e) { internalize(e, m_is_redundant); return expr2enode(e); }
euf::enode* mk_enode(expr* e, bool suppress_args);
euf::enode* mk_enode(expr* e, bool suppress_args = false);
expr_ref mk_eq(expr* e1, expr* e2);
expr_ref mk_var_eq(theory_var v1, theory_var v2) { return mk_eq(var2expr(v1), var2expr(v2)); }
@ -187,14 +187,19 @@ namespace euf {
class th_propagation {
unsigned m_num_literals;
unsigned m_num_eqs;
sat::literal* m_literals;
enode_pair* m_eqs;
unsigned m_num_literals;
unsigned m_num_eqs;
sat::literal* m_literals;
enode_pair* m_eqs;
static unsigned get_obj_size(unsigned num_lits, unsigned num_eqs);
th_propagation(sat::literal_vector const& lits, enode_pair_vector const& eqs);
th_propagation(unsigned n_lits, sat::literal const* lits, unsigned n_eqs, enode_pair const* eqs);
public:
static th_propagation* mk(th_euf_solver& th, sat::literal_vector const& lits, enode_pair_vector const& eqs);
static th_propagation* mk(th_euf_solver& th, unsigned n_lits, sat::literal const* lits, unsigned n_eqs, enode_pair const* eqs);
static th_propagation* mk(th_euf_solver& th, enode_pair_vector const& eqs);
static th_propagation* mk(th_euf_solver& th, sat::literal lit);
static th_propagation* mk(th_euf_solver& th, sat::literal lit, euf::enode* x, euf::enode* y);
static th_propagation* mk(th_euf_solver& th, euf::enode* x, euf::enode* y);
sat::ext_constraint_idx to_index() const {
return sat::constraint_base::mem2base(this);
@ -203,18 +208,24 @@ namespace euf {
return *reinterpret_cast<th_propagation*>(sat::constraint_base::from_index(idx)->mem());
}
sat::extension& ext() const {
return *sat::constraint_base::to_extension(to_index());
}
std::ostream& display(std::ostream& out) const;
class lits {
th_propagation& th;
th_propagation const& th;
public:
lits(th_propagation& th) : th(th) {}
lits(th_propagation const& th) : th(th) {}
sat::literal const* begin() const { return th.m_literals; }
sat::literal const* end() const { return th.m_literals + th.m_num_literals; }
};
class eqs {
th_propagation& th;
th_propagation const& th;
public:
eqs(th_propagation& th) : th(th) {}
eqs(th_propagation const& th) : th(th) {}
enode_pair const* begin() const { return th.m_eqs; }
enode_pair const* end() const { return th.m_eqs + th.m_num_eqs; }
};