From 700689a4e4ed42b5198816611eac5bcc1278284d Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Sat, 9 Jun 2012 00:35:38 +0000 Subject: Dagification of output expressions. By default, common subexpressions are dagified if they appear > 1 time and are not constants or variables. This can be changed with --default-expr-dag=N --- N is a threshold such that if the subexpression occurs > N times, it is dagified; a setting of 0 turns off dagification entirely. If you notice strange dumping behavior (taking too long to print anything, e.g.), revert to the old behavior with --default-expr-dag=0 and let me know of the problem. --- src/expr/expr_template.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/expr/expr_template.cpp') diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp index d0f5fde9e..c70fed889 100644 --- a/src/expr/expr_template.cpp +++ b/src/expr/expr_template.cpp @@ -45,6 +45,7 @@ namespace expr { const int ExprSetDepth::s_iosIndex = std::ios_base::xalloc(); const int ExprPrintTypes::s_iosIndex = std::ios_base::xalloc(); +const int ExprDag::s_iosIndex = std::ios_base::xalloc(); const int ExprSetLanguage::s_iosIndex = std::ios_base::xalloc(); }/* CVC4::expr namespace */ @@ -416,10 +417,10 @@ bool Expr::isConst() const { return d_node->isConst(); } -void Expr::toStream(std::ostream& out, int depth, bool types, +void Expr::toStream(std::ostream& out, int depth, bool types, size_t dag, OutputLanguage language) const { ExprManagerScope ems(*this); - d_node->toStream(out, depth, types, language); + d_node->toStream(out, depth, types, dag, language); } Node Expr::getNode() const throw() { -- cgit v1.2.3