From b8e5fc9f435f6c67de4c9ea78298ac567dd40502 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Tue, 28 Nov 2017 15:08:28 -0800 Subject: [PATCH] remove SMTLIB1 printing Signed-off-by: Nikolaj Bjorner --- src/api/api_ast.cpp | 23 +---------------------- src/api/z3_api.h | 4 +--- src/ast/ast_smt_pp.cpp | 17 +++++++++-------- src/ast/ast_smt_pp.h | 1 - 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/src/api/api_ast.cpp b/src/api/api_ast.cpp index e22603225..76b0eb717 100644 --- a/src/api/api_ast.cpp +++ b/src/api/api_ast.cpp @@ -832,30 +832,9 @@ extern "C" { case Z3_PRINT_LOW_LEVEL: buffer << mk_ll_pp(to_ast(a), mk_c(c)->m()); break; - case Z3_PRINT_SMTLIB_COMPLIANT: { - ast_smt_pp pp(mk_c(c)->m()); - pp_params params; - pp.set_simplify_implies(params.simplify_implies()); - ast* a1 = to_ast(a); - pp.set_logic(mk_c(c)->fparams().m_logic); - if (!is_expr(a1)) { - buffer << mk_pp(a1, mk_c(c)->m()); - break; - } - if (mk_c(c)->get_print_mode() == Z3_PRINT_SMTLIB_COMPLIANT) { - pp.display_expr(buffer, to_expr(a1)); - break; - } - if (mk_c(c)->get_print_mode() == Z3_PRINT_SMTLIB2_COMPLIANT) { - pp.display_expr_smt2(buffer, to_expr(a1)); - break; - } - break; - } - case Z3_PRINT_SMTLIB2_COMPLIANT: { + case Z3_PRINT_SMTLIB2_COMPLIANT: buffer << mk_ismt2_pp(to_ast(a), mk_c(c)->m()); break; - } default: UNREACHABLE(); } diff --git a/src/api/z3_api.h b/src/api/z3_api.h index 56d9f69b7..7edcada37 100644 --- a/src/api/z3_api.h +++ b/src/api/z3_api.h @@ -1314,13 +1314,11 @@ typedef enum { - Z3_PRINT_SMTLIB_FULL: Print AST nodes in SMTLIB verbose format. - Z3_PRINT_LOW_LEVEL: Print AST nodes using a low-level format. - - Z3_PRINT_SMTLIB_COMPLIANT: Print AST nodes in SMTLIB 1.x compliant format. - Z3_PRINT_SMTLIB2_COMPLIANT: Print AST nodes in SMTLIB 2.x compliant format. */ typedef enum { Z3_PRINT_SMTLIB_FULL, Z3_PRINT_LOW_LEVEL, - Z3_PRINT_SMTLIB_COMPLIANT, Z3_PRINT_SMTLIB2_COMPLIANT } Z3_ast_print_mode; @@ -5116,7 +5114,7 @@ extern "C" { To print shared common subexpressions only once, use the Z3_PRINT_LOW_LEVEL mode. To print in way that conforms to SMT-LIB standards and uses let - expressions to share common sub-expressions use Z3_PRINT_SMTLIB_COMPLIANT. + expressions to share common sub-expressions use Z3_PRINT_SMTLIB2_COMPLIANT. \sa Z3_ast_to_string \sa Z3_pattern_to_string diff --git a/src/ast/ast_smt_pp.cpp b/src/ast/ast_smt_pp.cpp index 906fd054b..352c8db98 100644 --- a/src/ast/ast_smt_pp.cpp +++ b/src/ast/ast_smt_pp.cpp @@ -478,7 +478,7 @@ class smt_printer { void print_no_lets(expr *e) { - smt_printer p(m_out, m_manager, m_qlists, m_renaming, m_logic, true, m_simplify_implies, true, m_indent, m_num_var_names, m_var_names); + smt_printer p(m_out, m_manager, m_qlists, m_renaming, m_logic, true, m_simplify_implies, m_indent, m_num_var_names, m_var_names); p(e); } @@ -511,7 +511,7 @@ class smt_printer { m_out << "(! "; } { - smt_printer p(m_out, m_manager, m_qlists, m_renaming, m_logic, false, true, m_simplify_implies, m_indent, m_num_var_names, m_var_names); + smt_printer p(m_out, m_manager, m_qlists, m_renaming, m_logic, false, m_simplify_implies, m_indent, m_num_var_names, m_var_names); p(q->get_expr()); } @@ -704,7 +704,7 @@ class smt_printer { public: smt_printer(std::ostream& out, ast_manager& m, ptr_vector& ql, smt_renaming& rn, - symbol logic, bool no_lets, bool is_smt2, bool simplify_implies, unsigned indent, unsigned num_var_names = 0, char const* const* var_names = 0) : + symbol logic, bool no_lets, bool simplify_implies, unsigned indent, unsigned num_var_names = 0, char const* const* var_names = 0) : m_out(out), m_manager(m), m_qlists(ql), @@ -895,24 +895,25 @@ ast_smt_pp::ast_smt_pp(ast_manager& m): {} +#if 0 void ast_smt_pp::display_expr(std::ostream& strm, expr* n) { - ptr_vector ql; - smt_renaming rn; - smt_printer p(strm, m_manager, ql, rn, m_logic, false, false, m_simplify_implies, 0); + ptr_vector ql; smt_renaming rn; + smt_printer p(strm, m_manager, ql, rn, m_logic, false, m_simplify_implies, 0); p(n); } +#endif void ast_smt_pp::display_expr_smt2(std::ostream& strm, expr* n, unsigned indent, unsigned num_var_names, char const* const* var_names) { ptr_vector ql; smt_renaming rn; - smt_printer p(strm, m_manager, ql, rn, m_logic, false, true, m_simplify_implies, indent, num_var_names, var_names); + smt_printer p(strm, m_manager, ql, rn, m_logic, false, m_simplify_implies, indent, num_var_names, var_names); p(n); } void ast_smt_pp::display_ast_smt2(std::ostream& strm, ast* a, unsigned indent, unsigned num_var_names, char const* const* var_names) { ptr_vector ql; smt_renaming rn; - smt_printer p(strm, m_manager, ql, rn, m_logic, false, true, m_simplify_implies, indent, num_var_names, var_names); + smt_printer p(strm, m_manager, ql, rn, m_logic, false, m_simplify_implies, indent, num_var_names, var_names); if (is_expr(a)) { p(to_expr(a)); } diff --git a/src/ast/ast_smt_pp.h b/src/ast/ast_smt_pp.h index dd2a6d753..41ed06a92 100644 --- a/src/ast/ast_smt_pp.h +++ b/src/ast/ast_smt_pp.h @@ -77,7 +77,6 @@ public: void display(std::ostream& strm, expr* n); void display_smt2(std::ostream& strm, expr* n); - void display_expr(std::ostream& strm, expr* n); void display_expr_smt2(std::ostream& strm, expr* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0); void display_ast_smt2(std::ostream& strm, ast* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0);