本文整理汇总了C++中Trigger::addInstantiations方法的典型用法代码示例。如果您正苦于以下问题:C++ Trigger::addInstantiations方法的具体用法?C++ Trigger::addInstantiations怎么用?C++ Trigger::addInstantiations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trigger
的用法示例。
在下文中一共展示了Trigger::addInstantiations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
int InstStrategyAutoGenTriggers::process( Node f, Theory::Effort effort, int e ){
int peffort = f.getNumChildren()==3 ? 2 : 1;
//int peffort = f.getNumChildren()==3 ? 2 : 1;
//int peffort = 1;
if( e<peffort ){
return STATUS_UNFINISHED;
}else{
bool gen = false;
if( e==peffort ){
if( d_counter.find( f )==d_counter.end() ){
d_counter[f] = 0;
gen = true;
}else{
d_counter[f]++;
gen = d_regenerate && d_counter[f]%d_regenerate_frequency==0;
}
}else{
gen = true;
}
if( gen ){
generateTriggers( f );
}
Debug("quant-uf-strategy") << "Try auto-generated triggers... " << d_tr_strategy << " " << e << std::endl;
//Notice() << "Try auto-generated triggers..." << std::endl;
for( std::map< Trigger*, bool >::iterator itt = d_auto_gen_trigger[f].begin(); itt != d_auto_gen_trigger[f].end(); ++itt ){
Trigger* tr = itt->first;
if( tr ){
bool processTrigger = itt->second;
if( effort!=Theory::EFFORT_LAST_CALL && tr->isMultiTrigger() ){
#ifdef MULTI_TRIGGER_FULL_EFFORT_HALF
processTrigger = d_counter[f]%2==0;
#endif
}
if( processTrigger ){
//if( tr->isMultiTrigger() )
Debug("quant-uf-strategy-auto-gen-triggers") << " Process " << (*tr) << "..." << std::endl;
InstMatch baseMatch;
int numInst = tr->addInstantiations( baseMatch );
//if( tr->isMultiTrigger() )
Debug("quant-uf-strategy-auto-gen-triggers") << " Done, numInst = " << numInst << "." << std::endl;
if( d_tr_strategy==Trigger::TS_MIN_TRIGGER ){
d_quantEngine->getInstantiationEngine()->d_statistics.d_instantiations_auto_gen_min += numInst;
}else{
d_quantEngine->getInstantiationEngine()->d_statistics.d_instantiations_auto_gen += numInst;
}
if( tr->isMultiTrigger() ){
d_quantEngine->d_statistics.d_multi_trigger_instantiations += numInst;
}
//d_quantEngine->d_hasInstantiated[f] = true;
}
}
}
Debug("quant-uf-strategy") << "done." << std::endl;
//Notice() << "done" << std::endl;
}
return STATUS_UNKNOWN;
}
示例2: process
int InstStrategyAutoGenTriggers::process( Node f, Theory::Effort effort, int e ){
if( f.getNumChildren()==3 && options::userPatternsQuant()==USER_PAT_MODE_TRUST ){
return STATUS_UNKNOWN;
}else{
int peffort = ( f.getNumChildren()==3 && options::userPatternsQuant()!=USER_PAT_MODE_IGNORE ) ? 2 : 1;
//int peffort = 1;
if( e<peffort ){
return STATUS_UNFINISHED;
}else{
int status = STATUS_UNKNOWN;
bool gen = false;
if( e==peffort ){
if( d_counter.find( f )==d_counter.end() ){
d_counter[f] = 0;
gen = true;
}else{
d_counter[f]++;
gen = d_regenerate && d_counter[f]%d_regenerate_frequency==0;
}
}else{
gen = true;
}
if( gen ){
generateTriggers( f, effort, e, status );
if( d_auto_gen_trigger[f].empty() && f.getNumChildren()==2 ){
Trace("no-trigger") << "Could not find trigger for " << f << std::endl;
}
}
Trace("inst-alg") << "-> Auto-gen instantiate " << f << "..." << std::endl;
//if( e==4 ){
// d_processed_trigger.clear();
// d_quantEngine->getEqualityQuery()->setLiberal( true );
//}
Debug("quant-uf-strategy") << "Try auto-generated triggers... " << d_tr_strategy << " " << e << std::endl;
//Notice() << "Try auto-generated triggers..." << std::endl;
for( std::map< Trigger*, bool >::iterator itt = d_auto_gen_trigger[f].begin(); itt != d_auto_gen_trigger[f].end(); ++itt ){
Trigger* tr = itt->first;
if( tr ){
bool processTrigger = itt->second;
if( processTrigger && d_processed_trigger[f].find( tr )==d_processed_trigger[f].end() ){
d_processed_trigger[f][tr] = true;
//if( tr->isMultiTrigger() )
Trace("process-trigger") << " Process ";
tr->debugPrint("process-trigger");
Trace("process-trigger") << "..." << std::endl;
InstMatch baseMatch( f );
int numInst = tr->addInstantiations( baseMatch );
//if( tr->isMultiTrigger() )
Trace("process-trigger") << " Done, numInst = " << numInst << "." << std::endl;
if( d_tr_strategy==Trigger::TS_MIN_TRIGGER ){
d_quantEngine->getInstantiationEngine()->d_statistics.d_instantiations_auto_gen_min += numInst;
}else{
d_quantEngine->getInstantiationEngine()->d_statistics.d_instantiations_auto_gen += numInst;
}
if( tr->isMultiTrigger() ){
d_quantEngine->d_statistics.d_multi_trigger_instantiations += numInst;
}
//d_quantEngine->d_hasInstantiated[f] = true;
}
}
}
//if( e==4 ){
// d_quantEngine->getEqualityQuery()->setLiberal( false );
//}
Debug("quant-uf-strategy") << "done." << std::endl;
//Notice() << "done" << std::endl;
return status;
}
}
}