//ensure all instantiations were accounted for
for( std::map< Node, std::vector< Node > >::iterator it = insts.begin(); it != insts.end(); ++it ){
- if( visited.find( it->first )==visited.end() ){
+ if( !it->second.empty() && visited.find( it->first )==visited.end() ){
stringstream ss;
ss << "While performing quantifier elimination, processed a quantified formula : " << it->first;
ss << " that was not related to the query. Try option --simplification=none.";
}
};
-bool AlphaEquivalenceNode::registerNode( AlphaEquivalenceNode* aen, QuantifiersEngine* qe, Node q, std::vector< Node >& tt, std::vector< int >& arg_index ) {
+Node AlphaEquivalenceNode::registerNode( AlphaEquivalenceNode* aen, QuantifiersEngine* qe, Node q, std::vector< Node >& tt, std::vector< int >& arg_index ) {
while( !tt.empty() ){
if( tt.size()==arg_index.size()+1 ){
Node t = tt.back();
}
}
}
+ Node lem;
Trace("aeq-debug") << std::endl;
if( aen->d_quant.isNull() ){
aen->d_quant = q;
- return true;
}else{
if( q.getNumChildren()==2 ){
//lemma ( q <=> d_quant )
Trace("quant-ae") << "Alpha equivalent : " << std::endl;
Trace("quant-ae") << " " << q << std::endl;
Trace("quant-ae") << " " << aen->d_quant << std::endl;
- qe->getOutputChannel().lemma( q.iffNode( aen->d_quant ) );
- return false;
+ lem = q.iffNode( aen->d_quant );
}else{
//do not reduce annotated quantified formulas based on alpha equivalence
- return true;
}
}
+ return lem;
}
-bool AlphaEquivalenceTypeNode::registerNode( AlphaEquivalenceTypeNode* aetn,
+Node AlphaEquivalenceTypeNode::registerNode( AlphaEquivalenceTypeNode* aetn,
QuantifiersEngine* qe, Node q, Node t, std::vector< TypeNode >& typs, std::map< TypeNode, int >& typ_count, int index ){
while( index<(int)typs.size() ){
TypeNode curr = typs[index];
return AlphaEquivalenceNode::registerNode( &(aetn->d_data), qe, q, tt, arg_index );
}
-bool AlphaEquivalence::reduceQuantifier( Node q ) {
+Node AlphaEquivalence::reduceQuantifier( Node q ) {
Assert( q.getKind()==FORALL );
Trace("aeq") << "Alpha equivalence : register " << q << std::endl;
//construct canonical quantified formula
sto.d_tdb = d_qe->getTermDatabase();
std::sort( typs.begin(), typs.end(), sto );
Trace("aeq-debug") << " ";
- bool ret = !AlphaEquivalenceTypeNode::registerNode( &d_ae_typ_trie, d_qe, q, t, typs, typ_count );
+ Node ret = AlphaEquivalenceTypeNode::registerNode( &d_ae_typ_trie, d_qe, q, t, typs, typ_count );
Trace("aeq") << " ...result : " << ret << std::endl;
return ret;
}
public:
std::map< Node, std::map< int, AlphaEquivalenceNode > > d_children;
Node d_quant;
- static bool registerNode( AlphaEquivalenceNode* aen, QuantifiersEngine* qe, Node q, std::vector< Node >& tt, std::vector< int >& arg_index );
+ static Node registerNode( AlphaEquivalenceNode* aen, QuantifiersEngine* qe, Node q, std::vector< Node >& tt, std::vector< int >& arg_index );
};
class AlphaEquivalenceTypeNode {
public:
std::map< TypeNode, std::map< int, AlphaEquivalenceTypeNode > > d_children;
AlphaEquivalenceNode d_data;
- static bool registerNode( AlphaEquivalenceTypeNode* aetn,
+ static Node registerNode( AlphaEquivalenceTypeNode* aetn,
QuantifiersEngine* qe, Node q, Node t, std::vector< TypeNode >& typs, std::map< TypeNode, int >& typ_count, int index = 0 );
};
public:
AlphaEquivalence( QuantifiersEngine* qe ) : d_qe( qe ){}
~AlphaEquivalence(){}
-
- bool reduceQuantifier( Node q );
+ /** reduce quantifier, return value (if non-null) is lemma justifying why q ia reducible. */
+ Node reduceQuantifier( Node q );
};
}
return true;
}else{
if( depth==q[0].getNumChildren() ){
- if( qe->addInstantiation( q, terms ) ){
+ if( qe->addInstantiation( q, terms, true ) ){
Trace("ambqi-inst-debug") << "-> Added instantiation." << std::endl;
inst++;
return true;
Assert( aq==q );
std::vector< Node > model_terms;
if( getModelValues( conj, conj->d_candidates, model_terms ) ){
- d_quantEngine->addInstantiation( q, model_terms, false );
+ d_quantEngine->addInstantiation( q, model_terms );
}
}
}else{
}else{
//just add the instance
d_triedLemmas++;
- if( d_qe->addInstantiation( f, inst ) ){
+ if( d_qe->addInstantiation( f, inst, true ) ){
Trace("fmc-debug-inst") << "** Added instantiation." << std::endl;
d_addedLemmas++;
if( d_qe->inConflict() || options::fmfOneInstPerRound() ){
if (ev!=d_true) {
Trace("fmc-exh-debug") << ", add!";
//add as instantiation
- if( d_qe->addInstantiation( f, inst ) ){
+ if( d_qe->addInstantiation( f, inst, true ) ){
Trace("fmc-exh-debug") << " ...success.";
addedLemmas++;
if( d_qe->inConflict() || options::fmfOneInstPerRound() ){
}
bool InstMatchTrie::addInstMatch( QuantifiersEngine* qe, Node f, std::vector< Node >& m, bool modEq,
- bool modInst, ImtIndexOrder* imtio, bool onlyExist, int index ) {
+ ImtIndexOrder* imtio, bool onlyExist, int index ) {
if( index==(int)f[0].getNumChildren() || ( imtio && index==(int)imtio->d_order.size() ) ){
return false;
}else{
Node n = m[i_index];
std::map< Node, InstMatchTrie >::iterator it = d_data.find( n );
if( it!=d_data.end() ){
- bool ret = it->second.addInstMatch( qe, f, m, modEq, modInst, imtio, onlyExist, index+1 );
+ bool ret = it->second.addInstMatch( qe, f, m, modEq, imtio, onlyExist, index+1 );
if( !onlyExist || !ret ){
return ret;
}
if( en!=n ){
std::map< Node, InstMatchTrie >::iterator itc = d_data.find( en );
if( itc!=d_data.end() ){
- if( itc->second.addInstMatch( qe, f, m, modEq, modInst, imtio, true, index+1 ) ){
+ if( itc->second.addInstMatch( qe, f, m, modEq, imtio, true, index+1 ) ){
return false;
}
}
}
}
if( !onlyExist ){
- d_data[n].addInstMatch( qe, f, m, modEq, modInst, imtio, false, index+1 );
+ d_data[n].addInstMatch( qe, f, m, modEq, imtio, false, index+1 );
}
return true;
}
bool CDInstMatchTrie::addInstMatch( QuantifiersEngine* qe, Node f, std::vector< Node >& m,
- context::Context* c, bool modEq, bool modInst, int index, bool onlyExist ){
+ context::Context* c, bool modEq, int index, bool onlyExist ){
bool reset = false;
if( !d_valid.get() ){
if( onlyExist ){
Node n = m[ index ];
std::map< Node, CDInstMatchTrie* >::iterator it = d_data.find( n );
if( it!=d_data.end() ){
- bool ret = it->second->addInstMatch( qe, f, m, c, modEq, modInst, index+1, onlyExist );
+ bool ret = it->second->addInstMatch( qe, f, m, c, modEq, index+1, onlyExist );
if( !onlyExist || !ret ){
return reset || ret;
}
if( en!=n ){
std::map< Node, CDInstMatchTrie* >::iterator itc = d_data.find( en );
if( itc!=d_data.end() ){
- if( itc->second->addInstMatch( qe, f, m, c, modEq, modInst, index+1, true ) ){
+ if( itc->second->addInstMatch( qe, f, m, c, modEq, index+1, true ) ){
return false;
}
}
CDInstMatchTrie* imt = new CDInstMatchTrie( c );
Assert(d_data.find(n) == d_data.end());
d_data[n] = imt;
- imt->addInstMatch( qe, f, m, c, modEq, modInst, index+1, false );
+ imt->addInstMatch( qe, f, m, c, modEq, index+1, false );
}
return true;
}
modInst is if we return true if m is an instance of a match that exists
*/
bool existsInstMatch( QuantifiersEngine* qe, Node f, InstMatch& m, bool modEq = false,
- bool modInst = false, ImtIndexOrder* imtio = NULL, int index = 0 ) {
- return !addInstMatch( qe, f, m, modEq, modInst, imtio, true, index );
+ ImtIndexOrder* imtio = NULL, int index = 0 ) {
+ return !addInstMatch( qe, f, m, modEq, imtio, true, index );
}
bool existsInstMatch( QuantifiersEngine* qe, Node f, std::vector< Node >& m, bool modEq = false,
- bool modInst = false, ImtIndexOrder* imtio = NULL, int index = 0 ) {
- return !addInstMatch( qe, f, m, modEq, modInst, imtio, true, index );
+ ImtIndexOrder* imtio = NULL, int index = 0 ) {
+ return !addInstMatch( qe, f, m, modEq, imtio, true, index );
}
/** add match m for quantifier f, take into account equalities if modEq = true,
if imtio is non-null, this is the order to add to trie
return true if successful
*/
bool addInstMatch( QuantifiersEngine* qe, Node f, InstMatch& m, bool modEq = false,
- bool modInst = false, ImtIndexOrder* imtio = NULL, bool onlyExist = false, int index = 0 ){
- return addInstMatch( qe, f, m.d_vals, modEq, modInst, imtio, onlyExist, index );
+ ImtIndexOrder* imtio = NULL, bool onlyExist = false, int index = 0 ){
+ return addInstMatch( qe, f, m.d_vals, modEq, imtio, onlyExist, index );
}
bool addInstMatch( QuantifiersEngine* qe, Node f, std::vector< Node >& m, bool modEq = false,
- bool modInst = false, ImtIndexOrder* imtio = NULL, bool onlyExist = false, int index = 0 );
+ ImtIndexOrder* imtio = NULL, bool onlyExist = false, int index = 0 );
bool removeInstMatch( QuantifiersEngine* qe, Node f, std::vector< Node >& m, ImtIndexOrder* imtio = NULL, int index = 0 );
void print( std::ostream& out, Node q ) const{
std::vector< TNode > terms;
modInst is if we return true if m is an instance of a match that exists
*/
bool existsInstMatch( QuantifiersEngine* qe, Node q, InstMatch& m, context::Context* c, bool modEq = false,
- bool modInst = false, int index = 0 ) {
- return !addInstMatch( qe, q, m, c, modEq, modInst, index, true );
+ int index = 0 ) {
+ return !addInstMatch( qe, q, m, c, modEq, index, true );
}
bool existsInstMatch( QuantifiersEngine* qe, Node q, std::vector< Node >& m, context::Context* c, bool modEq = false,
- bool modInst = false, int index = 0 ) {
- return !addInstMatch( qe, q, m, c, modEq, modInst, index, true );
+ int index = 0 ) {
+ return !addInstMatch( qe, q, m, c, modEq, index, true );
}
/** add match m for quantifier f, take into account equalities if modEq = true,
if imtio is non-null, this is the order to add to trie
return true if successful
*/
bool addInstMatch( QuantifiersEngine* qe, Node q, InstMatch& m, context::Context* c, bool modEq = false,
- bool modInst = false, int index = 0, bool onlyExist = false ) {
- return addInstMatch( qe, q, m.d_vals, c, modEq, modInst, index, onlyExist );
+ int index = 0, bool onlyExist = false ) {
+ return addInstMatch( qe, q, m.d_vals, c, modEq, index, onlyExist );
}
bool addInstMatch( QuantifiersEngine* qe, Node q, std::vector< Node >& m, context::Context* c, bool modEq = false,
- bool modInst = false, int index = 0, bool onlyExist = false );
+ int index = 0, bool onlyExist = false );
bool removeInstMatch( QuantifiersEngine* qe, Node q, std::vector< Node >& m, int index = 0 );
void print( std::ostream& out, Node q ) const{
std::vector< TNode > terms;
public:
/** add match m, return true if successful */
bool addInstMatch( QuantifiersEngine* qe, Node f, InstMatch& m, bool modEq = false, bool modInst = false ){
- return d_imt.addInstMatch( qe, f, m, modEq, modInst, d_imtio );
+ return d_imt.addInstMatch( qe, f, m, modEq, d_imtio );
}
bool existsInstMatch( QuantifiersEngine* qe, Node f, InstMatch& m, bool modEq = false, bool modInst = false ){
- return d_imt.existsInstMatch( qe, f, m, modEq, modInst, d_imtio );
+ return d_imt.existsInstMatch( qe, f, m, modEq, d_imtio );
}
};/* class InstMatchTrieOrdered */
return d_next->getNextMatch( f, m, qe );
}else{
if( d_active_add ){
- return qe->addInstantiation( f, m, false );
+ return qe->addInstantiation( f, m );
}else{
return true;
}
while( getNextMatch( f, m, qe ) ){
if( !d_active_add ){
m.add( baseMatch );
- if( qe->addInstantiation( f, m, false ) ){
+ if( qe->addInstantiation( f, m ) ){
addedLemmas++;
if( qe->inConflict() ){
break;
if( !d_match_pattern.isNull() ){
InstMatch m( f );
if( getMatch( f, t, m, qe ) ){
- if( qe->addInstantiation( f, m, false ) ){
+ if( qe->addInstantiation( f, m ) ){
return 1;
}
}
}
}else{
//m is an instantiation
- if( qe->addInstantiation( d_f, m, false ) ){
+ if( qe->addInstantiation( d_f, m ) ){
addedLemmas++;
Debug("smart-multi-trigger") << "-> Produced instantiation " << m << std::endl;
}
Debug("simple-trigger") << "...set " << it->second << " " << t[it->first] << std::endl;
m.setValue( it->second, t[it->first] );
}
- if( qe->addInstantiation( d_f, m, false ) ){
+ if( qe->addInstantiation( d_f, m ) ){
addedLemmas++;
Debug("simple-trigger") << "-> Produced instantiation " << m << std::endl;
}
return 0;
}
}
- return qe->addInstantiation( q, m, false ) ? 1 : 0;
+ return qe->addInstantiation( q, m ) ? 1 : 0;
}
}/* CVC4::theory::inst namespace */
if( d_quantEngine->getTermDatabase()->isQAttrQuantElimPartial( d_curr_quant ) ){
d_cbqi_set_quant_inactive = true;
d_incomplete_check = true;
- d_quantEngine->recordInstantiationInternal( d_curr_quant, subs, false, false, true );
+ d_quantEngine->recordInstantiationInternal( d_curr_quant, subs, false, false );
return true;
}else{
//check if we need virtual term substitution (if used delta or infinity)
bool used_vts = d_quantEngine->getTermDatabase()->containsVtsTerm( subs, false );
- if( d_quantEngine->addInstantiation( d_curr_quant, subs, false, false, false, used_vts ) ){
+ if( d_quantEngine->addInstantiation( d_curr_quant, subs, false, false, used_vts ) ){
//d_added_inst.insert( d_curr_quant );
return true;
}else{
unsigned rstart = options::fullSaturateQuantRd() ? 0 : 1;
unsigned rend = fullEffort ? 1 : rstart;
for( unsigned r=rstart; r<=rend; r++ ){
- /*
- //complete guess
- if( d_guessed.find( f )==d_guessed.end() ){
- Trace("inst-alg") << "-> Guess instantiate " << f << "..." << std::endl;
- d_guessed[f] = true;
- InstMatch m( f );
- if( d_quantEngine->addInstantiation( f, m ) ){
- ++(d_quantEngine->d_statistics.d_instantiations_guess);
- return true;
- }
- }
- */
if( rd || r>0 ){
if( r==0 ){
Trace("inst-alg") << "-> Relevant domain instantiate " << f << "..." << std::endl;
Trace("inst-alg-rd") << " " << d_quantEngine->getTermDatabase()->getTypeGroundTerm( ftypes[i], childIndex[i] ) << std::endl;
}
}
- if( d_quantEngine->addInstantiation( f, terms, false ) ){
+ if( d_quantEngine->addInstantiation( f, terms ) ){
Trace("inst-alg-rd") << "Success!" << std::endl;
++(d_quantEngine->d_statistics.d_instantiations_guess);
return true;
//try to add it
Trace("inst-fmf-init") << "Init: try to add match " << d_quant_basis_match[f] << std::endl;
//add model basis instantiation
- if( d_qe->addInstantiation( fp, d_quant_basis_match[f], false ) ){
+ if( d_qe->addInstantiation( fp, d_quant_basis_match[f] ) ){
d_quant_basis_match_added[f] = true;
return 1;
}else{
}
Debug("fmf-model-eval") << "* Add instantiation " << m << std::endl;
//add as instantiation
- if( d_qe->addInstantiation( f, m ) ){
+ if( d_qe->addInstantiation( f, m, true ) ){
d_addedLemmas++;
if( d_qe->inConflict() ){
break;
Debug("fmf-model-eval") << "* Add instantiation " << m << std::endl;
triedLemmas++;
//add as instantiation
- if( d_quantEngine->addInstantiation( f, m ) ){
+ if( d_quantEngine->addInstantiation( f, m, true ) ){
addedLemmas++;
if( d_quantEngine->inConflict() ){
break;
Assert( !getTermDatabase()->isEntailed( inst, true ) );
Assert( getTermDatabase()->isEntailed( inst, false ) || e>effort_conflict );
}
- if( d_quantEngine->addInstantiation( q, terms, false ) ){
+ if( d_quantEngine->addInstantiation( q, terms ) ){
Trace("qcf-check") << " ... Added instantiation" << std::endl;
Trace("qcf-inst") << "*** Was from effort " << e << " : " << std::endl;
qi->debugPrintMatch("qcf-inst");
if( inst.size()>f[0].getNumChildren() ){
inst.resize( f[0].getNumChildren() );
}
- if( d_quantEngine->addInstantiation( f, inst, false ) ){
+ if( d_quantEngine->addInstantiation( f, inst ) ){
addedLemmas++;
tempAddedLemmas++;
/*
QuantifiersEngine::QuantifiersEngine(context::Context* c, context::UserContext* u, TheoryEngine* te):
d_te( te ),
//d_quants(u),
- //d_quants_red(u),
+ d_quants_red(u),
d_lemmas_produced_c(u),
d_skolemized(u),
d_ierCounter_c(c),
if( d_hasAddedLemma ){
return;
}
+ if( !d_recorded_inst.empty() ){
+ Trace("quant-engine-debug") << "Removing " << d_recorded_inst.size() << " instantiations..." << std::endl;
+ //remove explicitly recorded instantiations
+ for( unsigned i=0; i<d_recorded_inst.size(); i++ ){
+ removeInstantiationInternal( d_recorded_inst[i].first, d_recorded_inst[i].second );
+ }
+ d_recorded_inst.clear();
+ }
if( Trace.isOn("quant-engine-debug") ){
Trace("quant-engine-debug") << "Quantifiers Engine check, level = " << e << std::endl;
}
}else if( quant_e==QEFFORT_MODEL ){
if( e==Theory::EFFORT_LAST_CALL ){
+ if( !d_recorded_inst.empty() ){
+ setIncomplete = true;
+ }
//if we have a chance not to set incomplete
if( !setIncomplete ){
setIncomplete = false;
}
bool QuantifiersEngine::reduceQuantifier( Node q ) {
- std::map< Node, bool >::iterator it = d_quants_red.find( q );
+ BoolMap::const_iterator it = d_quants_red.find( q );
if( it==d_quants_red.end() ){
- if( d_alpha_equiv ){
- Trace("quant-engine-red") << "Alpha equivalence " << q << "?" << std::endl;
- //add equivalence with another quantified formula
- if( d_alpha_equiv->reduceQuantifier( q ) ){
- Trace("quant-engine-red") << "...alpha equivalence success." << std::endl;
- ++(d_statistics.d_red_alpha_equiv);
- d_quants_red[q] = true;
- return true;
+ Node lem;
+ std::map< Node, Node >::iterator itr = d_quants_red_lem.find( q );
+ if( itr==d_quants_red_lem.end() ){
+ if( d_alpha_equiv ){
+ Trace("quant-engine-red") << "Alpha equivalence " << q << "?" << std::endl;
+ //add equivalence with another quantified formula
+ lem = d_alpha_equiv->reduceQuantifier( q );
+ if( !lem.isNull() ){
+ Trace("quant-engine-red") << "...alpha equivalence success." << std::endl;
+ ++(d_statistics.d_red_alpha_equiv);
+ }
}
+ d_quants_red_lem[q] = lem;
+ }else{
+ lem = itr->second;
}
- d_quants_red[q] = false;
- return false;
+ if( !lem.isNull() ){
+ getOutputChannel().lemma( lem );
+ }
+ d_quants_red[q] = !lem.isNull();
+ return !lem.isNull();
}else{
return (*it).second;
}
}
-bool QuantifiersEngine::recordInstantiationInternal( Node q, std::vector< Node >& terms, bool modEq, bool modInst, bool addedLem ) {
+bool QuantifiersEngine::recordInstantiationInternal( Node q, std::vector< Node >& terms, bool modEq, bool addedLem ) {
if( !addedLem ){
//record the instantiation for deletion later
- //TODO
+ d_recorded_inst.push_back( std::pair< Node, std::vector< Node > >( q, terms ) );
}
if( options::incrementalSolving() ){
- Trace("inst-add-debug") << "Adding into context-dependent inst trie, modEq = " << modEq << ", modInst = " << modInst << std::endl;
+ Trace("inst-add-debug") << "Adding into context-dependent inst trie, modEq = " << modEq << std::endl;
inst::CDInstMatchTrie* imt;
std::map< Node, inst::CDInstMatchTrie* >::iterator it = d_c_inst_match_trie.find( q );
if( it!=d_c_inst_match_trie.end() ){
imt = new CDInstMatchTrie( getUserContext() );
d_c_inst_match_trie[q] = imt;
}
- return imt->addInstMatch( this, q, terms, getUserContext(), modEq, modInst );
+ return imt->addInstMatch( this, q, terms, getUserContext(), modEq );
}else{
Trace("inst-add-debug") << "Adding into inst trie" << std::endl;
- return d_inst_match_trie[q].addInstMatch( this, q, terms, modEq, modInst );
+ return d_inst_match_trie[q].addInstMatch( this, q, terms, modEq );
}
}
}
/*
-bool QuantifiersEngine::existsInstantiation( Node f, InstMatch& m, bool modEq, bool modInst ){
+bool QuantifiersEngine::existsInstantiation( Node f, InstMatch& m, bool modEq ){
if( options::incrementalSolving() ){
if( d_c_inst_match_trie.find( f )!=d_c_inst_match_trie.end() ){
- if( d_c_inst_match_trie[f]->existsInstMatch( this, f, m, getUserContext(), modEq, modInst ) ){
+ if( d_c_inst_match_trie[f]->existsInstMatch( this, f, m, getUserContext(), modEq ) ){
return true;
}
}
}else{
if( d_inst_match_trie.find( f )!=d_inst_match_trie.end() ){
- if( d_inst_match_trie[f].existsInstMatch( this, f, m, modEq, modInst ) ){
+ if( d_inst_match_trie[f].existsInstMatch( this, f, m, modEq ) ){
return true;
}
}
}
- //also check model builder (it may contain instantiations internally)
- if( d_builder && d_builder->existsInstantiation( f, m, modEq, modInst ) ){
- return true;
- }
return false;
}
*/
d_phase_req_waiting[lit] = req;
}
-bool QuantifiersEngine::addInstantiation( Node q, InstMatch& m, bool mkRep, bool modEq, bool modInst, bool doVts ){
+bool QuantifiersEngine::addInstantiation( Node q, InstMatch& m, bool mkRep, bool modEq, bool doVts ){
std::vector< Node > terms;
m.getTerms( q, terms );
- return addInstantiation( q, terms, mkRep, modEq, modInst, doVts );
+ return addInstantiation( q, terms, mkRep, modEq, doVts );
}
-bool QuantifiersEngine::addInstantiation( Node q, std::vector< Node >& terms, bool mkRep, bool modEq, bool modInst, bool doVts ) {
+bool QuantifiersEngine::addInstantiation( Node q, std::vector< Node >& terms, bool mkRep, bool modEq, bool doVts ) {
// For resource-limiting (also does a time check).
getOutputChannel().safePoint(options::quantifierStep());
Assert( !d_conflict );
}
//check for term vector duplication
- bool alreadyExists = !recordInstantiationInternal( q, terms, modEq, modInst );
+ bool alreadyExists = !recordInstantiationInternal( q, terms, modEq );
if( alreadyExists ){
Trace("inst-add-debug") << " --> Already exists." << std::endl;
++(d_statistics.d_inst_duplicate_eq);
/** list of all quantifiers seen */
std::map< Node, bool > d_quants;
/** quantifiers reduced */
- std::map< Node, bool > d_quants_red;
+ BoolMap d_quants_red;
+ std::map< Node, Node > d_quants_red_lem;
/** list of all lemmas produced */
//std::map< Node, bool > d_lemmas_produced;
BoolMap d_lemmas_produced_c;
/** list of all instantiations produced for each quantifier */
std::map< Node, inst::InstMatchTrie > d_inst_match_trie;
std::map< Node, inst::CDInstMatchTrie* > d_c_inst_match_trie;
+ /** recorded instantiations */
+ std::vector< std::pair< Node, std::vector< Node > > > d_recorded_inst;
/** quantifiers that have been skolemized */
BoolMap d_skolemized;
/** term database */
/** compute term vector */
void computeTermVector( Node f, InstMatch& m, std::vector< Node >& vars, std::vector< Node >& terms );
/** record instantiation, return true if it was non-duplicate */
- bool recordInstantiationInternal( Node q, std::vector< Node >& terms, bool modEq = false, bool modInst = false, bool addedLem = true );
+ bool recordInstantiationInternal( Node q, std::vector< Node >& terms, bool modEq = false, bool addedLem = true );
/** remove instantiation */
bool removeInstantiationInternal( Node q, std::vector< Node >& terms );
/** set instantiation level attr */
/** add require phase */
void addRequirePhase( Node lit, bool req );
/** do instantiation specified by m */
- bool addInstantiation( Node q, InstMatch& m, bool mkRep = true, bool modEq = false, bool modInst = false, bool doVts = false );
+ bool addInstantiation( Node q, InstMatch& m, bool mkRep = false, bool modEq = false, bool doVts = false );
/** add instantiation */
- bool addInstantiation( Node q, std::vector< Node >& terms, bool mkRep = true, bool modEq = false, bool modInst = false, bool doVts = false );
+ bool addInstantiation( Node q, std::vector< Node >& terms, bool mkRep = false, bool modEq = false, bool doVts = false );
/** remove pending instantiation */
bool removeInstantiation( Node q, Node lem, std::vector< Node >& terms );
/** split on node n */