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

have solver pretty print declarations, include also datatype declarations

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-08-07 08:48:24 +02:00
parent a3c43c34fb
commit 7f517c625f
4 changed files with 78 additions and 44 deletions

View file

@ -31,51 +31,15 @@ class ast_pp_util {
ast_pp_util(ast_manager& m): m(m), coll(m, false) {}
void collect(expr* e) {
coll.visit(e);
}
void collect(expr* e);
void collect(unsigned n, expr* const* es) {
for (unsigned i = 0; i < n; ++i) {
coll.visit(es[i]);
}
}
void collect(unsigned n, expr* const* es);
void collect(expr_ref_vector const& es) {
collect(es.size(), es.c_ptr());
}
void collect(expr_ref_vector const& es);
void display_decls(std::ostream& out) {
smt2_pp_environment_dbg env(m);
unsigned n = coll.get_num_sorts();
for (unsigned i = 0; i < n; ++i) {
ast_smt2_pp(out, coll.get_sorts()[i], env);
}
n = coll.get_num_decls();
for (unsigned i = 0; i < n; ++i) {
ast_smt2_pp(out, coll.get_func_decls()[i], env);
out << "\n";
}
}
void display_decls(std::ostream& out);
void display_asserts(std::ostream& out, expr_ref_vector const& fmls, bool neat = true) {
if (neat) {
smt2_pp_environment_dbg env(m);
for (unsigned i = 0; i < fmls.size(); ++i) {
out << "(assert ";
ast_smt2_pp(out, fmls[i], env);
out << ")\n";
}
}
else {
ast_smt_pp ll_smt2_pp(m);
for (unsigned i = 0; i < fmls.size(); ++i) {
out << "(assert ";
ll_smt2_pp.display_expr_smt2(out, fmls[i]);
out << ")\n";
}
}
}
void display_asserts(std::ostream& out, expr_ref_vector const& fmls, bool neat = true);
};
#endif /* AST_PP_UTIL_H_ */