From 96a0bc3b022b67b5ab79bf2ab087573c65a8d248 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Mon, 9 Oct 2017 21:56:40 -0500 Subject: Split term database (#1206) * Move equality query to own file, move equality inference to quantifiers engine. * Move quantifiers attributes out of TermDb and into QuantAttribute. * Move term database sygus to quantifiers engine, move some attributes to quantifiers attributes header. * Split term database into term util. * Partial fix for #1205 that eliminates need for dependency in node.cpp. * Add more references to github issues. --- src/theory/quantifiers/quantifiers_rewriter.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/theory/quantifiers/quantifiers_rewriter.cpp') diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp index 02f1b8509..9f6617d5a 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.cpp +++ b/src/theory/quantifiers/quantifiers_rewriter.cpp @@ -15,7 +15,9 @@ #include "theory/quantifiers/quantifiers_rewriter.h" #include "options/quantifiers_options.h" +#include "theory/quantifiers/quantifiers_attributes.h" #include "theory/quantifiers/term_database.h" +#include "theory/quantifiers/term_util.h" #include "theory/quantifiers/trigger.h" using namespace std; @@ -196,7 +198,7 @@ RewriteResponse QuantifiersRewriter::postRewrite(TNode in) { }else{ //compute attributes QAttributes qa; - TermDb::computeQuantAttributes( in, qa ); + QuantAttributes::computeQuantAttributes( in, qa ); if( !qa.isRewriteRule() ){ for( int op=0; op& n std::map< Node, Node > cache; std::map< Node, Node > icache; if( qa.isFunDef() ){ - Node h = TermDb::getFunDefHead( q ); + Node h = QuantAttributes::getFunDefHead( q ); Assert( !h.isNull() ); // if it is a function definition, rewrite the body independently - Node fbody = TermDb::getFunDefBody( q ); + Node fbody = QuantAttributes::getFunDefBody( q ); Assert( !body.isNull() ); Trace("quantifiers-rewrite-debug") << "Decompose " << h << " / " << fbody << " as function definition for " << q << "." << std::endl; Node r = computeProcessTerms2( fbody, true, true, curr_cond, 0, cache, icache, new_vars, new_conds, false ); @@ -745,7 +747,7 @@ bool QuantifiersRewriter::isConditionalVariableElim( Node n, int pol ){ }else if( n.getKind()==EQUAL ){ for( unsigned i=0; i<2; i++ ){ if( n[i].getKind()==BOUND_VARIABLE ){ - if( !TermDb::containsTerm( n[1-i], n[i] ) ){ + if( !TermUtil::containsTerm( n[1-i], n[i] ) ){ return true; } } @@ -843,7 +845,7 @@ Node QuantifiersRewriter::computeCondSplit( Node body, QAttributes& qa ){ } bool QuantifiersRewriter::isVariableElim( Node v, Node s ) { - if( TermDb::containsTerm( s, v ) || !s.getType().isSubtypeOf( v.getType() ) ){ + if( TermUtil::containsTerm( s, v ) || !s.getType().isSubtypeOf( v.getType() ) ){ return false; }else{ return true; @@ -973,7 +975,7 @@ bool QuantifiersRewriter::computeVariableElimLit( Node lit, bool pol, std::vecto if( lit.getKind()==GEQ || lit.getKind()==GT ){ //compute variables in itm->first, these are not eligible for elimination std::vector< Node > bvs; - TermDb::getBoundVars( itm->first, bvs ); + TermUtil::getBoundVars( itm->first, bvs ); for( unsigned j=0; j& args, Node bo NodeBuilder<> tb(kind::OR); for( unsigned i=0; i sub_vars; //return skolemized body - return TermDb::mkSkolemizedBody( n, nn, fvTypes, fvs, sk, sub, sub_vars ); + return TermUtil::mkSkolemizedBody( n, nn, fvTypes, fvs, sk, sub, sub_vars ); } }else{ //check if it contains a quantifier as a subterm -- cgit v1.2.3