#include "theory/theory_model.h"
#include "theory/arrays/theory_arrays_rewriter.h"
+#include "theory/quantifiers/term_database.h"
using namespace std;
case kind::INST_PATTERN:
break;
case kind::INST_PATTERN_LIST:
- // TODO user patterns
for(unsigned i=0; i<n.getNumChildren(); i++) {
- out << ":pattern " << n[i];
+ if( n[i].getKind()==kind::INST_ATTRIBUTE ){
+ if( n[i][0].getAttribute(theory::FunDefAttribute()) ){
+ out << ":fun-def";
+ }
+ }else{
+ out << ":pattern " << n[i];
+ }
}
return;
break;
bool CegInstantiation::needsModel( Theory::Effort e ) {
return true;
}
-bool CegInstantiation::needsFullModel( Theory::Effort e ) {
- return true;
-}
void CegInstantiation::check( Theory::Effort e, unsigned quant_e ) {
if( quant_e==QuantifiersEngine::QEFFORT_MODEL ){
public:
bool needsCheck( Theory::Effort e );
bool needsModel( Theory::Effort e );
- bool needsFullModel( Theory::Effort e );
/* Call during quantifier engine's check */
void check( Theory::Effort e, unsigned quant_e );
/* Called for new quantifiers */
d_false = NodeManager::currentNM()->mkConst(false);
}
-bool FullModelChecker::optBuildAtFullModel() {
- //need to build after full model has taken effect if we are constructing interval models
- // this is because we need to have a constant in all integer equivalence classes
- return options::mbqiMode()==quantifiers::MBQI_FMC_INTERVAL;
-}
-
void FullModelChecker::processBuildModel(TheoryModel* m, bool fullModel){
FirstOrderModelFmc * fm = ((FirstOrderModelFmc*)m)->asFirstOrderModelFmc();
- if( fullModel==optBuildAtFullModel() ){
+ if( !fullModel ){
Trace("fmc") << "---Full Model Check reset() " << std::endl;
fm->initialize();
d_quant_models.clear();
}
*/
}
- }
- if( fullModel ){
+ }else{
//make function values
for( std::map<Node, Def * >::iterator it = fm->d_models.begin(); it != fm->d_models.end(); ++it ){
m->d_uf_models[ it->first ] = getFunctionValue( fm, it->first, "$x" );
FullModelChecker( context::Context* c, QuantifiersEngine* qe );
~FullModelChecker() throw() {}
- bool optBuildAtFullModel();
-
-
void debugPrintCond(const char * tr, Node n, bool dispStar = false);
void debugPrint(const char * tr, Node n, bool dispStar = false);
}
Node bd = TermDb::getFunDefBody( assertions[i] );
+ Trace("fmf-fun-def-debug") << "Process function " << n << ", body = " << bd << std::endl;
Assert( !bd.isNull() );
bd = NodeManager::currentNM()->mkNode( n.getType().isBoolean() ? IFF : EQUAL, n, bd );
virtual bool doExhaustiveInstantiation( FirstOrderModel * fm, Node f, int effort ) { return false; }
//whether to construct model
virtual bool optUseModel();
- //whether to construct model at fullModel = true
- virtual bool optBuildAtFullModel() { return false; }
/** number of lemmas generated while building model */
//is the exhaustive instantiation incomplete?
bool d_incomplete_check;
}
bool needsCheck = !d_lemmas_waiting.empty();
bool needsModel = false;
- bool needsFullModel = false;
std::vector< QuantifiersModule* > qm;
if( d_model->checkNeeded() ){
needsCheck = needsCheck || e>=Theory::EFFORT_LAST_CALL; //always need to check at or above last call
needsCheck = true;
if( d_modules[i]->needsModel( e ) ){
needsModel = true;
- if( d_modules[i]->needsFullModel( e ) ){
- needsFullModel = true;
- }
}
}
}
//build the model if any module requested it
if( quant_e==QEFFORT_MODEL && needsModel ){
Assert( d_builder!=NULL );
- Trace("quant-engine-debug") << "Build model, fullModel = " << ( needsFullModel || d_builder->optBuildAtFullModel() ) << "..." << std::endl;
+ Trace("quant-engine-debug") << "Build model..." << std::endl;
d_builder->d_addedLemmas = 0;
- d_builder->buildModel( d_model, needsFullModel || d_builder->optBuildAtFullModel() );
+ d_builder->buildModel( d_model, false );
//we are done if model building was unsuccessful
if( d_builder->d_addedLemmas>0 ){
success = false;
if( d_hasAddedLemma ){
break;
//otherwise, complete the model generation if necessary
- }else if( quant_e==QEFFORT_MODEL && needsModel && options::produceModels() && !needsFullModel && !d_builder->optBuildAtFullModel() ){
+ }else if( quant_e==QEFFORT_MODEL && needsModel && options::produceModels() ){
Trace("quant-engine-debug") << "Build completed model..." << std::endl;
d_builder->buildModel( d_model, true );
}