diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2013-11-26 19:02:21 -0600 |
---|---|---|
committer | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2013-11-26 19:02:32 -0600 |
commit | dd7e0c66cab285c154f59ff27132059c34e09e23 (patch) | |
tree | 73d61f763801d0c115dfe2e2849abdd771918944 /src/theory/quantifiers/quantifiers_rewriter.cpp | |
parent | e45b3b0ff2ffc9bee6f090a4744f6d5eb6da8b72 (diff) |
Bug fix for E-matching select terms, minor fix for bounded integers, bug fix to improve performance of quantifiers rewriter
Diffstat (limited to 'src/theory/quantifiers/quantifiers_rewriter.cpp')
-rw-r--r-- | src/theory/quantifiers/quantifiers_rewriter.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp index e27897a96..ecc3c02bc 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.cpp +++ b/src/theory/quantifiers/quantifiers_rewriter.cpp @@ -117,16 +117,25 @@ bool QuantifiersRewriter::hasArg( std::vector< Node >& args, Node n ){ } void QuantifiersRewriter::setNestedQuantifiers( Node n, Node q ){ - if( n.getKind()==FORALL || n.getKind()==EXISTS ){ - Trace("quantifiers-rewrite-debug") << "Set nested quant attribute " << n << std::endl; - NestedQuantAttribute nqai; - n.setAttribute(nqai,q); - } - for( int i=0; i<(int)n.getNumChildren(); i++ ){ - setNestedQuantifiers( n[i], q ); + std::vector< Node > processed; + setNestedQuantifiers2( n, q, processed ); +} + +void QuantifiersRewriter::setNestedQuantifiers2( Node n, Node q, std::vector< Node >& processed ) { + if( std::find( processed.begin(), processed.end(), n )==processed.end() ){ + processed.push_back( n ); + if( n.getKind()==FORALL || n.getKind()==EXISTS ){ + Trace("quantifiers-rewrite-debug") << "Set nested quant attribute " << n << std::endl; + NestedQuantAttribute nqai; + n.setAttribute(nqai,q); + } + for( int i=0; i<(int)n.getNumChildren(); i++ ){ + setNestedQuantifiers2( n[i], q, processed ); + } } } + RewriteResponse QuantifiersRewriter::preRewrite(TNode in) { Trace("quantifiers-rewrite-debug") << "pre-rewriting " << in << " " << in.hasAttribute(NestedQuantAttribute()) << std::endl; if( in.getKind()==kind::EXISTS || in.getKind()==kind::FORALL ){ |