Skip to content

Commit

Permalink
print lemmas2console faster
Browse files Browse the repository at this point in the history
- add option pp.no_lets (default = false) to print formulas without let (used by the low-level SMT2 printer).
- print lemmas2console faster by using the low level printer
  • Loading branch information
NikolajBjorner committed Mar 20, 2023
1 parent a9e6e56 commit c6e3fb4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ast/ast_smt_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Revision History:
#include "ast/for_each_ast.h"
#include "ast/decl_collector.h"
#include "math/polynomial/algebraic_numbers.h"
#include "ast/pp_params.hpp"


// ---------------------------------------
Expand Down Expand Up @@ -911,7 +912,9 @@ ast_smt_pp::ast_smt_pp(ast_manager& m):
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<quantifier> ql;
smt_renaming rn;
smt_printer p(strm, m_manager, ql, rn, m_logic, false, m_simplify_implies, indent, num_var_names, var_names);
pp_params params;
bool no_lets = params.no_lets();
smt_printer p(strm, m_manager, ql, rn, m_logic, no_lets, m_simplify_implies, indent, num_var_names, var_names);
p(n);
}

Expand Down
1 change: 1 addition & 0 deletions src/ast/pp_params.pyg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def_module_params('pp',
('max_width', UINT, 80, 'max. width in pretty printer'),
('max_ribbon', UINT, 80, 'max. ribbon (width - indentation) in pretty printer'),
('max_depth', UINT, 5, 'max. term depth (when pretty printing SMT2 terms/formulas)'),
('no_lets', BOOL, False, 'dont print lets in low level SMT printer'),
('min_alias_size', UINT, 10, 'min. size for creating an alias for a shared term (when pretty printing SMT2 terms/formulas)'),
('decimal', BOOL, False, 'pretty print real numbers using decimal notation (the output may be truncated). Z3 adds a ? if the value is not precise'),
('decimal_precision', UINT, 10, 'maximum number of decimal places to be used when pp.decimal=true'),
Expand Down
2 changes: 2 additions & 0 deletions src/ast/simplifiers/elim_unconstrained.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Module Name:

class elim_unconstrained : public dependent_expr_simplifier {

friend class seq_simplifier;

struct node {
unsigned m_refcount = 0;
expr* m_term = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/smt/smt_internalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ namespace smt {
fml = mk_or(fmls);
m_lemma_visitor.collect(fml);
m_lemma_visitor.display_skolem_decls(std::cout);
m_lemma_visitor.display_assert(std::cout, fml.get(), true);
m_lemma_visitor.display_assert(std::cout, fml.get(), false);
}

}
Expand Down

0 comments on commit c6e3fb4

Please sign in to comment.