Fix bug in --fmf-fmc for producing models of functions not appearing in quantified...
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 5 Jun 2013 16:23:56 +0000 (11:23 -0500)
committerAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 5 Jun 2013 16:24:05 +0000 (11:24 -0500)
src/theory/model.cpp
src/theory/quantifiers/first_order_model.cpp
src/theory/quantifiers/full_model_check.cpp

index 544ee6c857d4754bbbe81ac023a6097aad6a69e0..08be411718b4f88ee88203ab57c27760c690c4bb 100644 (file)
@@ -431,6 +431,7 @@ void TheoryEngineModelBuilder::checkTerms(TNode n, TheoryModel* tm, NodeSet& cac
 
 void TheoryEngineModelBuilder::buildModel(Model* m, bool fullModel)
 {
+  Trace("model-builder") << "TheoryEngineModelBuilder: buildModel, fullModel = " << fullModel << std::endl;
   TheoryModel* tm = (TheoryModel*)m;
 
   // buildModel with fullModel = true should only be called once in any context
@@ -719,6 +720,7 @@ void TheoryEngineModelBuilder::buildModel(Model* m, bool fullModel)
   }
 
   if (!fullModel) {
+    Trace("model-builder") << "Make sure ECs have reps..." << std::endl;
     // Make sure every EC has a rep
     for (itMap = assertedReps.begin(); itMap != assertedReps.end(); ++itMap ) {
       tm->d_reps[itMap->first] = itMap->second;
index 4b101de491ecf9464a2ed5923b5ad9e3291a44c1..b775ea1b0e66b72e62d2eb3590f45a158aa3230a 100644 (file)
@@ -602,12 +602,14 @@ Node FirstOrderModelFmc::getModelBasisTerm(TypeNode tn) {
 }
 
 Node FirstOrderModelFmc::getFunctionValue(Node op, const char* argPrefix ) {
+  Trace("fmc-model") << "Get function value for " << op << std::endl;
   TypeNode type = op.getType();
   std::vector< Node > vars;
   for( size_t i=0; i<type.getNumChildren()-1; i++ ){
     std::stringstream ss;
     ss << argPrefix << (i+1);
-    vars.push_back( NodeManager::currentNM()->mkBoundVar( ss.str(), type[i] ) );
+    Node b = NodeManager::currentNM()->mkBoundVar( ss.str(), type[i] );
+    vars.push_back( b );
   }
   Node boundVarList = NodeManager::currentNM()->mkNode(kind::BOUND_VAR_LIST, vars);
   Node curr;
index b1611574921a28677528bf6b328a90f5efd06660..2033797d55bbd90f34bbf4aad1f6c414e73c9c0e 100755 (executable)
@@ -201,7 +201,7 @@ void FullModelChecker::processBuildModel(TheoryModel* m, bool fullModel){
   FirstOrderModelFmc * fm = ((FirstOrderModelFmc*)m)->asFirstOrderModelFmc();\r
   if( fullModel ){\r
     //make function values\r
-    for( std::map< Node, std::vector< Node > >::iterator it = m->d_uf_terms.begin(); it != m->d_uf_terms.end(); ++it ){\r
+    for( std::map<Node, Def * >::iterator it = fm->d_models.begin(); it != fm->d_models.end(); ++it ){\r
       m->d_uf_models[ it->first ] = getFunctionValue( fm, it->first, "$x" );\r
     }\r
     TheoryEngineModelBuilder::processBuildModel( m, fullModel );\r