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

fix dotnet build

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-08-30 14:46:31 -07:00
parent 9f0b303263
commit 25106866b5
9 changed files with 153 additions and 99 deletions

View file

@ -341,6 +341,28 @@ namespace euf {
n->invariant();
}
std::ostream& egraph::display(std::ostream& out, unsigned max_args, enode* n) const {
out << std::setw(5)
<< n->get_owner_id() << " := ";
out << n->get_root()->get_owner_id() << " ";
expr* f = n->get_owner();
if (is_app(f))
out << to_app(f)->get_decl()->get_name() << " ";
else if (is_quantifier(f))
out << "q ";
else
out << "v ";
for (enode* arg : enode_args(n))
out << arg->get_owner_id() << " ";
for (unsigned i = n->num_args(); i < max_args; ++i)
out << " ";
out << "\t";
for (enode* p : enode_parents(n))
out << p->get_owner_id() << " ";
out << "\n";
return out;
}
std::ostream& egraph::display(std::ostream& out) const {
m_table.display(out);
unsigned max_args = 0;
@ -348,24 +370,7 @@ namespace euf {
max_args = std::max(max_args, n->num_args());
for (enode* n : m_nodes) {
out << std::setw(5)
<< n->get_owner_id() << " := ";
out << n->get_root()->get_owner_id() << " ";
expr* f = n->get_owner();
if (is_app(f))
out << to_app(f)->get_decl()->get_name() << " ";
else if (is_quantifier(f))
out << "q ";
else
out << "v ";
for (enode* arg : enode_args(n))
out << arg->get_owner_id() << " ";
for (unsigned i = n->num_args(); i < max_args; ++i)
out << " ";
out << "\t";
for (enode* p : enode_parents(n))
out << p->get_owner_id() << " ";
out << "\n";
display(out, max_args, n);
}
return out;
}
@ -392,16 +397,16 @@ namespace euf {
}
expr* e2 = tr(e1);
enode* n2 = mk(e2, args.size(), args.c_ptr());
m_exprs.push_back(e2);
m_nodes.push_back(n2);
old_expr2new_enode.setx(e1->get_id(), n2, nullptr);
}
for (unsigned i = 0; i < src.m_nodes.size(); ++i) {
for (unsigned i = 0; i < src.m_nodes.size(); ++i) {
enode* n1 = src.m_nodes[i];
enode* n1t = n1->m_target;
enode* n1t = n1->m_target;
enode* n2 = m_nodes[i];
enode* n2t = n1t ? old_expr2new_enode[n1t->get_owner_id()] : nullptr;
enode* n2t = n1t ? old_expr2new_enode[n1->get_owner_id()] : nullptr;
SASSERT(!n1t || n2t);
SASSERT(!n1t || src.m.get_sort(n1->get_owner()) == src.m.get_sort(n1t->get_owner()));
SASSERT(!n1t || m.get_sort(n2->get_owner()) == m.get_sort(n2t->get_owner()));
if (n1t && n2->get_root() != n2t->get_root()) {
merge(n2, n2t, n1->m_justification.copy(copy_justification));
}

View file

@ -101,6 +101,8 @@ namespace euf {
}
template <typename T>
void explain_todo(ptr_vector<T>& justifications);
std::ostream& display(std::ostream& out, unsigned max_args, enode* n) const;
public:
egraph(ast_manager& m): m(m), m_table(m), m_exprs(m) {}
@ -140,9 +142,17 @@ namespace euf {
enode_vector const& nodes() const { return m_nodes; }
void invariant();
void copy_from(egraph const& src, std::function<void*(void*)>& copy_justification);
std::ostream& display(std::ostream& out) const;
struct e_pp {
egraph const& g;
enode* n;
e_pp(egraph const& g, enode* n) : g(g), n(n) {}
std::ostream& display(std::ostream& out) const { return g.display(out, 0, n); }
};
e_pp pp(enode* n) const { return e_pp(*this, n); }
std::ostream& display(std::ostream& out) const;
void collect_statistics(statistics& st) const;
};
inline std::ostream& operator<<(std::ostream& out, egraph const& g) { return g.display(out); }
inline std::ostream& operator<<(std::ostream& out, egraph::e_pp const& p) { return p.display(out); }
}