VIS

src/bmc/bmcAutSat.c

Go to the documentation of this file.
00001 
00017 #include "bmc.h"
00018 #include "bmcInt.h"
00019 
00020 static char rcsid[] UNUSED = "$Id: bmcAutSat.c,v 1.10 2005/04/16 18:02:25 awedh Exp $";
00021 
00022 /*---------------------------------------------------------------------------*/
00023 /* Constant declarations                                                     */
00024 /*---------------------------------------------------------------------------*/
00025 
00026 /*---------------------------------------------------------------------------*/
00027 /* Type declarations                                                         */
00028 /*---------------------------------------------------------------------------*/
00029 
00030 
00031 /*---------------------------------------------------------------------------*/
00032 /* Structure declarations                                                    */
00033 /*---------------------------------------------------------------------------*/
00034 
00035 
00036 /*---------------------------------------------------------------------------*/
00037 /* Variable declarations                                                     */
00038 /*---------------------------------------------------------------------------*/
00039 
00040 
00043 /*---------------------------------------------------------------------------*/
00044 /* Static function prototypes                                                */
00045 /*---------------------------------------------------------------------------*/
00046 
00047 
00051 /*---------------------------------------------------------------------------*/
00052 /* Definition of exported functions                                          */
00053 /*---------------------------------------------------------------------------*/
00054 
00055 
00056 /*---------------------------------------------------------------------------*/
00057 /* Definition of internal functions                                          */
00058 /*---------------------------------------------------------------------------*/
00059 
00085 int
00086 BmcAutLtlCheckForTermination(
00087   Ntk_Network_t            *network,
00088   array_t                  *constraintArray,
00089   BmcCheckForTermination_t *terminationStatus,
00090   st_table                 *nodeToMvfAigTable,
00091   st_table                 *CoiTable,
00092   BmcOption_t              *options)
00093 {
00094   
00095   BmcCnfClauses_t *cnfClauses = NIL(BmcCnfClauses_t);
00096   FILE            *cnfFile;
00097   array_t         *result = NIL(array_t);
00098   array_t         *unitClause = array_alloc(int, 0);
00099   array_t         *orClause;
00100 
00101   long            startTime, endTime;
00102   int             k = terminationStatus->k;
00103   int             returnStatus = 0;
00104   Ltl_Automaton_t *automaton = terminationStatus->automaton;
00105 
00106   /*
00107     If checkLevel == 0 -->  check for beta' only and if UNSAT, m=k and chekLevel =1
00108     If checkLevel == 1 -->  check for beta  only and if UNSAT, checkLevel = 2.
00109     If checkLevel == 2 -->  check for alpha only and if UNSAT, n=k and checkLevel = 3.
00110     If gama is UNSAT up to (m+n-1) and checkLvel = 3, formula passes.
00111     checkLevel = 4 if (m+n-1) > maxK;
00112    */ 
00113   startTime = util_cpu_ctime();
00114  
00115   /* ===========================
00116      Early termination condition
00117      =========================== */
00118   if (options->earlyTermination) {
00119     if (options->verbosityLevel == BmcVerbosityMax_c) {
00120       (void) fprintf(vis_stdout, "\nChecking the early termination at k= %d\n", k);
00121     }
00122     /*
00123       Create clauses database 
00124     */
00125     cnfClauses = BmcCnfClausesAlloc();
00126 
00127     cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);  
00128     if (cnfFile == NIL(FILE)) {
00129       (void)fprintf(vis_stderr,
00130                     "** bmc error: Cannot create CNF output file %s\n",
00131                     options->satInFile);
00132       return -1;
00133     }
00134     BmcAutCnfGenerateClausesForSimpleCompositePath(network, automaton, 0, k, BMC_INITIAL_STATES,
00135                                                 cnfClauses, nodeToMvfAigTable, CoiTable);
00136     BmcWriteClauses(NIL(mAig_Manager_t), cnfFile, cnfClauses, options);
00137     (void) fclose(cnfFile);
00138     BmcCnfClausesFree(cnfClauses);
00139           
00140     result = BmcCheckSAT(options);
00141     if(options->satSolverError){
00142       return -1;
00143     }
00144     if(result == NIL(array_t)) {
00145       (void) fprintf(vis_stdout, "# BMC: by early ermination\n");
00146       return 3;
00147     }
00148   } /* Early termination */
00149    if((!automaton->fairSets) &&
00150      (terminationStatus->checkLevel == 0)) {
00151     /*
00152       All the automaton states are fair states. So, beta' and beta are always UNSAT.
00153     */
00154     terminationStatus->m = 0;
00155      (void) fprintf(vis_stdout,"Value of m = %d\n", terminationStatus->m);
00156     terminationStatus->checkLevel = 2;
00157   }
00158   /*
00159     beta''(k) 
00160   */
00161   if(terminationStatus->checkLevel == 0){ 
00162     int i;
00163     /*
00164       Create clauses database 
00165     */
00166     cnfClauses = BmcCnfClausesAlloc();
00167     if (options->verbosityLevel == BmcVerbosityMax_c) {
00168       (void) fprintf(vis_stdout, "# BMC: Check Beta'' \n");
00169     }
00170     cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);  
00171     if (cnfFile == NIL(FILE)) {
00172       (void)fprintf(vis_stderr,
00173                     "** bmc error: Cannot create CNF output file %s\n",
00174                     options->satInFile);
00175       return -1;
00176     }
00177     BmcAutCnfGenerateClausesForSimpleCompositePath(network, automaton, 0, k+1, BMC_NO_INITIAL_STATES,
00178                                                 cnfClauses, nodeToMvfAigTable, CoiTable);
00179     for(i=1; i<=k+1; i++){
00180       if(constraintArray != NIL(array_t)){
00181         Ctlsp_Formula_t *formula;
00182         int              j;
00183         
00184         arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00185           array_insert(int, unitClause, 0,
00186                        - BmcGenerateCnfForLtl(network, formula, i, i, -1, cnfClauses)
00187                        );
00188           BmcCnfInsertClause(cnfClauses, unitClause);
00189         }
00190       }
00191       array_insert(int, unitClause, 0,
00192                    - BmcAutGenerateCnfForBddOffSet(automaton->fairSets, i, i, cnfClauses, NIL(st_table))
00193                    );
00194       BmcCnfInsertClause(cnfClauses, unitClause);
00195     }
00196        if(constraintArray != NIL(array_t)){
00197       Ctlsp_Formula_t *formula;
00198       int              j;
00199 
00200       orClause   = array_alloc(int, 0);
00201       
00202       arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00203         array_insert_last(int, orClause,
00204                           BmcGenerateCnfForLtl(network, formula, k+1, k+1, -1, cnfClauses)
00205                           );
00206       }
00207       array_insert_last(int, orClause, 
00208                         BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k+1, k+1, cnfClauses, NIL(st_table))
00209                         );
00210       BmcCnfInsertClause(cnfClauses, orClause);
00211       array_free(orClause);
00212     } else {
00213       array_insert(int, unitClause, 0, 
00214                    BmcAutGenerateCnfForBddOffSet(automaton->fairSets, 0, 0, cnfClauses, NIL(st_table))
00215                    );
00216       BmcCnfInsertClause(cnfClauses, unitClause);
00217     }
00218     BmcWriteClauses(NIL(mAig_Manager_t), cnfFile, cnfClauses, options);
00219     (void) fclose(cnfFile);
00220     
00221     result = BmcCheckSAT(options);
00222     
00223     if(options->satSolverError){
00224       return -1;
00225     }
00226     if(result == NIL(array_t)) {
00227       terminationStatus->m = k;
00228       (void)fprintf(vis_stderr,"m = %d\n", terminationStatus->m);
00229       terminationStatus->checkLevel = 1;
00230     }
00231     BmcCnfClausesFree(cnfClauses);
00232   } /* Check for Beta' */
00233   
00234   /*
00235     beta'(k) 
00236   */
00237   if(terminationStatus->checkLevel == 0){
00238     int i;
00239     /*
00240       Create clauses database 
00241     */
00242     cnfClauses = BmcCnfClausesAlloc();
00243     if (options->verbosityLevel == BmcVerbosityMax_c) {
00244       (void) fprintf(vis_stdout, "# BMC: Check Beta' \n");
00245     }
00246     cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);  
00247     if (cnfFile == NIL(FILE)) {
00248       (void)fprintf(vis_stderr,
00249                     "** bmc error: Cannot create CNF output file %s\n",
00250                     options->satInFile);
00251       return -1;
00252     }
00253     BmcAutCnfGenerateClausesForSimpleCompositePath(network, automaton, 0, k+1, BMC_NO_INITIAL_STATES,
00254                                                 cnfClauses, nodeToMvfAigTable, CoiTable);
00255     for(i=0; i<=k; i++){
00256       if(constraintArray != NIL(array_t)){
00257         Ctlsp_Formula_t *formula;
00258         int              j;
00259         
00260         arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00261           array_insert(int, unitClause, 0,
00262                        - BmcGenerateCnfForLtl(network, formula, i, i, -1, cnfClauses)
00263                        );
00264           BmcCnfInsertClause(cnfClauses, unitClause);
00265         }
00266       }
00267       array_insert(int, unitClause, 0,
00268                    - BmcAutGenerateCnfForBddOffSet(automaton->fairSets, i, i, cnfClauses, NIL(st_table))
00269                    );
00270       BmcCnfInsertClause(cnfClauses, unitClause);
00271     }
00272     if(constraintArray != NIL(array_t)){
00273       Ctlsp_Formula_t *formula;
00274       int              j;
00275 
00276       orClause   = array_alloc(int, 0);
00277       
00278       arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00279         array_insert_last(int, orClause,
00280                           BmcGenerateCnfForLtl(network, formula, k+1, k+1, -1, cnfClauses)
00281                           );
00282       }
00283       array_insert_last(int, orClause, 
00284                         BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k+1, k+1, cnfClauses, NIL(st_table))
00285                         );
00286       BmcCnfInsertClause(cnfClauses, orClause);
00287       array_free(orClause);
00288     } else {
00289       array_insert(int, unitClause, 0, 
00290                    BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k+1, k+1, cnfClauses, NIL(st_table))
00291                    );
00292       BmcCnfInsertClause(cnfClauses, unitClause);
00293     }
00294     
00295     BmcWriteClauses(NIL(mAig_Manager_t), cnfFile, cnfClauses, options);
00296     (void) fclose(cnfFile);
00297     
00298     result = BmcCheckSAT(options);
00299     
00300     if(options->satSolverError){
00301       return -1;
00302     }
00303     if(result == NIL(array_t)) {
00304       terminationStatus->m = k;
00305       (void)fprintf(vis_stdout,"Value of m = %d\n", terminationStatus->m);
00306       terminationStatus->checkLevel = 1;
00307     }
00308     BmcCnfClausesFree(cnfClauses);
00309   } /* Check for Beta' */
00310   
00311   /*
00312     Check for Beta.
00313   */
00314   if(terminationStatus->checkLevel == 1){
00315     cnfClauses = BmcCnfClausesAlloc();
00316     {/* To print a witness */
00317       /*  lsGen               lsGen;
00318       vertex_t            *vtx;
00319       Ltl_AutomatonNode_t *state;
00320       int i;
00321       
00322       foreach_vertex(automaton->G, lsGen, vtx) {
00323         state = (Ltl_AutomatonNode_t *) vtx->user_data;
00324         state->cnfIndex = ALLOC(int, k+2);
00325         for(i=0; i<=k+1; i++){
00326           state->cnfIndex[i] = BmcAutGenerateCnfForBddOffSet(state->Encode, i,
00327                                                              i, cnfClauses, NIL(st_table));
00328         }
00329         } */
00330     }/* To print a witness */
00331     if (options->verbosityLevel == BmcVerbosityMax_c) {
00332       (void) fprintf(vis_stdout, "# BMC: Check Beta\n");
00333     }
00334     
00335     cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);  
00336     if (cnfFile == NIL(FILE)) {
00337       (void)fprintf(vis_stderr,
00338                     "** bmc error: Cannot create CNF output file %s\n",
00339                     options->satInFile);
00340       return -1;
00341     }
00342     /*
00343       Generate a simple path of length k+1.
00344     */
00345     BmcAutCnfGenerateClausesForSimpleCompositePath(network, automaton, 0, k+1, BMC_NO_INITIAL_STATES,
00346                                                 cnfClauses, nodeToMvfAigTable,
00347                                                    CoiTable);
00348 
00349     if(constraintArray != NIL(array_t)){
00350       Ctlsp_Formula_t *formula;
00351       int              j;
00352       
00353       arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00354         array_insert(int, unitClause, 0,
00355                      - BmcGenerateCnfForLtl(network, formula, k, k, -1, cnfClauses)
00356                      );
00357         BmcCnfInsertClause(cnfClauses, unitClause);
00358       }
00359     }
00360     
00361     array_insert(int, unitClause, 0, 
00362                  - BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k, k, cnfClauses, NIL(st_table))
00363                  );
00364     BmcCnfInsertClause(cnfClauses, unitClause);
00365 
00366    if(constraintArray != NIL(array_t)){
00367       Ctlsp_Formula_t *formula;
00368       int              j;
00369 
00370       orClause   = array_alloc(int, 0);
00371       
00372       arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00373         array_insert_last(int, orClause,
00374                           BmcGenerateCnfForLtl(network, formula, k+1, k+1, -1, cnfClauses)
00375                           );
00376       }
00377       array_insert_last(int, orClause, 
00378                         BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k+1, k+1, cnfClauses, NIL(st_table))
00379                         );
00380       BmcCnfInsertClause(cnfClauses, orClause);
00381       array_free(orClause);
00382     } else { 
00383       array_insert(int, unitClause, 0, 
00384                    BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k+1, k+1, cnfClauses, NIL(st_table))
00385                    );
00386       BmcCnfInsertClause(cnfClauses, unitClause);
00387     }
00388     
00389     BmcWriteClauses(NIL(mAig_Manager_t), cnfFile, cnfClauses, options);
00390     (void) fclose(cnfFile);
00391     
00392     result = BmcCheckSAT(options);
00393     
00394     if(options->satSolverError){
00395       return -1;
00396     }
00397     if(result == NIL(array_t)) {
00398       terminationStatus->checkLevel = 2;
00399     }
00400     BmcCnfClausesFree(cnfClauses);
00401   } /* Check Beta*/
00402   
00403   if(terminationStatus->checkLevel == 2){ /* we check Alpha if Beta is unsatisfiable */
00404 
00405     if (options->verbosityLevel == BmcVerbosityMax_c) {
00406       (void) fprintf(vis_stdout, "# BMC: Check Alpha \n");
00407     }
00408     
00409     cnfClauses = BmcCnfClausesAlloc();
00410       
00411     cnfFile = Cmd_FileOpen(options->satInFile, "w", NIL(char *), 0);  
00412     if (cnfFile == NIL(FILE)) {
00413       (void)fprintf(vis_stderr,
00414                     "** bmc error: Cannot create CNF output file %s\n",
00415                     options->satInFile);
00416       return -1;
00417     }
00418     
00419     BmcAutCnfGenerateClausesForSimpleCompositePath(network, automaton, 0, k, BMC_INITIAL_STATES,
00420                                                 cnfClauses, nodeToMvfAigTable, CoiTable);
00421     if(automaton->fairSets){
00422 
00423       if(constraintArray != NIL(array_t)){
00424         Ctlsp_Formula_t *formula;
00425         int              j;
00426         
00427         orClause   = array_alloc(int, 0);
00428         
00429         arrayForEachItem(Ctlsp_Formula_t *, constraintArray, j, formula) {
00430           array_insert_last(int, orClause,
00431                             BmcGenerateCnfForLtl(network, formula, k, k, -1, cnfClauses)
00432                             );
00433         }
00434         array_insert_last(int, orClause, 
00435                           BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k, k, cnfClauses, NIL(st_table))
00436                           );
00437         BmcCnfInsertClause(cnfClauses, orClause);
00438         array_free(orClause);
00439       } else {
00440         
00441         array_insert(int, unitClause, 0,  
00442                      BmcAutGenerateCnfForBddOffSet(automaton->fairSets, k, k, cnfClauses, NIL(st_table))
00443                      );
00444         BmcCnfInsertClause(cnfClauses, unitClause);
00445       }
00446     }
00447     BmcWriteClauses(NIL(mAig_Manager_t), cnfFile, cnfClauses, options);
00448     (void) fclose(cnfFile);
00449     
00450     result = BmcCheckSAT(options);
00451     BmcCnfClausesFree(cnfClauses);
00452     if(options->satSolverError){
00453       return -1;
00454     }
00455     if(result == NIL(array_t)) {
00456       terminationStatus->n = k;
00457       terminationStatus->checkLevel = 3;
00458       (void)fprintf(vis_stderr,"m=%d  n=%d\n",terminationStatus->m,terminationStatus->n);
00459       if ((terminationStatus->m+terminationStatus->n-1) <= options->maxK){
00460         terminationStatus->k = terminationStatus->m+terminationStatus->n-1;
00461         if(k==0){
00462           /*
00463             By induction, the property passes.
00464           */
00465           terminationStatus->k = 0;
00466         }
00467         returnStatus = 1;
00468       } else {
00469         terminationStatus->checkLevel = 4;
00470         returnStatus = 2;
00471       }
00472     }
00473   }/* Chek for Alpha */
00474   
00475   array_free(unitClause);
00476 
00477   if (options->verbosityLevel != BmcVerbosityNone_c) {
00478     endTime = util_cpu_ctime();
00479     fprintf(vis_stdout, "-- Check for termination time time = %10g\n",
00480             (double)(endTime - startTime) / 1000.0);
00481   }
00482 
00483   return returnStatus;
00484  
00485 } /* BmcAutLtlCheckForTermination */
00486 
00487 
00501 void
00502 BmcAutCnfGenerateClausesForPath(
00503   Ltl_Automaton_t *automaton,
00504   int             fromState,
00505   int             toState,
00506   int             initialState,
00507   BmcCnfClauses_t *cnfClauses)
00508 {
00509   int          k;
00510   array_t      *unitClause = array_alloc(int, 1);
00511 
00512   if(initialState){
00513     array_insert(int, unitClause, 0, 
00514                  BmcAutGenerateCnfForBddOffSet(automaton->initialStates, 0, 0, cnfClauses, automaton->nsPsTable)
00515                  );
00516     BmcCnfInsertClause(cnfClauses, unitClause);
00517   }
00518   for(k=fromState; k<toState; k++){
00519     array_insert(int, unitClause, 0,  
00520     BmcAutGenerateCnfForBddOffSet(automaton->transitionRelation, k, k+1, cnfClauses, automaton->nsPsTable)
00521                       );
00522     BmcCnfInsertClause(cnfClauses, unitClause);
00523   }
00524   array_free(unitClause);
00525   
00526 } /* BmcAutCnfGenerateClausesForPath() */
00527 
00528 
00549 void
00550 BmcAutCnfGenerateClausesForSimpleCompositePath(
00551    Ntk_Network_t   *network,
00552    Ltl_Automaton_t *automaton,
00553    int             fromState,
00554    int             toState,
00555    int             initialState,
00556    BmcCnfClauses_t *cnfClauses,
00557    st_table        *nodeToMvfAigTable,
00558    st_table        *CoiTable)
00559 {
00560   int state;
00561   
00562   /*
00563     Generate clauses for a path from fromState to toState in the original model.
00564   */
00565   BmcCnfGenerateClausesForPath(network, fromState, toState, initialState, cnfClauses, nodeToMvfAigTable, CoiTable);
00566   /*
00567     Generate clauses for a path from fromState to toState in the Automaton.
00568   */
00569   BmcAutCnfGenerateClausesForPath(automaton, fromState, toState, initialState, cnfClauses);
00570   
00571   /*
00572     Restrict the above path to be simpe path.
00573   */
00574   for(state= fromState + 1; state < toState; state++){
00575     BmcCnfNoLoopToAnyPreviouseCompositeStates(network, automaton, fromState, state,
00576                                               cnfClauses, nodeToMvfAigTable, CoiTable);
00577   }
00578 
00579   return;
00580 } /* BmcAutCnfGenerateClausesForSimpleCompositePath */
00581 
00582 
00598 void
00599 BmcCnfNoLoopToAnyPreviouseCompositeStates(
00600    Ntk_Network_t   *network,
00601    Ltl_Automaton_t *automaton,
00602    int             fromState,
00603    int             toState,
00604    BmcCnfClauses_t *cnfClauses,
00605    st_table        *nodeToMvfAigTable,
00606    st_table        *CoiTable)
00607 {
00608   mAig_Manager_t     *manager   = Ntk_NetworkReadMAigManager(network);
00609   bdd_manager        *bddManager = bdd_get_manager(automaton->transitionRelation);
00610   
00611   Ntk_Node_t         *latch;
00612   MvfAig_Function_t  *latchMvfAig;
00613   bAigEdge_t         *latchBAig;
00614   array_t            *orClause;
00615   int                currentIndex, nextIndex, andIndex1, andIndex2;  
00616   int                i, k, mvfSize, bddID;
00617     
00618   st_generator       *stGen;
00619 
00620   /*
00621     Generates CNF clauses to constrain that the toState is not equal
00622     to any previouse states starting from fromState.
00623     
00624     Assume there are two state varaibles a and b. To check if Si !=
00625     Sj, we must generate clauses for the formula ( ai != aj + bi !=
00626     bj).
00627   */
00628   for(k=fromState; k < toState; k++){
00629     orClause = array_alloc(int,0);
00630     st_foreach_item(CoiTable, stGen, &latch, NULL) {
00631       
00632   
00633       latchMvfAig = Bmc_ReadMvfAig(latch, nodeToMvfAigTable);
00634       if (latchMvfAig ==  NIL(MvfAig_Function_t)){
00635         latchMvfAig = Bmc_NodeBuildMVF(network, latch);
00636         array_free(latchMvfAig);
00637         latchMvfAig = Bmc_ReadMvfAig(latch, nodeToMvfAigTable);
00638       } 
00639       mvfSize   = array_n(latchMvfAig);
00640       latchBAig = ALLOC(bAigEdge_t, mvfSize);   
00641       
00642       for(i=0; i< mvfSize; i++){
00643         latchBAig[i] = bAig_GetCanonical(manager, MvfAig_FunctionReadComponent(latchMvfAig, i));
00644       }
00645 
00646       for (i=0; i< mvfSize; i++){
00647         currentIndex = BmcGenerateCnfFormulaForAigFunction(manager, latchBAig[i], k       ,cnfClauses);
00648         nextIndex = BmcGenerateCnfFormulaForAigFunction(manager, latchBAig[i], toState ,cnfClauses);     
00649         andIndex1 = cnfClauses->cnfGlobalIndex++;
00650         BmcCnfGenerateClausesForAND(currentIndex, -nextIndex, andIndex1, cnfClauses);
00651         andIndex2 = cnfClauses->cnfGlobalIndex++;
00652         BmcCnfGenerateClausesForAND(-currentIndex, nextIndex, andIndex2, cnfClauses);
00653 
00654         array_insert_last(int, orClause, andIndex1);
00655         array_insert_last(int, orClause, andIndex2);
00656       }
00657       FREE(latchBAig);
00658     }/* For each latch loop*/
00659     st_foreach_item(automaton->psNsTable, stGen, &bddID, NULL) {
00660       currentIndex = BmcGetCnfVarIndexForBddNode(bddManager, bdd_regular(bdd_bdd_ith_var(bddManager, bddID)),
00661                                                  k, cnfClauses);
00662       nextIndex    = BmcGetCnfVarIndexForBddNode(bddManager, bdd_regular(bdd_bdd_ith_var(bddManager, bddID)),
00663                                                  toState, cnfClauses);
00664                                                  
00665       andIndex1 = cnfClauses->cnfGlobalIndex++;
00666       BmcCnfGenerateClausesForAND(currentIndex, -nextIndex, andIndex1, cnfClauses);
00667       andIndex2 = cnfClauses->cnfGlobalIndex++;
00668       BmcCnfGenerateClausesForAND(-currentIndex, nextIndex, andIndex2, cnfClauses);
00669       
00670       array_insert_last(int, orClause, andIndex1);
00671       array_insert_last(int, orClause, andIndex2);
00672     }
00673     BmcCnfInsertClause(cnfClauses, orClause);
00674     array_free(orClause);
00675   } /* foreach k*/
00676   return;
00677 } /* BmcCnfNoLoopToAnyPreviouseCompositeStates */