d_propEngine(NULL),
d_proofManager(NULL),
d_definedFunctions(NULL),
- d_fmfRecFunctionsAbs(NULL),
- d_fmfRecFunctionsConcrete(NULL),
+ d_fmfRecFunctionsDefined(NULL),
d_assertionList(NULL),
d_assignments(NULL),
d_modelGlobalCommands(),
d_definedFunctions = new(true) DefinedFunctionMap(d_userContext);
if( options::fmfFunWellDefined() || options::fmfFunWellDefinedRelevant() ){
- d_fmfRecFunctionsAbs = new(true) TypeNodeMap(d_userContext);
- d_fmfRecFunctionsConcrete = new(true) NodeListMap(d_userContext);
+ d_fmfRecFunctionsDefined = new(true) NodeList(d_userContext);
}
d_modelCommands = new(true) smt::CommandList(d_userContext);
}
d_definedFunctions->deleteSelf();
- if( d_fmfRecFunctionsAbs != NULL ){
- d_fmfRecFunctionsAbs->deleteSelf();
+ if( d_fmfRecFunctionsDefined != NULL ){
+ d_fmfRecFunctionsDefined->deleteSelf();
}
- if( d_fmfRecFunctionsConcrete != NULL ){
- d_fmfRecFunctionsConcrete->deleteSelf();
- }
-
+
delete d_theoryEngine;
d_theoryEngine = NULL;
delete d_propEngine;
if( options::fmfFunWellDefined() ){
quantifiers::FunDefFmf fdf;
//must carry over current definitions (for incremental)
- for( SmtEngine::TypeNodeMap::const_iterator fit = d_smt.d_fmfRecFunctionsAbs->begin(); fit != d_smt.d_fmfRecFunctionsAbs->end(); ++fit ){
- Node f = (*fit).first;
- TypeNode ft = (*fit).second;
+ for( context::CDList<Node>::const_iterator fit = d_smt.d_fmfRecFunctionsDefined->begin();
+ fit != d_smt.d_fmfRecFunctionsDefined->end(); ++fit ) {
+ Node f = (*fit);
+ Assert( d_smt.d_fmfRecFunctionsAbs.find( f )!=d_smt.d_fmfRecFunctionsAbs.end() );
+ TypeNode ft = d_smt.d_fmfRecFunctionsAbs[f];
fdf.d_sorts[f] = ft;
- SmtEngine::NodeListMap::const_iterator fcit = d_smt.d_fmfRecFunctionsConcrete->find( f );
- Assert( fcit!=d_smt.d_fmfRecFunctionsConcrete->end() );
- SmtEngine::NodeList* cl = (*fcit).second;
- for( SmtEngine::NodeList::const_iterator cit = cl->begin(); cit != cl->end(); ++cit ){
- fdf.d_input_arg_inj[f].push_back( *cit );
+ std::map< Node, std::vector< Node > >::iterator fcit = d_smt.d_fmfRecFunctionsConcrete.find( f );
+ Assert( fcit!=d_smt.d_fmfRecFunctionsConcrete.end() );
+ for( unsigned j=0; j<fcit->second.size(); j++ ){
+ fdf.d_input_arg_inj[f].push_back( fcit->second[j] );
}
}
fdf.simplify( d_assertions.ref() );
//must store new definitions (for incremental)
for( unsigned i=0; i<fdf.d_funcs.size(); i++ ){
Node f = fdf.d_funcs[i];
- d_smt.d_fmfRecFunctionsAbs->insert( f, fdf.d_sorts[f] );
- SmtEngine::NodeList* cl = new(true) SmtEngine::NodeList( d_smt.d_userContext );
+ d_smt.d_fmfRecFunctionsAbs[f] = fdf.d_sorts[f];
+ d_smt.d_fmfRecFunctionsConcrete[f].clear();
for( unsigned j=0; j<fdf.d_input_arg_inj[f].size(); j++ ){
- cl->push_back( fdf.d_input_arg_inj[f][j] );
+ d_smt.d_fmfRecFunctionsConcrete[f].push_back( fdf.d_input_arg_inj[f][j] );
}
- d_smt.d_fmfRecFunctionsConcrete->insert( f, cl );
+ d_smt.d_fmfRecFunctionsDefined->push_back( f );
}
}
Trace("smt-proc") << "SmtEnginePrivate::processAssertions() : post-quant-preprocess" << endl;
/** The type of our internal assignment set */
typedef context::CDHashSet<Node, NodeHashFunction> AssignmentSet;
/** The types for the recursive function definitions */
- typedef context::CDHashMap< Node, TypeNode, NodeHashFunction > TypeNodeMap;
typedef context::CDList<Node> NodeList;
- typedef context::CDHashMap<Node, NodeList*, NodeHashFunction> NodeListMap;
/** Expr manager context */
context::Context* d_context;
/** An index of our defined functions */
DefinedFunctionMap* d_definedFunctions;
/** recursive function definition abstractions for --fmf-fun */
- TypeNodeMap* d_fmfRecFunctionsAbs;
- NodeListMap* d_fmfRecFunctionsConcrete;
+ std::map< Node, TypeNode > d_fmfRecFunctionsAbs;
+ std::map< Node, std::vector< Node > > d_fmfRecFunctionsConcrete;
+ NodeList* d_fmfRecFunctionsDefined;
/**
* The assertion list (before any conversion) for supporting
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
- ** \brief Implementation of anti-skolemization
+ ** \brief Implementation of anti-skolemization, e.g.:
** ( forall x. P[ f( x ) ] ^ forall x. Q[ f( x ) ] ) => forall x. exists y. ( P[ y ] ^ Q[ y ] )
**/
}
}
+QuantAntiSkolem::CDSkQuantCache::~CDSkQuantCache() {
+ for(std::map< Node, CDSkQuantCache* >::iterator i = d_data.begin(), iend = d_data.end();
+ i != iend; ++i){
+ CDSkQuantCache* current = (*i).second;
+ Assert(current != NULL);
+ delete current;
+ }
+}
+
QuantAntiSkolem::QuantAntiSkolem(QuantifiersEngine* qe)
: QuantifiersModule(qe) {
d_sqc = new CDSkQuantCache(qe->getUserContext());
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
- ** \brief dynamic quantifiers splitting
+ ** \brief anti-skolemization
**/
#include "cvc4_private.h"
class CDSkQuantCache {
public:
CDSkQuantCache( context::Context* c ) : d_valid( c, false ){}
+ ~CDSkQuantCache();
std::map< Node, CDSkQuantCache* > d_data;
context::CDO< bool > d_valid;
bool add( context::Context* c, std::vector< Node >& quants, unsigned index = 0 );