VIS

src/puresat/puresatIPAbRf.c

Go to the documentation of this file.
00001 
00048 #include "maigInt.h"
00049 #include "puresatInt.h"
00050 
00051 /*---------------------------------------------------------------------------*/
00052 /* Constant declarations                                                     */
00053 /*---------------------------------------------------------------------------*/
00054 
00055 /*---------------------------------------------------------------------------*/
00056 /* Type declarations                                                         */
00057 /*---------------------------------------------------------------------------*/
00058 
00059 
00060 /*---------------------------------------------------------------------------*/
00061 /* Structure declarations                                                    */
00062 /*---------------------------------------------------------------------------*/
00063 
00064 
00065 /*---------------------------------------------------------------------------*/
00066 /* Variable declarations                                                     */
00067 /*---------------------------------------------------------------------------*/
00068 
00069 /*---------------------------------------------------------------------------*/
00070 /* Macro declarations                                                        */
00071 /*---------------------------------------------------------------------------*/
00072 
00075 /*---------------------------------------------------------------------------*/
00076 /* Static function prototypes                                                */
00077 /*---------------------------------------------------------------------------*/
00078 
00079 
00082 /*---------------------------------------------------------------------------*/
00083 /* Definition of exported functions                                          */
00084 /*---------------------------------------------------------------------------*/
00085 
00086 
00087 /*---------------------------------------------------------------------------*/
00088 /* Definition of internal functions                                          */
00089 /*---------------------------------------------------------------------------*/
00090 
00103 boolean PureSatIPOnCon(Ntk_Network_t * network,
00104                        Ctlsp_Formula_t *ltlFormula,
00105                        PureSat_Manager_t *pm)
00106 {
00107   int k;
00108   bAig_Manager_t    *manager;
00109   bAigEdge_t        property;
00110   double t1,t2;
00111   array_t           *previousResultArray=0;
00112   boolean firstTime;
00113   int round;
00114   st_table * tmpTable;
00115   int oldPos1,nodes_in_coi=0;
00116   satManager_t * cm;
00117   bAigEdge_t state, tmpState;
00118   double tCon=0;
00119   RTManager_t *rm;
00120 
00121   manager = Ntk_NetworkReadMAigManager(network);
00122 
00123   if(pm->verbosity>=1)
00124     fprintf(vis_stdout,"go to concrete model\n");
00125 
00126  k = pm->Length;
00127  round = 1;
00128  PureSat_CleanMask(manager,ResetGlobalVarMask);
00129  PureSat_MarkGlobalVar(manager,1);
00130  while(1){
00131    k += round-1;
00132    pm->Length = k;
00133 
00134    if(pm->verbosity>=1)
00135      fprintf(vis_stdout,"\nk = %d InitState = %ld\n",k,manager->InitState);
00136    manager->test2LevelMini = 1;
00137    t1 = util_cpu_ctime();
00138    bAig_PureSat_ExpandTimeFrame(network, manager,pm, k, BMC_NO_INITIAL_STATES);
00139    t2 = util_cpu_ctime();
00140    pm->tExp += t2-t1;
00141    if(pm->verbosity>=2)
00142      fprintf(vis_stdout,"Expansion time:%g,total:%g\n",
00143             (double)((t2-t1)/1000.0),pm->tExp/1000);
00144    manager->test2LevelMini = 0;
00145    if(pm->verbosity>=1){
00146      fprintf(vis_stdout,"After expand TF\n");
00147      PureSat_PrintAigStatus(manager);
00148    }
00149    manager->class_ = k+1;
00150    property = BmcCirCUsCreatebAigOfPropFormula(network,
00151                      manager, k, ltlFormula, BMC_NO_INITIAL_STATES);
00152    property = bAig_Not(property);
00153    if(property==0){
00154      return TRUE;
00155    }
00156    if(property==1){
00157      return FALSE;
00158    }
00159    oldPos1 = manager->nodesArraySize-bAigNodeSize;
00160    if(pm->verbosity>=1){
00161      fprintf(vis_stdout,"After expanding TF and building property\n");
00162      PureSat_PrintAigStatus(manager);
00163    }
00164    firstTime = TRUE;
00165    round = 0;
00166    state = manager->InitState;
00167 
00168    while(1){
00169      round++;
00170      if(pm->verbosity>=1)
00171        fprintf(vis_stdout,"round:%d for k = %d\n",round,k);
00172      manager->assertArray = sat_ArrayAlloc(1);
00173      if(state!=bAig_One)
00174        sat_ArrayInsert(manager->assertArray,state);
00175      cm = PureSat_SatManagerAlloc(manager,pm,property,previousResultArray);
00176      cm->option->IP = 1;
00177 
00178 
00179      if(cm->status==0){
00180        if(pm->verbosity>=1)
00181          fprintf(vis_stdout,"normal COI:\n");
00182        if(pm->verbosity>=1) {
00183          nodes_in_coi = PureSat_CountNodesInCoi(cm);
00184          fprintf(vis_stdout,"There are %d node in COI\n",nodes_in_coi);
00185        }
00186        t1 = util_cpu_ctime();
00187        sat_Main(cm);
00188 
00189        rm = cm->rm;
00190        cm->option->IP = 0;
00191        if(manager->NodesArray!=cm->nodesArray)
00192          /*cm->nodesArray may be reallocated */
00193          manager->NodesArray = cm->nodesArray;
00194        t2 = util_cpu_ctime();
00195        pm->tIPUnsat += t2 - t1;
00196        if(pm->verbosity>=2)
00197          fprintf(vis_stdout,"time for Unsat:%g, total:%g\n",
00198                 (double)((t2-t1)/1000.0),pm->tIPUnsat/1000);
00199      }
00200 
00201      if(cm->status == SAT_SAT){
00202        /*SAT: first time->find bug, otherwise increase length*/
00203        if(firstTime){
00204          fprintf(vis_stdout,"found CEX of length %d\n",k);
00205 
00206          sat_ArrayFree(manager->assertArray);
00207          manager->assertArray = 0;
00208          RT_Free(cm->rm);
00209          PureSat_SatFreeManager(cm);
00210          return FALSE;
00211        }
00212        else{
00213 
00214          if(pm->verbosity>=1)
00215            fprintf(vis_stdout,"find bogus bug at length k=%d,round=%d,increase length\n",k,round);
00216 
00217          sat_ArrayFree(manager->assertArray);
00218          RT_Free(cm->rm);
00219          PureSat_SatFreeManager(cm);
00220          break;
00221        }
00222      }
00223      else{
00224        /*UNSAT: get IP, add to init states, until reach convergence, which
00225        means property is true
00226        Bing: IP generation*/
00227        assert(cm->currentDecision>=-1);
00228        if(cm->currentDecision!=-1)
00229          sat_Backtrack(cm, -1);
00230        /*get rid of Conflict Clauses*/
00231        PureSat_ResetManager(manager,cm,1);
00232 
00233        if(cm->option->coreGeneration&&cm->status == SAT_UNSAT){
00234          manager->class_ = 1;
00235          t1 = util_cpu_ctime();
00236          tmpState = sat_GenerateFwdIP(manager,cm,cm->rm->root,1);
00237          manager->IPState = PureSat_MapIP(manager,tmpState,1,0);
00238 
00239          /*Wheneven there is baigNode generated, Reset_Manager is necessary,
00240            //since NodeArray may be reallocated, # of Nodes changed*/
00241          PureSat_ResetManager(manager,cm,0);
00242          t2 = util_cpu_ctime();
00243          pm->tIPGen += t2 -t1;
00244          if(pm->verbosity>=2)
00245            fprintf(vis_stdout,"time for generating and mapping IP:%g, total:%g\n",
00246                   (double)((t2-t1)/1000.0),pm->tIPGen/1000);
00247          if(pm->verbosity>=1){
00248            fprintf(vis_stdout,"After generate IP,IP2:%ld,%ld:\n",manager->IPState,tmpState);
00249            PureSat_PrintAigStatus(manager);
00250          }
00251          manager->class_ = 2;
00252 
00253          t1 = util_cpu_ctime();
00254 
00255          RT_Free(cm->rm);
00256          if(pm->verbosity>=1)
00257            PureSat_PrintAigStatus(manager);
00258        }
00259 
00260        t1 = util_cpu_ctime();
00261        if(PureSat_TestConvergeForIP(manager,pm,cm,state,manager->IPState)){
00262          t2 = util_cpu_ctime();
00263          tCon = tCon+t2-t1;
00264          if(pm->verbosity>=2)
00265            fprintf(vis_stdout,"time for generating Convergence:%g, Total:%g\n",
00266                   (double)((t2-t1)/1000.0),tCon/1000);
00267          if(pm->verbosity>=1){
00268            fprintf(vis_stdout,"After test convergence:\n");
00269            PureSat_PrintAigStatus(manager);
00270          }
00271          fprintf(vis_stdout,"property is true\n");
00272          PureSat_SatFreeManager(cm);
00273          sat_ArrayFree(manager->assertArray);
00274          return TRUE;
00275        }
00276        else{
00277          t2 = util_cpu_ctime();
00278          pm->tIPCon += t2-t1;
00279          if(pm->verbosity>=2)
00280            fprintf(vis_stdout,"time for generating Convergence:%g, total:%g\n",
00281                   (double)((t2-t1)/1000.0),pm->tIPCon/1000);
00282          if(pm->verbosity>=1){
00283            fprintf(vis_stdout,"After test convergence:\n");
00284            PureSat_PrintAigStatus(manager);
00285          }
00286 
00287          manager->class_ = 0;
00288          state = PureSat_Or(manager,state,manager->IPState);
00289          PureSat_ResetManager(manager,cm,0);
00290          if(pm->verbosity>=1)
00291            fprintf(vis_stdout,"new InitState:%ld\n",state);
00292 
00293        }
00294      }/*else*/
00295      sat_ArrayFree(manager->assertArray);
00296      manager->assertArray = 0;
00297      PureSat_SatFreeManager(cm);
00298      firstTime = FALSE;
00299    }/*inner While(1){*/
00300    /*sat_ArrayInsert(previousResultArray, bAig_Not(property)); */
00301  }/*outer While(1){*/
00302  st_free_table(tmpTable);
00303 
00304  sat_ArrayFree(manager->EqArray);
00305  return TRUE;
00306 }
00307 
00308 
00321 boolean PureSat_CheckAceByIP(Ntk_Network_t *network,
00322                              PureSat_Manager_t * pm,
00323                              PureSat_IncreSATManager_t *pism,
00324                              array_t *vertexArray,
00325                              int * k,
00326                              Ctlsp_Formula_t *ltlFormula,
00327                              bAigEdge_t * returnProp,
00328                              array_t *previousResultArray)
00329 {
00330   int oldPos;
00331   boolean firstTime,fork=0,ExistACE;
00332   int round,oldLength,coiCon,coiAbs;
00333   bAigEdge_t property;
00334   double t1,t2,t3,t4,t5, threshold_sw=0;
00335   satManager_t * cm;
00336   array_t *bVarList,*mVarList;
00337   bAigEdge_t state, tmpState;
00338   BmcOption_t  *options = BmcOptionAlloc();
00339   bAig_Manager_t * manager = Ntk_NetworkReadMAigManager(network);
00340 
00341   bVarList = mAigReadBinVarList(manager);
00342   mVarList = mAigReadMulVarList(manager);
00343   options->printInputs = TRUE;
00344   options->verbosityLevel = BmcVerbosityMax_c;
00345 
00346   assert(*k>=1);
00347   manager->test2LevelMini = 1;
00348   bAig_PureSat_ExpandTimeFrame(network, manager, pm,*k,
00349                                BMC_NO_INITIAL_STATES);
00350   manager->test2LevelMini = 0;
00351   PureSat_CleanMask(manager,ResetVisibleVarMask);
00352   PuresatMarkVisibleVar(network,vertexArray,pm,0,*k+1);
00353   PureSat_CleanMask(manager,ResetGlobalVarMask);
00354 
00355   PureSat_MarkGlobalVar_AbRf(manager,1);
00356   oldLength = *k;
00357 
00358   while(1){
00359     if(fork){
00360       oldLength = pm->Length;
00361       (*k) += round-1;
00362       pm->Length = *k;
00363     }
00364     fork=1;
00365     if(pm->verbosity>=1)
00366       fprintf(vis_stdout,"\nk = %d InitState = %ld\n",*k,manager->InitState);
00367     manager->test2LevelMini = 1;
00368     t1 = util_cpu_ctime();
00369     bAig_PureSat_ExpandTimeFrame(network, manager, pm,*k,
00370                                  BMC_NO_INITIAL_STATES);
00371     t2 = util_cpu_ctime();
00372     pm->tExp += t2-t1;
00373     if(pm->verbosity>=2)
00374       fprintf(vis_stdout,"Expansion time:%g,total:%g\n",
00375              (double)((t2-t1)/1000.0),pm->tExp/1000);
00376     manager->test2LevelMini = 0;
00377     PureSat_CleanMask(manager,ResetVisibleVarMask);
00378     PuresatMarkVisibleVar(network,vertexArray,pm,0,*k+1);
00379     manager->class_ = *k+1;
00380     property = PureSatCreatebAigOfPropFormula(network,
00381                 manager, *k, ltlFormula, BMC_NO_INITIAL_STATES);
00382     property = bAig_Not(property);
00383     *returnProp = property;
00384     if(pm->verbosity>=1)
00385       fprintf(vis_stdout,"property is %ld\n",property);
00386     oldPos = manager->nodesArraySize-bAigNodeSize;
00387     if(pm->verbosity>=1){
00388       fprintf(vis_stdout,"After expanding TF and building property\n");
00389       PureSat_PrintAigStatus(manager);
00390     }
00391     firstTime = TRUE;
00392     round = 0;
00393     state = manager->InitState;
00394     /*for one length*/
00395     while(1){
00396       round++;
00397       if(pm->verbosity>=1)
00398         fprintf(vis_stdout,"round:%d for k = %d\n",round,*k);
00399       manager->assertArray = sat_ArrayAlloc(1);
00400       if(state!=bAig_One)
00401         sat_ArrayInsert(manager->assertArray,state);
00402       cm = PureSat_SatManagerAlloc_WOCOI(manager,pm,property,previousResultArray);
00403       cm->option->IP = 1;
00404       cm->option->AbRf = 1;
00405 
00406 
00407       if(round == 1){
00408         PureSat_ResetCoi(cm);
00409         sat_SetConeOfInfluence(cm);
00410         if(pm->verbosity>=1)
00411           fprintf(vis_stdout,"COI nodes if check concrete model:\n");
00412         coiCon = PureSat_CountNodesInCoi(cm);
00413         if(pm->verbosity>=1)
00414           fprintf(vis_stdout,"There are %d node in COI\n",coiCon);
00415       }
00416 
00417       t1 = util_cpu_ctime();
00418 
00419       PureSatSetCOI(network,pm,cm,pm->vertexTable,0, *k,*k);
00420       t2 = util_cpu_ctime();
00421       pm->tPro += t2-t1;
00422       if(pm->verbosity>=2)
00423         fprintf(vis_stdout,"process time:%g,total:%g\n",
00424                (double)((t2-t1)/1000.0),pm->tPro/1000);
00425       /*switch to concrete model*/
00426       if(pm->verbosity>=1)
00427         fprintf(vis_stdout,"normal COI:\n");
00428       coiAbs = PureSat_CountNodesInCoi(cm);
00429       if(round == 1){
00430         if(pm->verbosity>=1)
00431           fprintf(vis_stdout,"Coi of abs divided by Coi of con: %g\n",
00432                  (double)coiAbs/(double)coiCon);
00433 #if SWITCH_DA
00434         if((double)coiAbs/(double)coiCon >= 0.68&&*k>=5){
00435           if(pm->switch_da == 0){
00436             if(pm->verbosity>=1)
00437               fprintf(vis_stdout,"Switch to DirAdd mode\n");
00438             pm->switch_da = 1;
00439           }
00440         }
00441 #endif
00442 
00443         if(pm->Switch)
00444           threshold_sw = 0.68;
00445         else
00446           threshold_sw = 1.1;
00447 
00448         if(((double)coiAbs/(double)coiCon) >= threshold_sw&&*k>=5){
00449 
00450           t3 = util_cpu_ctime();
00451           sat_ArrayFree(manager->assertArray);
00452           manager->assertArray = 0;
00453           if(pm->verbosity>=1)
00454             fprintf(vis_stdout,"Abs model is large, go to Concrete model\n");
00455           ExistACE = PureSatIPOnCon(network,ltlFormula,pm);
00456           PureSat_SatFreeManager(cm);
00457           t1 = util_cpu_ctime();
00458           if(pm->verbosity>=1)
00459             fprintf(vis_stdout,"Run on concrete model: %g\n",(double)((t1-t3)/1000.0));
00460           if(ExistACE){
00461             pm->returnVal = 1;
00462             return FALSE;
00463           }
00464           else{
00465             pm->returnVal = -1;
00466             return TRUE;
00467           }
00468         }
00469       }
00470 
00471       PureSatKillPseudoGV(network,pm,pm->vertexTable,1,*k);
00472       PureSat_ResetManager(manager,cm,0);
00473       PureSatProcessFanout(cm);
00474 
00475       t1 = util_cpu_ctime();
00476       sat_Main(cm);
00477       if(pm->verbosity>=2)
00478         sat_ReportStatistics(cm,cm->each);
00479       cm->option->IP = 0;
00480       if(manager->NodesArray!=cm->nodesArray)
00481         /*cm->nodesArray may be reallocated*/
00482         manager->NodesArray = cm->nodesArray;
00483       t2 = util_cpu_ctime();
00484       pm->tIPUnsat += t2 - t1;
00485       if(pm->verbosity>=2)
00486         fprintf(vis_stdout,"time for Unsat:%g, total:%g\n",
00487                (double)((t2-t1)/1000.0),pm->tIPUnsat/1000);
00488       t1 = util_cpu_ctime();
00489       PureSatPostprocess(manager,cm,pm);
00490       /*clean masks*/
00491       sat_CleanDatabase(cm);
00492 
00493       if(cm->status==SAT_UNSAT){
00494         PureSatProcessDummy(manager,cm,cm->rm->root);
00495         ResetRTree(cm->rm);
00496       }
00497       t2 = util_cpu_ctime();
00498       pm->tPro += t2-t1;
00499       if(pm->verbosity>=2)
00500         fprintf(vis_stdout,"process time:%g,total:%g\n",
00501                (double)((t2-t1)/1000.0),pm->tPro/1000);
00502 
00503       if(cm->status == SAT_SAT){
00504         /*SAT: first time->find bug, otherwise increase length*/
00505         if(firstTime){
00506           if(pm->verbosity>=1)
00507             fprintf(vis_stdout,"found abstract CEX of length %d\n",*k);
00508 
00509 
00510           PureSat_UnMarkGlobalVar(manager,1);
00511           RT_Free(cm->rm);
00512           PureSat_SatFreeManager(cm);
00513           sat_ArrayFree(manager->assertArray);
00514           return TRUE;
00515        }
00516         else{
00517 
00518           if(pm->verbosity>=1)
00519             fprintf(vis_stdout,"find bogus bug at length k=%d,round=%d,increase length\n",*k,round);
00520           sat_ArrayFree(manager->assertArray);
00521           RT_Free(cm->rm);
00522           PureSat_SatFreeManager(cm);
00523           break;
00524         }
00525       }
00526      else{
00527        /*UNSAT: get IP, add to init states, until reach convergence, which
00528        //means property is true
00529        //Bing: IP generation*/
00530        assert(cm->currentDecision>=-1);
00531        if(cm->currentDecision!=-1)
00532          sat_Backtrack(cm, -1);
00533        PureSat_ResetManager(manager,cm,1);//get rid of Conflict Clauses
00534        if(cm->option->coreGeneration&&cm->status == SAT_UNSAT){
00535          manager->class_ = 1;
00536          t1 = util_cpu_ctime();
00537          tmpState = sat_GenerateFwdIP(manager,cm,cm->rm->root,1);
00538          manager->IPState = PureSat_MapIP(manager,tmpState,1,0);
00539 
00540          /*Wheneven there is baigNode generated, Reset_Manager is necessary,
00541            //since NodeArray may be reallocated, # of Nodes changed*/
00542          PureSat_ResetManager(manager,cm,0);
00543          t2 = util_cpu_ctime();
00544 
00545          pm->tIPGen += t2 -t1;
00546          if(pm->verbosity>=2)
00547            fprintf(vis_stdout,"time for generating and mapping IP:%g, total:%g\n",
00548                   (double)((t2-t1)/1000.0),pm->tIPGen/1000);
00549          if(pm->verbosity>=1){
00550            fprintf(vis_stdout,"After generate IP,%ld:\n",manager->IPState);
00551            PureSat_PrintAigStatus(manager);
00552          }
00553          manager->class_ = 2;
00554          if(pm->verbosity>=1)
00555            fprintf(vis_stdout,"After generate IP2:%ld\n",tmpState);
00556          t4 = util_cpu_ctime();
00557          RT_Free(cm->rm);
00558          t5 = util_cpu_ctime();
00559          pm->tGFree += (t5-t4);
00560          if(pm->verbosity>=2)
00561            fprintf(vis_stdout,"GFree time :%g\n",(t5-t4)/1000);
00562          if(pm->verbosity>=1)
00563            PureSat_PrintAigStatus(manager);
00564          }
00565 
00566        t1 = util_cpu_ctime();
00567        if(PureSat_TestConvergeForIP_AbRf(network,cm,pm,vertexArray,
00568                                          state,manager->IPState)){
00569          t2 = util_cpu_ctime();
00570          pm->tIPCon += t2-t1;
00571          if(pm->verbosity>=2)
00572            fprintf(vis_stdout,"time for generating Convergence:%g, total:%g\n",
00573                   (double)((t2-t1)/1000.0),pm->tIPCon/1000);
00574          if(pm->verbosity>=1){
00575            fprintf(vis_stdout,"After test convergence:\n");
00576            PureSat_PrintAigStatus(manager);
00577          }
00578          fprintf(vis_stdout,"property is true\n");
00579          PureSat_SatFreeManager(cm);
00580          sat_ArrayFree(manager->assertArray);
00581          return FALSE;
00582        }
00583        else{
00584          t2 = util_cpu_ctime();
00585          pm->tIPCon += t2-t1;
00586          if(pm->verbosity>=2)
00587            fprintf(vis_stdout,"time for generating Convergence:%g, total:%g\n",
00588                   (double)((t2-t1)/1000.0),pm->tIPCon/1000);
00589          if(pm->verbosity>=1){
00590            fprintf(vis_stdout,"After test convergence:\n");
00591            PureSat_PrintAigStatus(manager);
00592          }
00593          manager->class_ = 0;
00594          state = PureSat_Or(manager,state,manager->IPState);
00595          if(pm->verbosity>=1)
00596            fprintf(vis_stdout,"new InitState:%ld\n",state);
00597        }
00598      }/*else */
00599      sat_ArrayFree(manager->assertArray);
00600      PureSat_SatFreeManager(cm);
00601      firstTime = FALSE;
00602     }/*inner While(1){*/
00603   }/*outer While(1){*/
00604  return FALSE;
00605 }
00606 
00607 
00608 
00621 boolean PureSatCheckInv_IP(Ntk_Network_t * network,
00622                              Ctlsp_Formula_t *ltlFormula,
00623                              PureSat_Manager_t *pm)
00624 {
00625   lsGen     gen;
00626   st_generator      *stGen;
00627   int NumofCurrentLatch=0,Length=0,tmp=0,NumofLatch=0,i,j,k;
00628   int addtoAbs,latchThreshHold;
00629   int NumInSecondLevel=0;
00630   array_t * visibleArray = array_alloc(char *,0);
00631   array_t * invisibleArray = array_alloc(char *,0);
00632   array_t * refinement= array_alloc(char *,0);
00633   array_t * CoiArray = array_alloc(char *,0);
00634   array_t * arrayRC = array_alloc(char *,0);
00635   array_t *tmpRefinement = array_alloc(char *,0);
00636   array_t *tmpRefinement1 = array_alloc(char *,0),*previousResultArray ;
00637   char * nodeName;
00638   Ntk_Node_t * node, *latch;
00639   boolean ExistACE = FALSE,realRefine=TRUE;
00640   boolean firstTime = TRUE;
00641   bAig_Manager_t    *manager;
00642   BmcOption_t * options;
00643   bAigEdge_t   property;
00644   st_table * nodeToMvfAigTable;
00645   double t1,t2,t5, t0,t3,t4,t4total=0;
00646   PureSat_IncreSATManager_t * pism1;
00647   IP_Manager_t * ipm = IPManagerAlloc();
00648   satManager_t *cm;
00649   int * sccArray=NULL, orderCt, satStat=0;
00650   st_table * tmpTable;
00651 
00652 
00653   manager = Ntk_NetworkReadMAigManager(network);
00654   if (manager == NIL(bAig_Manager_t)) {
00655     (void) fprintf(vis_stdout,
00656     "** bmc error: run build_partition_maigs command first\n");
00657     return 1;
00658   }
00659   nodeToMvfAigTable =(st_table *) Ntk_NetworkReadApplInfo(network,
00660                                                           MVFAIG_NETWORK_APPL_KEY);
00661 
00662   pm->supportTable = st_init_table(st_ptrcmp,st_ptrhash);
00663   pm->CoiTable = st_init_table(st_ptrcmp,st_ptrhash);
00664   pm->oldCoiTable = st_init_table(st_ptrcmp,st_ptrhash);
00665   pm->vertexTable = st_init_table(strcmp, st_strhash);
00666   pism1 = PureSatIncreSATManagerAlloc(pm);
00667   t0 = util_cpu_ctime();
00668 
00669   options = BmcOptionAlloc();
00670   options->verbosityLevel = BmcVerbosityMax_c;
00671   options->printInputs = TRUE;
00672 
00673   t1 = util_cpu_ctime();
00674   previousResultArray    = array_alloc(bAigEdge_t, 0);
00675   manager->class_ = 0;
00676   manager->ipm = ipm;
00677   manager->test2LevelMini = 1;
00678   t3 = util_cpu_ctime();
00679   bAig_PureSat_InitTimeFrame(network,manager,pm,0);
00680   t5 = util_cpu_ctime();
00681   pm->tExp += t5-t3;
00682   if(pm->verbosity>=2)
00683     fprintf(vis_stdout,"Expansion time:%g,total:%g\n",
00684             (double)((t5-t3)/1000.0),pm->tExp/1000);
00685   manager->test2LevelMini = 0;
00686   if(pm->verbosity>=1){
00687     fprintf(vis_stdout,"after Init timeframe:\n");
00688     PureSat_PrintAigStatus(manager);
00689   }
00690   manager->class_ = 1;
00691   property = PureSatCreatebAigOfPropFormula(network,
00692     manager, 0, ltlFormula, BMC_NO_INITIAL_STATES);
00693   property = bAig_Not(property);
00694   if(pm->verbosity>=1)
00695     fprintf(vis_stdout,"property is %ld\n",property);
00696   if(property==0)
00697     return TRUE;
00698   if(property==1)
00699     return FALSE;
00700   manager->assertArray = sat_ArrayAlloc(1);
00701   sat_ArrayInsert(manager->assertArray,manager->InitState);
00702   cm = PureSat_SatManagerAlloc(manager,pm,property,previousResultArray);
00703   sat_MarkTransitiveFaninForArray(cm, cm->assertArray, CoiMask);
00704   cm->option->coreGeneration = 0;
00705   cm->option->IP = 0;
00706   if(pm->verbosity>=1)
00707     fprintf(vis_stdout,"test length 0\n");
00708   sat_Main(cm);
00709   manager->NodesArray = cm->nodesArray;
00710   if(cm->status==SAT_SAT){
00711     fprintf(vis_stdout,"find counter example of length 0\n");
00712     BmcCirCUsPrintCounterExample(network, nodeToMvfAigTable, pm->CoiTable,
00713                                  0, 0,options, BMC_NO_INITIAL_STATES);
00714     return FALSE;
00715   }
00716   cm->option->coreGeneration = 1;
00717   PureSat_SatFreeManager(cm);
00718 
00719   manager->test2LevelMini = 1;
00720   t3 = util_cpu_ctime();
00721   bAig_PureSat_ExpandTimeFrame(network, manager,pm,1, BMC_NO_INITIAL_STATES);
00722   t5 = util_cpu_ctime();
00723   pm->tExp += t5-t3;
00724   if(pm->verbosity>=2)
00725     fprintf(vis_stdout,"Expansion time:%g,total:%g\n",
00726             (double)((t5-t3)/1000.0),pm->tExp/1000);
00727   manager->class_ = 2;
00728   manager->test2LevelMini = 0;
00729   property = PureSatCreatebAigOfPropFormula(network,
00730     manager, 1, ltlFormula, BMC_NO_INITIAL_STATES);
00731   property = bAig_Not(property);
00732 
00733   if(pm->verbosity>=1)
00734     fprintf(vis_stdout,"property is %ld\n",property);
00735   if(property==0)
00736     return TRUE;
00737   if(property==1)
00738     return FALSE;
00739   manager->assertArray = sat_ArrayAlloc(1);
00740   sat_ArrayInsert(manager->assertArray,manager->InitState);
00741   cm = PureSat_SatManagerAlloc(manager,pm,property,previousResultArray);
00742   sat_MarkTransitiveFaninForArray(cm, cm->assertArray, CoiMask);
00743   cm->option->coreGeneration = 0;
00744   cm->option->IP = 0;
00745   if(pm->verbosity>=1)
00746     fprintf(vis_stdout,"test length 1\n");
00747   sat_Main(cm);
00748   manager->NodesArray = cm->nodesArray;
00749   if(cm->status==SAT_SAT){
00750     fprintf(vis_stdout,"find counter example of length 1\n");
00751     BmcCirCUsPrintCounterExample(network, nodeToMvfAigTable, pm->CoiTable,
00752                                  1, 0,options, BMC_NO_INITIAL_STATES);
00753     return FALSE;
00754   }
00755   t2 = util_cpu_ctime();
00756   if(pm->verbosity>=2)
00757     fprintf(vis_stdout,"Time for testing Length 0 and 1: %g\n",(double)((t2-t1)/1000.0));
00758   cm->option->coreGeneration = 1;
00759   PureSat_SatFreeManager(cm);
00760   Length = 2;
00761   pm->Length = Length;
00762   pism1->Length = Length;
00763 
00764   manager->test2LevelMini = 1;
00765   t3 = util_cpu_ctime();
00766   bAig_PureSat_ExpandTimeFrame(network, manager,pm,2, BMC_NO_INITIAL_STATES);
00767   t5 = util_cpu_ctime();
00768   pm->tExp += t5-t3;
00769   if(pm->verbosity>=2)
00770     fprintf(vis_stdout,"Expansion time:%g,total:%g\n",
00771             (double)((t5-t3)/1000.0),pm->tExp/1000);
00772   manager->class_ = 3;
00773   manager->test2LevelMini = 0;
00774   property = PureSatCreatebAigOfPropFormula(network,
00775     manager, 2, ltlFormula, BMC_NO_INITIAL_STATES);
00776   property = bAig_Not(property);
00777   if(property==0)
00778     return TRUE;
00779   if(property==1)
00780     return FALSE;
00781 
00782   if(pm->verbosity>=1)
00783     fprintf(vis_stdout,"property is %ld\n",property);
00784   manager->test2LevelMini = 1;
00785 
00786 
00787   NumofCurrentLatch=0;
00788   t3 = util_cpu_ctime();
00789   PureSatBmcGetCoiForLtlFormula_New(network, ltlFormula,pm->oldCoiTable);
00790   t5 = util_cpu_ctime();
00791   if(pm->verbosity>=2)
00792     fprintf(vis_stdout,"Compute NTK COI :%g\n",(t5-t3)/1000);
00793 
00794   pm->CoiTable = st_copy(pm->oldCoiTable);
00795 
00796   /*new COI computation*/
00797   t3 = util_cpu_ctime();
00798   tmpTable = PureSatGetAigCoi(network,pm,property);
00799   st_foreach_item(tmpTable,stGen,&nodeName,NIL(char*)){
00800     latch = Ntk_NetworkFindNodeByName(network,nodeName);
00801 #if 1
00802     if(!st_lookup(pm->CoiTable,latch,NIL(char*)))
00803       if(pm->verbosity>=2)
00804         fprintf(vis_stdout,"%s is not in CoiTable\n",nodeName);
00805 #endif
00806     st_insert(pm->CoiTable,latch,(char*)0);
00807   }
00808 #if 1
00809   st_foreach_item(pm->CoiTable,stGen,&latch,NIL(char*)){
00810     nodeName = Ntk_NodeReadName(latch);
00811     if(!st_lookup(tmpTable,nodeName,NIL(char*)))
00812       if(pm->verbosity>=2)
00813         fprintf(vis_stdout,"%s is not in Aig CoiTable\n",nodeName);
00814   }
00815 #endif
00816   st_free_table(tmpTable);
00817   t5 = util_cpu_ctime();
00818   if(pm->verbosity>=2)
00819     fprintf(vis_stdout,"Compute AIG COI :%g\n",(t5-t3)/1000);
00820 
00821 
00822   t3 = util_cpu_ctime();
00823   pm->vertexTable = PureSatCreateInitialAbstraction(network,
00824                       ltlFormula,&NumofCurrentLatch,pm);
00825   t5 = util_cpu_ctime();
00826   if(pm->verbosity>=2)
00827     fprintf(vis_stdout,"the time to create init abs:%g\n",(t5-t3)/1000);
00828   tmpTable = st_init_table(strcmp,st_strhash);
00829   PureSatCreateInitAbsByAIG(manager,pm,property,tmpTable);
00830   st_foreach_item(tmpTable,stGen,&nodeName,NIL(char*)){
00831     if(!st_lookup(pm->vertexTable,nodeName,NIL(char*))){
00832       st_insert(pm->vertexTable,nodeName,(char*)0);
00833       if(pm->verbosity>=1)
00834         fprintf(vis_stdout,"insert %s into init abs model\n",nodeName);
00835     }
00836   }
00837   st_free_table(tmpTable);
00838   t3 = util_cpu_ctime();
00839   if(pm->verbosity>=2)
00840     fprintf(vis_stdout,"the time to create init AIG abs:%g\n",(t3-t5)/1000);
00841 
00842   PureSatPreProcLatch(network,pm);
00843   t5 = util_cpu_ctime();
00844   if(pm->verbosity>=2)
00845     fprintf(vis_stdout,"the time to preproc:%g\n",(t5-t3)/1000);
00846 
00847   /*put indentical latches of visible latch into abs*/
00848   t3 = util_cpu_ctime();
00849   PureSatGetIndenticalLatch(network,pm);
00850   st_foreach_item(pm->vertexTable,stGen,&nodeName,NIL(char*))
00851     array_insert_last(char*,visibleArray,nodeName);
00852   PureSatAddIdenLatchToAbs(network,pm,visibleArray);
00853   arrayForEachItem(char*,visibleArray,i,nodeName)
00854     st_insert(pm->vertexTable,nodeName,(char*)0);
00855   array_free(visibleArray);
00856   visibleArray = array_alloc(char*,0);
00857   t5 = util_cpu_ctime();
00858   if(pm->verbosity>=2)
00859     fprintf(vis_stdout,"Merge identical latch:%g\n",(t5-t3)/1000);
00860 
00861   NumofCurrentLatch = st_count(pm->vertexTable);
00862 
00863   t3 = util_cpu_ctime();
00864   pm->AbsTable = st_init_table(st_ptrcmp,st_ptrhash);
00865 
00866   Ntk_NetworkForEachLatch(network, gen, node){
00867     if (st_lookup_int(pm->CoiTable, (char *) node, &tmp)){
00868       NumofLatch++;
00869       nodeName = Ntk_NodeReadName(node);
00870       if(st_lookup(pm->vertexTable,nodeName,NIL(char *)))
00871         {
00872           array_insert_last(char *,visibleArray,nodeName);
00873           latch = Ntk_NetworkFindNodeByName(network,nodeName);
00874           PureSatComputeTableForLatch(network,pm->AbsTable,latch);
00875         }
00876       else
00877         array_insert_last(char *,invisibleArray,nodeName);
00878     }
00879   }
00880   t5 = util_cpu_ctime();
00881   if(pm->verbosity>=2)
00882     fprintf(vis_stdout,"the time to cmpute abs table:%g\n",(t5-t3)/1000);
00883   if(pm->verbosity>=1){
00884     fprintf(vis_stdout,"visiblearray has %d latches\n",array_n(visibleArray));
00885     fprintf(vis_stdout,"invisibleArray has %d latches\n",array_n(invisibleArray));
00886   }
00887   CoiArray = array_dup(visibleArray);
00888   array_append(CoiArray,invisibleArray);
00889 
00890   pm->nicTable = st_init_table(strcmp,st_strhash);
00891   pm->niaTable = st_init_table(strcmp,st_strhash);
00892   PureSatComputeNumGatesInCone(network,pm,CoiArray);
00893   t3 = util_cpu_ctime();
00894   if(pm->verbosity>=2)
00895     fprintf(vis_stdout,"the time to cmpute gates in cone:%g\n",(t3-t5)/1000);
00896 
00897   /*Using DFS + Dir Cone in abs*/
00898   pm->node2dfsTable = st_init_table(st_ptrcmp,st_ptrhash);
00899 
00900 
00901   while(NumofCurrentLatch < NumofLatch)
00902     {
00903       t3 = util_cpu_ctime();
00904       if(pm->verbosity>=1)
00905         fprintf(vis_stdout,"Current Latches: %d, COI latches:%d,NEW Length:%d,\n",
00906                 NumofCurrentLatch,NumofLatch,pm->Length);
00907       if(pm->verbosity>=2)
00908         fprintf(vis_stdout,"General time: %g\n",(double)((t3-t0)/1000.0));
00909       t1 = util_cpu_ctime();
00910       tmpRefinement = array_alloc(char *,0);
00911 
00912       memset(manager->ipm,0,sizeof(IP_Manager_t));
00913       firstTime = TRUE;
00914       pm->SufAbsTable = st_init_table(st_ptrcmp,st_ptrhash);
00915       if(realRefine){
00916         arrayForEachItem(char *,refinement,i,nodeName)
00917           {
00918             latch = Ntk_NetworkFindNodeByName(network,nodeName);
00919             PureSatComputeTableForLatch(network,pm->AbsTable,latch);
00920             st_insert(pm->vertexTable,nodeName,(char*)0);
00921           }
00922         array_append(visibleArray,refinement);
00923         array_free(invisibleArray);
00924         invisibleArray = array_alloc(char *,0);
00925         st_foreach_item(pm->CoiTable,stGen,&latch,&i)
00926           {
00927             nodeName = Ntk_NodeReadName(latch);
00928             if(!st_lookup(pm->vertexTable,nodeName,(char **)0)){
00929               array_insert_last(char *,invisibleArray,nodeName);
00930             }
00931           }
00932         st_free_table(pm->node2dfsTable);
00933         pm->node2dfsTable = st_init_table(st_ptrcmp,st_ptrhash);
00934         arrayRC = PureSatComputeOrder_2(network,pm,visibleArray,invisibleArray,sccArray,&NumInSecondLevel);
00935         t4 = util_cpu_ctime();
00936         if(pm->verbosity>=2)
00937           fprintf(vis_stdout,"time for compute order: %g\n",(t4-t1)/1000);
00938 
00939         if(pm->RefPredict){
00940           orderCt=0;
00941           if(array_n(pm->latchArray)>0){
00942             if(pm->verbosity>=1)
00943               fprintf(vis_stdout,"\n%d: Adding high RC value latch into abs model\n",orderCt++);
00944             PureSatAddIdenLatchToAbs(network,pm,pm->latchArray);
00945             NumofCurrentLatch+=array_n(pm->latchArray);
00946             arrayForEachItem(char *,pm->latchArray,i,nodeName){
00947               latch = Ntk_NetworkFindNodeByName(network,nodeName);
00948               PureSatComputeTableForLatch(network,pm->AbsTable,latch);
00949               st_insert(pm->vertexTable,nodeName,(char*)0);
00950             }
00951             array_append(visibleArray,pm->latchArray);
00952             array_free(pm->latchArray);
00953             array_free(invisibleArray);
00954             invisibleArray = array_alloc(char *,0);
00955             st_foreach_item(pm->CoiTable,stGen,&latch,&i)
00956               {
00957                 nodeName = Ntk_NodeReadName(latch);
00958                 if(!st_lookup(pm->vertexTable,nodeName,(char **)0)){
00959                   array_insert_last(char *,invisibleArray,nodeName);
00960                 }
00961               }
00962             st_free_table(pm->node2dfsTable);
00963             pm->node2dfsTable = st_init_table(st_ptrcmp,st_ptrhash);
00964             arrayRC = PureSatComputeOrder_2(network,pm,visibleArray,invisibleArray,sccArray,&NumInSecondLevel);
00965 
00966           }
00967           array_free(pm->latchArray);
00968         }
00969 
00970         PureSat_CleanMask(manager,ResetVisibleVarMask);
00971         PuresatMarkVisibleVar(network,visibleArray,pm,0,pm->Length);
00972 
00973         addtoAbs =(int)((double)(array_n(CoiArray)-array_n(visibleArray))/(double)5)+1;
00974         addtoAbs = addtoAbs >50 ? 50: addtoAbs;
00975 
00976         array_free(invisibleArray);
00977         invisibleArray = array_alloc(char *,0);
00978         st_foreach_item(pm->CoiTable,stGen,&latch,&i)
00979           {
00980             nodeName = Ntk_NodeReadName(latch);
00981             if(!st_lookup(pm->vertexTable,nodeName,(char **)0)){
00982               array_insert_last(char *,invisibleArray,nodeName);
00983             }
00984           }
00985         if(pm->verbosity>=1){
00986           fprintf(vis_stdout,"After adding high RC latches:\n");
00987           fprintf(vis_stdout,"visiblearray has %d latches\n",array_n(visibleArray));
00988           fprintf(vis_stdout,"invisibleArray has %d latches\n",array_n(invisibleArray));
00989         }
00990         t4 = util_cpu_ctime();
00991         t4total += t4-t3;
00992         if(pm->verbosity>=2)
00993           fprintf(vis_stdout,"compute and add high RC latch and recompute order:%g,total:%g\n",
00994                  (t4-t3)/1000,(t4total/1000.0));
00995 
00996         if(pm->verbosity>=1)
00997           fprintf(vis_stdout,"NumInSecondLevel is %d  ",NumInSecondLevel);
00998         latchThreshHold = NumInSecondLevel;
00999         if(pm->verbosity>=2){
01000           fprintf(vis_stdout,"New latchThreshHold is %d\n",latchThreshHold);
01001         }
01002         t2 = util_cpu_ctime();
01003         if(pm->verbosity>=2){
01004           fprintf(vis_stdout,"Recompute Order: %g\n",(double)((t2-t1)/1000.0));
01005         }
01006         array_free(refinement);
01007         refinement = array_alloc(char *,0);
01008      }/* if(realRefine)*/
01009 
01010      /* means no ref, just Length++.*/
01011       realRefine =FALSE;
01012       t1 = util_cpu_ctime();
01013 
01014       ExistACE = PureSat_CheckAceByIP(network,pm,pism1, visibleArray,&Length,
01015                               ltlFormula, &property,previousResultArray);
01016       if(ExistACE)
01017         {
01018           if(pm->returnVal == -1){
01019              PureSatIncreSATManagerFree(pm,pism1);
01020              /*PureSatManagerFree(pm);*/
01021              array_free(CoiArray);
01022              BmcOptionFree(options);
01023              return FALSE;
01024           }
01025           pm->Length = Length;
01026           pism1->Length = Length;
01027           t2 = util_cpu_ctime();
01028           pm->tIP += t2-t1;
01029           if(pm->verbosity>=2)
01030             fprintf(vis_stdout,"Solve on IP: %g, total: %g\n",
01031                    (double)((t2-t1)/1000.0),(double)pm->tIP/1000.0);
01032 
01033 
01034           if(ExistACE)
01035             {
01036               int Con=0;
01037               if(pm->verbosity>=1)
01038                 fprintf(vis_stdout,"found Abstract Counterexample at length %d\n", pm->Length);
01039               realRefine = TRUE;
01040 
01041               /*incrementally check Concrete Model*/
01042               if(pm->verbosity>=1)
01043                 fprintf(vis_stdout,"Begin building a new abstract model\n");
01044               for(i=0;i<array_n(arrayRC);i=i+latchThreshHold)
01045                 {
01046                   Con = 0;
01047                   if(i>0)
01048                     latchThreshHold = array_n(arrayRC)-latchThreshHold;
01049                   for(j=0;j<latchThreshHold;j++)
01050                     {
01051                       if((i+j)<array_n(arrayRC))
01052                         {
01053                           nodeName = array_fetch(char *,arrayRC,i+j);
01054                           array_insert_last(char *,tmpRefinement,nodeName);
01055                           if(pm->verbosity>=2)
01056                             if(pm->verbosity>=2)
01057                               fprintf(vis_stdout, "picking %s\n",nodeName);
01058                           if((i+j)==(array_n(arrayRC)-1))
01059                             Con = 1;
01060                         }
01061                       else{
01062                         Con = 1;
01063                         break;
01064                       }
01065                     }/* for(j=0;*/
01066                   tmpRefinement1=array_dup(visibleArray);
01067                   array_append(tmpRefinement1,tmpRefinement);
01068 
01069                   t1 = util_cpu_ctime();
01070 
01071                   if(pm->verbosity>=2)
01072                     satStat = 1;
01073                   if(!PureSat_ConcretTest(network,pm,tmpRefinement1,property,previousResultArray,Con,satStat,1)){
01074 
01075                     t2 = util_cpu_ctime();
01076                     pm->tCon = pm->tCon+t2-t1;
01077                     if(pm->verbosity>=2)
01078                       fprintf(vis_stdout,"time for finding a sufficient set on model: %g, total:%g\n",
01079                              (double)((t2-t1)/1000.0),(double)pm->tCon/1000.0);
01080                     if((i+j)>=array_n(arrayRC)){
01081                       fprintf(vis_stdout,"found real counterexamples\n");
01082 
01083                       PureSatIncreSATManagerFree(pm, pism1);
01084                       /*PureSatManagerFree(pm);*/
01085                       array_free(CoiArray);
01086                       BmcOptionFree(options);
01087                       return FALSE;
01088                     }
01089                     /* else{
01090                       ;
01091                       }*/
01092                   }
01093                   else{
01094                     t2 = util_cpu_ctime();
01095                     pm->tCon = pm->tCon+t2-t1;
01096                     if(pm->verbosity>=1)
01097                       fprintf(vis_stdout,"found a sufficient model\n");
01098                     if(pm->verbosity>=2)
01099                       fprintf(vis_stdout,"time for finding a sufficient set on model: %g, total:%g\n",
01100                              (double)((t2-t1)/1000.0),(double)pm->tCon/1000.0);
01101                     firstTime = FALSE;
01102                     arrayForEachItem(char *,tmpRefinement1,k,nodeName){
01103                       node = Ntk_NetworkFindNodeByName(network, nodeName);
01104                       if(!st_lookup(pm->SufAbsTable,(char *)node,NIL(char *)))
01105                         st_insert(pm->SufAbsTable,(char *)node, (char *)0);
01106                       else{
01107                         fprintf(vis_stdout,"wrong in sufabstable \n");
01108                         exit(0);
01109                       }
01110                     }
01111                     array_free(tmpRefinement1);
01112                     break;
01113                   }
01114                   array_free(tmpRefinement1);
01115                 }
01116 
01117               t1 = util_cpu_ctime();
01118 
01119 #if 1
01120               if(pm->savedConCls){
01121                 sat_ArrayFree(pm->savedConCls);
01122                 pm->savedConCls = 0;
01123               }
01124 #endif
01125 #if SWITCH_DA
01126               refinement = PureSat_RefineOnAbs_DA(network,pm,property,previousResultArray,
01127                                                   latchThreshHold,sccArray,tmpRefinement);
01128 #else
01129               refinement = PureSat_RefineOnAbs(network,pm,property,previousResultArray,
01130                                                latchThreshHold,sccArray,tmpRefinement);
01131 #endif
01132               array_free(tmpRefinement);
01133               t2 = util_cpu_ctime();
01134               pm->tRef = pm->tRef+t2-t1;
01135               if(pm->verbosity>=2)
01136                 fprintf(vis_stdout,"time for RefOnAbs: %g, total:%g\n",
01137                        (t2-t1)/1000.0,pm->tRef/1000);
01138               st_free_table(pm->SufAbsTable);
01139               pm->SufAbsTable = 0;
01140 
01141               /*adjust parameters*/
01142               NumofCurrentLatch+=array_n(refinement);
01143               pm->Length++;
01144               pism1->Length++;
01145               Length++;
01146             }/* if(pism2->cm->status == SAT_SAT)*/
01147         } /*if(ExistACE)*/
01148       else /* if TRUE from IP*/
01149         {
01150           t2 = util_cpu_ctime();
01151           pm->tIP = pm->tIP+t2-t1;
01152           if(pm->verbosity>=2)
01153             fprintf(vis_stdout,"Solve on IP: %g, total: %g\n",
01154                    (t2-t1)/1000.0,pm->tIP/1000.0);
01155           fprintf(vis_stdout,"Convergence reached, exit\n");
01156           PureSatIncreSATManagerFree(pm,pism1);
01157           /*PureSatManagerFree(pm);*/
01158           array_free(CoiArray);
01159           BmcOptionFree(options);
01160           return TRUE;
01161         }
01162     }/* while(NumofCurrentLatch < NumofLatch)*/
01163   /*st_free_table(AbsTable);*/
01164 
01165   /*Now go to the concrete model*/
01166   if(pm->verbosity>=1)
01167     fprintf(vis_stdout,"reach concrete model\n");
01168   array_append(visibleArray,refinement);
01169   array_free(refinement);
01170 
01171 
01172   ExistACE = PureSatIPOnCon(network,ltlFormula,pm);
01173   ExistACE = !ExistACE;
01174   PureSatIncreSATManagerFree(pm,pism1);
01175   /*PureSatManagerFree(pm);*/
01176   array_free(CoiArray);
01177   BmcOptionFree(options);
01178   if(ExistACE)
01179     return FALSE;
01180   else
01181     return TRUE;
01182 }