VIS

src/fsm/fsmCmd.c

Go to the documentation of this file.
00001 
00032 #include "fsmInt.h"
00033 
00034 static char rcsid[] UNUSED = "$Id: fsmCmd.c,v 1.122 2005/05/19 03:21:37 awedh Exp $";
00035 
00036 /*---------------------------------------------------------------------------*/
00037 /* Variable declarations                                                     */
00038 /*---------------------------------------------------------------------------*/
00039 static jmp_buf timeOutEnv;
00040 
00043 /*---------------------------------------------------------------------------*/
00044 /* Static function prototypes                                                */
00045 /*---------------------------------------------------------------------------*/
00046 
00047 static int CommandComputeReach(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00048 static int CommandReadFairness(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00049 static int CommandResetFairness(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00050 static int CommandPrintFairness(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00051 static int CommandPrintImageInfo(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00052 static int CommandPrintHdOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00053 static int CommandPrintArdcOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00054 static int CommandPrintTfmOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00055 static int CommandPrintHybridOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00056 static int CommandPrintMlpOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00057 static int CommandPrintGuidedSearchOptions(Hrc_Manager_t ** hmgr, int argc, char ** argv);
00058 static void TimeOutHandle(void);
00059 
00063 /*---------------------------------------------------------------------------*/
00064 /* Definition of exported functions                                          */
00065 /*---------------------------------------------------------------------------*/
00066 
00076 void
00077 Fsm_Init(void)
00078 {
00079   Cmd_CommandAdd("compute_reach",   CommandComputeReach,   0);
00080   Cmd_CommandAdd("read_fairness",   CommandReadFairness,   0);
00081   Cmd_CommandAdd("reset_fairness",  CommandResetFairness,  0);
00082   Cmd_CommandAdd("print_fairness",  CommandPrintFairness,  0);
00083   Cmd_CommandAdd("print_img_info",  CommandPrintImageInfo, 0);
00084   Cmd_CommandAdd("print_hd_options",  CommandPrintHdOptions, 0);
00085   Cmd_CommandAdd("print_guided_search_options",  CommandPrintGuidedSearchOptions, 0);
00086   Cmd_CommandAdd("print_ardc_options",  CommandPrintArdcOptions, 0);
00087   Cmd_CommandAdd("print_tfm_options",  CommandPrintTfmOptions, 0);
00088   Cmd_CommandAdd("print_hybrid_options",  CommandPrintHybridOptions, 0);
00089   Cmd_CommandAdd("print_mlp_options",  CommandPrintMlpOptions, 0);
00090 }
00091 
00092 
00102 void
00103 Fsm_End(void)
00104 {
00105 }
00106 
00107 /*---------------------------------------------------------------------------*/
00108 /* Definition of internal functions                                          */
00109 /*---------------------------------------------------------------------------*/
00110 
00111 
00112 /*---------------------------------------------------------------------------*/
00113 /* Definition of static functions                                            */
00114 /*---------------------------------------------------------------------------*/
00115 
00283 static int
00284 CommandComputeReach(
00285   Hrc_Manager_t ** hmgr,
00286   int  argc,
00287   char ** argv)
00288 {
00289   int        c;
00290   mdd_t      *reachableStates = NIL(mdd_t);
00291   mdd_t      *initialStates;
00292   long        initialTime;
00293   long        finalTime;
00294   static int  verbosityLevel;
00295   static int  printStep;
00296   static int  timeOutPeriod;
00297   Fsm_Fsm_t  *fsm = Fsm_HrcManagerReadCurrentFsm(*hmgr);
00298   static int reorderFlag;
00299   static int reorderThreshold;
00300   static int shellFlag;
00301   static int depthValue;
00302   static int incrementalFlag;
00303   static int approxFlag;
00304   static int ardc;
00305   static int recompute;
00306   Fsm_RchType_t rchType;
00307   FILE *guideFile = NIL(FILE); /* file of hints for guided search */
00308   array_t *guideArray = NIL(array_t);
00309   Img_MethodType imgMethod;
00310   
00311   /*
00312    * These are the default values.  These variables must be declared static
00313    * to avoid lint warnings.  Since they are static, we must reinitialize
00314    * them outside of the variable declarations.
00315    */
00316   verbosityLevel = 0;
00317   printStep      = 0;
00318   timeOutPeriod  = 0;
00319   shellFlag = 0;
00320   depthValue = 0;
00321   incrementalFlag = 0;
00322   rchType = Fsm_Rch_Default_c;
00323   approxFlag = 0;
00324   ardc = 0;
00325   recompute = 0;
00326 
00327   /*
00328    * Parse command line options.
00329    */
00330   util_getopt_reset();
00331   while ((c = util_getopt(argc, argv, "d:fg:hir:s:t:v:A:DF")) != EOF) {
00332     switch(c) {
00333       case 'd':
00334         depthValue = atoi(util_optarg);
00335         break;
00336       case 'f':
00337         shellFlag = 1;
00338         break;
00339       case 'g':
00340           guideFile = Cmd_FileOpen(util_optarg, "r", NIL(char *), 0);
00341           if (guideFile == NIL(FILE)) {
00342             fprintf(vis_stdout,
00343                     "** rch error: Guide file cannot be read. Check permissions and path\n");
00344             goto usage;
00345           }
00346           break;  
00347       case 'h':
00348         goto usage;
00349       case 'i':
00350         incrementalFlag = 1;
00351         break;
00352       case 'r':
00353         reorderFlag = 1;
00354         reorderThreshold = atoi(util_optarg);
00355         break;
00356       case 's':
00357         printStep = atoi(util_optarg);
00358         break;
00359       case 't':
00360         timeOutPeriod = atoi(util_optarg);
00361         break;
00362       case 'v':
00363         verbosityLevel = atoi(util_optarg);
00364         break;
00365       case 'A' :
00366         approxFlag = atoi(util_optarg);
00367         if ((approxFlag > 2) || (approxFlag < 0)) {
00368             goto usage;
00369         }
00370         break;
00371       case 'D':
00372         ardc = 1;
00373         break;
00374       case 'F':
00375         recompute = 1;
00376         break;
00377       default:
00378         goto usage;
00379     }
00380   }
00381   if (c == EOF && argc != util_optind)
00382     goto usage;
00383   
00384   imgMethod = Img_UserSpecifiedMethod(); 
00385     
00386   if ((approxFlag == 1) && (bdd_get_package_name() != CUDD)) {
00387     fprintf(vis_stderr, "** rch error: compute_reach with -A 1 option is currently supported only by CUDD.\n");
00388     return 1;
00389   }
00390 
00391   if (fsm == NIL(Fsm_Fsm_t)) {
00392     return 1;
00393   }
00394 
00395   if (incrementalFlag && approxFlag) {
00396       fprintf(vis_stdout,
00397               "** rch error: Incremental flag and approx flag are incompatible.\n");
00398       goto usage;
00399   }
00400   if (incrementalFlag && ardc) {
00401       fprintf(vis_stdout,
00402               "** rch error: The -i and -D flags are incompatible.\n");
00403       goto usage;
00404   }
00405 
00406   if (depthValue && approxFlag == 2) {
00407     fprintf(vis_stdout,
00408             "** rch error: Depth value and over-approx flag are incompatible.\n");
00409     goto usage;
00410   }
00411   
00412   if (shellFlag && approxFlag == 2) {
00413     fprintf(vis_stdout,
00414             "** rch error: Shell flag and over-approx flag are incompatible.\n");
00415     goto usage;
00416   }
00417   
00418   if (guideFile != NIL(FILE)){
00419     if(incrementalFlag) {
00420       fprintf(vis_stdout, "** rch error: Guided search is not compatible with the -i flag\n");
00421       goto usage;
00422     }
00423     if(approxFlag == 2){
00424       fprintf(vis_stdout, "** rch error: Guided search is not compatible with Over-approx flag\n");
00425       goto usage;
00426     }
00427     if(imgMethod != Img_Iwls95_c && imgMethod != Img_Monolithic_c &&
00428        imgMethod != Img_Mlp_c){
00429       fprintf(vis_stdout, "** rch error: Guided search can only be performed\n");
00430       fprintf(vis_stdout, "with IWLS95, MLP, or Monolithic image methods.\n");
00431     goto usage;
00432     }
00433   }/* if guided search requested */
00434   
00435   /* Start the timeOut timer. */
00436   if (timeOutPeriod > 0){
00437     (void) signal(SIGALRM, (void(*)(int))TimeOutHandle);
00438     (void) alarm(timeOutPeriod);
00439     if (setjmp(timeOutEnv) > 0) {
00440       (void) fprintf(vis_stdout, "** rch info: Timeout occurred after %d seconds.\n",
00441                      timeOutPeriod);
00442       (void) fprintf(vis_stdout, "** rch warning: The time out may have "
00443                      "corrupted the data.\n");
00444      alarm(0);
00445       return 1;
00446     }
00447   }
00448 
00449   /* Make sure that the initial states can be computed without a problem. */
00450   error_init();
00451   initialStates = Fsm_FsmComputeInitialStates(fsm);
00452   if (initialStates == NIL(mdd_t)) {
00453     (void) fprintf(vis_stderr, "** rch error: Latch initialization function depends on another latch:\n");
00454     (void) fprintf(vis_stderr, "%s", error_string());
00455     (void) fprintf(vis_stderr, "\n");
00456     (void) fprintf(vis_stderr, "** rch error: Initial states cannot be computed.\n");
00457     return (1);
00458   }
00459   else {
00460     mdd_free(initialStates);
00461   }
00462 
00463   /* translate approx flag */
00464   switch(approxFlag) {
00465   case 0: rchType = Fsm_Rch_Bfs_c; break;
00466   case 1: rchType = Fsm_Rch_Hd_c; break;
00467   case 2: rchType = Fsm_Rch_Oa_c; break;
00468   default: rchType = Fsm_Rch_Default_c; break;
00469   }
00470 
00471   if (guideFile != NIL(FILE)) {
00472     guideArray = Mc_ComputeGuideArray(fsm, guideFile);
00473     if(guideArray == NIL(array_t))
00474       return(1);
00475   }
00476 
00477   if (rchType == Fsm_Rch_Oa_c) {
00478     array_t     *apprReachableStates;
00479 
00480     initialTime = util_cpu_time();
00481     apprReachableStates = Fsm_FsmComputeOverApproximateReachableStates(fsm,
00482         incrementalFlag, verbosityLevel, printStep, depthValue, shellFlag,
00483         reorderFlag, reorderThreshold, recompute);
00484     finalTime = util_cpu_time();
00485 
00486     if (apprReachableStates == NIL(array_t)) {
00487       (void)fprintf(vis_stdout,
00488         "** rch error: Reachability computation failed, no rechable states\n");
00489       return 1;
00490     }
00491 
00492     if (verbosityLevel > 0)
00493       Fsm_ArdcPrintReachabilityResults(fsm, finalTime-initialTime);
00494     alarm(0);
00495     return(0);
00496   }
00497 
00498   /* Compute the reachable states. */
00499   initialTime = util_cpu_time();
00500   reachableStates = Fsm_FsmComputeReachableStates(
00501     fsm, incrementalFlag, verbosityLevel, printStep, depthValue, shellFlag,
00502     reorderFlag, reorderThreshold, rchType, ardc, recompute, NIL(array_t),
00503     (verbosityLevel > 0), guideArray);  
00504   finalTime = util_cpu_time();
00505   mdd_array_free(guideArray);
00506 
00507   if (reachableStates == NIL(mdd_t)) {
00508     (void)fprintf(vis_stdout, "** rch error: Reachability computation failed, no rechable states\n");
00509     return 1;
00510   }
00511 
00512   if (verbosityLevel > 0){
00513     if (fsm->imageInfo){ 
00514       char *methodType =
00515           Img_ImageInfoObtainMethodTypeAsString(fsm->imageInfo); 
00516       (void) fprintf(vis_stdout, "** rch info: Computing reachable states using the ");
00517       (void) fprintf(vis_stdout, "%s image computation method.\n", methodType);
00518       FREE(methodType);
00519       (void)Img_ImageInfoPrintMethodParams(fsm->imageInfo,
00520                                            vis_stdout);
00521       if (Img_ImageInfoObtainMethodType(fsm->imageInfo) == Img_Tfm_c ||
00522           Img_ImageInfoObtainMethodType(fsm->imageInfo) == Img_Hybrid_c) {
00523         Img_TfmPrintStatistics(fsm->imageInfo, Img_Forward_c);
00524       }
00525     }
00526     Fsm_FsmReachabilityPrintResults(fsm, finalTime-initialTime, approxFlag);
00527 
00528   }
00529   mdd_free(reachableStates);
00530 
00531   alarm(0);
00532   return (0);
00533 
00534   usage:
00535   (void) fprintf(vis_stderr, "usage: compute_reach [-d depthValue] [-h] [-f] [-i] [-g <hint file>][-r thresholdValue] [-s printStep] [-t timeOut] [-v #][-A #][-D][-F]\n");
00536   (void) fprintf(vis_stderr, "   -d depthValue perform reachability up to depthValue steps\n");
00537   (void) fprintf(vis_stderr, "   -f \t\t store the onion rings ateach step\n");
00538   (void) fprintf(vis_stderr, "   -h \t\t print the command usage\n");
00539   (void) fprintf(vis_stderr, "   -g filename\t perform reachability analysis with guided search using the given file. Not allowed with -A 2\n");
00540   (void) fprintf(vis_stderr, "   -i \t\t builds the transition relation incrementally (not supported with -A 1,2).\n");
00541   (void) fprintf(vis_stderr, "   -r thresholdValue invoke dynamic reordering once when the size of the reached state set reaches this value.\n");
00542   (void) fprintf(vis_stderr, "   -s printStep\t print reachability information every printStep steps (0 for no information).\n");
00543   (void) fprintf(vis_stderr, "   -t time\t time out period (in seconds)\n");
00544   (void) fprintf(vis_stderr, "   -v #\t\t verbosity level\n");
00545   (void) fprintf(vis_stderr, "   -A #\t\t 0 (default) - BFS method.\n");
00546   (void) fprintf(vis_stderr, "      #\t\t 1 - HD method.\n");
00547   (void) fprintf(vis_stderr, "      #\t\t 2 - Over-approximation by approximate traversal.\n");
00548   (void) fprintf(vis_stderr, "   -D \t\t Try to minimize transition relation with ARDCs\n");
00549   (void) fprintf(vis_stderr, "   -F \t\t force to recompute reachable states\n");
00550   return 1;
00551 }
00552 
00553 
00624 static int
00625 CommandReadFairness(
00626   Hrc_Manager_t ** hmgr,
00627   int  argc,
00628   char ** argv)
00629 {
00630   int       c;
00631   FILE      *fp;
00632   array_t   *formulaArray;
00633   Fsm_Fsm_t *fsm = Fsm_HrcManagerReadCurrentFsm(*hmgr);
00634   
00635   /*
00636    * Parse command line options.
00637    */
00638   util_getopt_reset();
00639   while ((c = util_getopt(argc, argv, "h")) != EOF) {
00640     switch(c) {
00641       case 'h':
00642         goto usage;
00643       default:
00644         goto usage;
00645     }
00646     /* NOT REACHED */
00647   }
00648 
00649   if (fsm == NIL(Fsm_Fsm_t)) {
00650     (void) fprintf(vis_stderr, "** fair error: Fairness constraint not recorded.\n");
00651     return 1;
00652   }
00653 
00654   /*
00655    * Open the fairness file.
00656    */
00657   if (argc - util_optind == 0) {
00658     (void) fprintf(vis_stderr, "** fair error: fairness file not provided\n");
00659     goto usage;
00660   }
00661   else if (argc - util_optind > 1) {
00662     (void) fprintf(vis_stderr, "** fair error: too many arguments\n");
00663     goto usage;
00664   }
00665 
00666   fp = Cmd_FileOpen(argv[util_optind], "r", NIL(char *), 0);
00667   if (fp == NIL(FILE)) {
00668     return 1;
00669   }
00670 
00671   /*
00672    * Parse the formulas in the file.
00673    */
00674   formulaArray = Ctlp_FileParseFormulaArray(fp);
00675   (void) fclose(fp);
00676 
00677   if (formulaArray == NIL(array_t)) {
00678     (void) fprintf(vis_stderr, "** fair error: error reading fairness conditions.\n");
00679     return 1;
00680   }
00681   else if (array_n(formulaArray) == 0) {
00682     (void) fprintf(vis_stderr, "** fair error: fairness file is empty.\n");
00683     (void) fprintf(vis_stderr, "** fair error: Use reset_fairness to reset the fairness constraint.");
00684     return 1;
00685   }
00686   else {
00687     int             j;
00688     Fsm_Fairness_t *fairness;
00689     Ntk_Network_t  *network = Fsm_FsmReadNetwork(fsm);
00690 
00691     /*
00692      * First check that each formula is semantically correct wrt the network.
00693      */
00694     error_init();
00695     for (j = 0; j < array_n(formulaArray); j++) {
00696       Ctlp_Formula_t *formula;
00697       boolean         status; 
00698       
00699       formula  = array_fetch(Ctlp_Formula_t *, formulaArray, j);
00700       status = Mc_FormulaStaticSemanticCheckOnNetwork(formula, network, FALSE);
00701       
00702       if (status == FALSE) {
00703         (void) fprintf(vis_stderr,
00704                        "** fair error: error reading fairness constraint "); 
00705         Ctlp_FormulaPrint(vis_stderr, formula);
00706         (void) fprintf(vis_stderr, ":\n");
00707         (void) fprintf(vis_stderr, "%s", error_string());
00708         (void) fprintf(vis_stderr, "\n");
00709         return 1;
00710       }
00711     }
00712 
00713 
00714     /*
00715      * Interpret the array of CTL formulas as a set of Buchi conditions.
00716      * Hence, create a single disjunct, consisting of k conjuncts, where k is
00717      * the number of CTL formulas read in.  The jth conjunct has the jth
00718      * formula as its finallyInf component, and NULL as its globallyInf
00719      * component.
00720      */
00721     fairness = FsmFairnessAlloc(fsm);    
00722     for (j = 0; j < array_n(formulaArray); j++) {
00723       Ctlp_Formula_t *formula = array_fetch(Ctlp_Formula_t *, formulaArray, j);
00724 
00725       FsmFairnessAddConjunct(fairness, formula, NIL(Ctlp_Formula_t), 0, j);
00726     }
00727     array_free(formulaArray); /* Don't free the formulas themselves. */
00728 
00729     /*
00730      * Remove any existing fairnessInfo associated with the FSM, and update
00731      * the fairnessInfo.constraint with the new fairness just read.
00732      */
00733     FsmFsmFairnessInfoUpdate(fsm, NIL(mdd_t), fairness, NIL(array_t));
00734 
00735     return 0;
00736   }
00737 
00738   usage:
00739   (void) fprintf(vis_stderr, "usage: read_fairness [-h] file\n");
00740   (void) fprintf(vis_stderr, "   -h    print the command usage\n");
00741   (void) fprintf(vis_stderr, "   file  file containing the list of conditions\n");
00742   return 1;
00743 }
00744 
00745 
00776 static int
00777 CommandResetFairness(
00778   Hrc_Manager_t ** hmgr,
00779   int  argc,
00780   char ** argv)
00781 {
00782   int       c;
00783   Fsm_Fsm_t *fsm = Fsm_HrcManagerReadCurrentFsm(*hmgr);
00784 
00785   /*
00786    * Parse command line options.
00787    */
00788   util_getopt_reset();
00789   while ((c = util_getopt(argc, argv, "h")) != EOF) {
00790     switch(c) {
00791       case 'h':
00792         goto usage;
00793       default:
00794         goto usage;
00795     }
00796     /* NOT REACHED */
00797   }
00798 
00799   if (fsm == NIL(Fsm_Fsm_t)) {
00800     return 1;
00801   }
00802 
00803   /*
00804    * Remove any existing fairnessInfo associated with the FSM, and add back
00805    * the default constraint.
00806    */
00807   FsmFsmFairnessInfoUpdate(fsm, NIL(mdd_t), NIL(Fsm_Fairness_t), NIL(array_t));
00808   fsm->fairnessInfo.constraint = FsmFsmCreateDefaultFairnessConstraint(fsm);
00809 
00810   return 0;
00811 
00812 
00813   usage:
00814   (void) fprintf(vis_stderr, "usage: reset_fairness [-h]\n");
00815   (void) fprintf(vis_stderr, "   -h  print the command usage\n");
00816   return 1;
00817 }
00818 
00819 
00852 static int
00853 CommandPrintFairness(
00854   Hrc_Manager_t ** hmgr,
00855   int  argc,
00856   char ** argv)
00857 {
00858   int            c;
00859   Fsm_Fairness_t *constraint;
00860   int             numDisjuncts;
00861   Fsm_Fsm_t      *fsm = Fsm_HrcManagerReadCurrentFsm(*hmgr);
00862 
00863   /*
00864    * Parse command line options.
00865    */
00866   util_getopt_reset();
00867   while ((c = util_getopt(argc, argv, "h")) != EOF) {
00868     switch(c) {
00869       case 'h':
00870         goto usage;
00871       default:
00872         goto usage;
00873     }
00874     /* NOT REACHED */
00875   }
00876 
00877   if (fsm == NIL(Fsm_Fsm_t)) {
00878     return 1;
00879   }
00880 
00881   /*
00882    * Print the fairness constraint.  It is assumed that there is at least one
00883    * disjunct present.  Currently, only Buchi constraints can be printed out.
00884    */
00885   constraint = Fsm_FsmReadFairnessConstraint(fsm);
00886   assert(constraint != NIL(Fsm_Fairness_t));
00887   numDisjuncts = Fsm_FairnessReadNumDisjuncts(constraint);
00888   assert(numDisjuncts != 0);
00889 
00890   if (numDisjuncts > 1) {
00891     (void) fprintf(vis_stdout, "Fairness constraint not Buchi...");
00892     (void) fprintf(vis_stdout, "don't know how to print.\n");
00893   }
00894   else {
00895     int i;
00896     int numConjuncts = Fsm_FairnessReadNumConjunctsOfDisjunct(constraint, 0);
00897 
00898     (void) fprintf(vis_stdout, "Fairness constraint:\n");
00899     for (i = 0; i < numConjuncts; i++) {
00900       if (Fsm_FairnessReadGloballyInfFormula(constraint, 0, i) !=
00901           NIL(Ctlp_Formula_t)) {
00902         (void) fprintf(vis_stdout, "Fairness constraint not Buchi...");
00903         (void) fprintf(vis_stdout, "don't know how to print.\n");
00904       }
00905         
00906       Ctlp_FormulaPrint(vis_stdout,
00907                         Fsm_FairnessReadFinallyInfFormula(constraint, 0, i));
00908       (void) fprintf(vis_stdout, ";\n");
00909     }
00910   }
00911 
00912   return 0;
00913 
00914   usage:
00915   (void) fprintf(vis_stderr, "usage: print_fairness [-h]\n");
00916   (void) fprintf(vis_stderr, "   -h  print the command usage\n");
00917   return 1;
00918 }
00919 
00920 
00959 static int
00960 CommandPrintImageInfo(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
00961 {
00962   int c;
00963   Img_ImageInfo_t *imageInfo;
00964   Fsm_Fsm_t       *fsm = Fsm_HrcManagerReadCurrentFsm(*hmgr);
00965   int bwdImgFlag = 0;
00966   int fwdImgFlag = 0;
00967 
00968   util_getopt_reset();
00969   while ((c = util_getopt(argc, argv, "bfh")) != EOF) {
00970     switch(c) {
00971       case 'b':
00972         bwdImgFlag = 1;
00973         break;
00974       case 'f':
00975         fwdImgFlag = 1;
00976         break;
00977       case 'h':
00978         goto usage;
00979       default:
00980         goto usage;
00981     }
00982   }
00983 
00984   if (fsm == NIL(Fsm_Fsm_t)) {
00985     return 1;
00986   }
00987 
00988   if (!(bwdImgFlag || fwdImgFlag)){
00989     fwdImgFlag = 1;
00990   }
00991 
00992   imageInfo = Fsm_FsmReadOrCreateImageInfo(fsm, bwdImgFlag, fwdImgFlag);
00993   Img_ImageInfoPrintMethodParams(imageInfo, vis_stdout);
00994   return 0;
00995 
00996 usage:
00997   (void) fprintf(vis_stderr,"usage: print_image_method [-b] [-f] [-h]\n");
00998   (void) fprintf(vis_stderr, "  -b  create the backward transition relation\n");
00999   (void) fprintf(vis_stderr, "  -f  create the forward transition relation\n");
01000   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
01001   return 1;
01002 }
01003 
01178 static int
01179 CommandPrintHdOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
01180 {
01181   int c;
01182 
01183   if (*hmgr == NULL) {
01184     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
01185     return 1;
01186   }
01187 
01188   util_getopt_reset();
01189   while ((c = util_getopt(argc, argv, "h")) != EOF) {
01190     switch(c) {
01191       case 'h':
01192         goto usage;
01193       default:
01194         goto usage;
01195     }
01196      /* NOT REACHED */
01197  }
01198 
01199   /* print hd options */
01200   FsmHdPrintOptions();
01201   return 0;
01202 
01203 usage:
01204   (void) fprintf(vis_stderr,"usage: print_hd_options [-h]\n");
01205   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
01206   return 1;
01207 } /* end of CommandPrintHdOptions */
01208 
01209 
01472 static int
01473 CommandPrintArdcOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
01474 {
01475   int c;
01476 
01477   if (*hmgr == NULL) {
01478     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
01479     return 1;
01480   }
01481 
01482   util_getopt_reset();
01483   while ((c = util_getopt(argc, argv, "hH")) != EOF) {
01484     switch(c) {
01485       case 'h':
01486         goto usage;
01487       case 'H':
01488         goto usage_ardc;
01489       default:
01490         goto usage;
01491     }
01492     /* NOT REACHED */
01493   }
01494 
01495   /* print ARDC options */
01496   FsmArdcPrintOptions();
01497   return 0;
01498 
01499 usage:
01500   (void) fprintf(vis_stderr,"usage: print_ardc_options [-h] [-H]\n");
01501   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
01502   (void) fprintf(vis_stderr, "  -H  print the ARDC set command usage\n");
01503   return 1;
01504 usage_ardc:
01505   (void) fprintf(vis_stderr, "   set ardc_traversal_method <m>\n");
01506   (void) fprintf(vis_stderr, "       m = 0 : MBM (machine by machine)\n");
01507   (void) fprintf(vis_stderr, "       m = 1 : RFBF(reached frame by frame)\n");
01508   (void) fprintf(vis_stderr, "       m = 2 : TFBF(to frame by frame)\n");
01509   (void) fprintf(vis_stderr, "       m = 3 : TMBM(TFBF + MBM)\n");
01510   (void) fprintf(vis_stderr, "       m = 4 : LMBM(least fixpoint MBM, default)\n");
01511   (void) fprintf(vis_stderr, "       m = 5 : TLMBM(TFBF + LMBM)\n");
01512   (void) fprintf(vis_stderr, "   set ardc_group_size <n>\n");
01513   (void) fprintf(vis_stderr, "       n (default = 8)\n");
01514   (void) fprintf(vis_stderr, "   set ardc_affinity_factor <f>\n");
01515   (void) fprintf(vis_stderr, "       f = 0.0 - 1.0 (default = 0.5)\n");
01516   (void) fprintf(vis_stderr, "   set ardc_max_iteration <n>\n");
01517   (void) fprintf(vis_stderr, "       n (default = 0(infinity))\n");
01518   (void) fprintf(vis_stderr, "   set ardc_constrain_target <m>\n");
01519   (void) fprintf(vis_stderr, "       m = 0 : constrain transition relation (default)\n");
01520   (void) fprintf(vis_stderr, "       m = 1 : constrain initial states\n");
01521   (void) fprintf(vis_stderr, "       m = 2 : constrain both\n");
01522   (void) fprintf(vis_stderr, "   set ardc_constrain_method <m>\n");
01523   (void) fprintf(vis_stderr, "       m = 0 : restrict (default)\n");
01524   (void) fprintf(vis_stderr, "       m = 1 : constrain\n");
01525   (void) fprintf(vis_stderr,
01526                  "       m = 2 : compact (currently supported by only CUDD)\n");
01527   (void) fprintf(vis_stderr,
01528                  "       m = 3 : squeeze (currently supported by only CUDD)\n");
01529   (void) fprintf(vis_stderr, "   set ardc_constrain_reorder <m>\n");
01530   (void) fprintf(vis_stderr, "       m = yes : allow variable reorderings during consecutive\n");
01531   (void) fprintf(vis_stderr, "                 image constraining operations (default)\n");
01532   (void) fprintf(vis_stderr, "       m = no  : don't allow variable reorderings during consecutive\n");
01533   (void) fprintf(vis_stderr, "                 image constraining operations\n");
01534   (void) fprintf(vis_stderr, "   set ardc_abstract_pseudo_input <m>\n");
01535   (void) fprintf(vis_stderr, "       m = 0 : do not abstract pseudo input variables\n");
01536   (void) fprintf(vis_stderr, "       m = 1 : abstract pseudo inputs before image computation (default)\n");
01537   (void) fprintf(vis_stderr, "       m = 2 : abstract pseudo inputs at every end of image computation\n");
01538   (void) fprintf(vis_stderr, "       m = 3 : abstract pseudo inputs at the end of approximate traversal\n");
01539   (void) fprintf(vis_stderr, "   set ardc_decompose_flag <m>\n");
01540   (void) fprintf(vis_stderr, "       m = yes : keep decomposed reachable stateses (default)\n");
01541   (void) fprintf(vis_stderr, "       m = no  : make a conjunction of reachable states of all submachines\n");
01542   (void) fprintf(vis_stderr, "   set ardc_projected_initial_flag <m>\n");
01543   (void) fprintf(vis_stderr, "       m = yes : use projected initial states for submachine (default)\n");
01544   (void) fprintf(vis_stderr, "       m = no  : use original initial states for submachine\n");
01545   (void) fprintf(vis_stderr, "   set ardc_image_method <m>\n");
01546   (void) fprintf(vis_stderr, "       m = monolithic : use monolithic image computation for submachines\n");
01547   (void) fprintf(vis_stderr, "       m = iwls95     : use iwls95 image computation for submachines (default)\n");
01548   (void) fprintf(vis_stderr, "       m = mlp        : use mlp image computation for submachines\n");
01549   (void) fprintf(vis_stderr, "       m = tfm        : use tfm image computation for submachines\n");
01550   (void) fprintf(vis_stderr, "       m = hybrid     : use hybrid image computation for submachines\n");
01551   (void) fprintf(vis_stderr, "   set ardc_use_high_density <m>\n");
01552   (void) fprintf(vis_stderr, "       m = yes : use High Density for reachable states of submachines\n");
01553   (void) fprintf(vis_stderr, "       m = no  : use BFS for reachable states of submachines (default)\n");
01554   (void) fprintf(vis_stderr, "   set ardc_create_pseudo_var_mode <m>\n");
01555   (void) fprintf(vis_stderr, "       m = 0 : makes pseudo input variables with exact support (default)\n");
01556   (void) fprintf(vis_stderr, "       m = 1 : makes pseudo input variables from all state variables of\n");
01557   (void) fprintf(vis_stderr, "               the other machines\n");
01558   (void) fprintf(vis_stderr, "       m = 2 : makes pseudo input variables from all state variables of\n");
01559   (void) fprintf(vis_stderr, "               fanin machines\n");
01560   (void) fprintf(vis_stderr, "   set ardc_reorder_ptr <m>\n");
01561   (void) fprintf(vis_stderr, "       m = yes : whenever partitioned transition relation changes,\n");
01562   (void) fprintf(vis_stderr, "                 reorders partitioned transition relation\n");
01563   (void) fprintf(vis_stderr, "       m = no  : no reordering of partitioned transition relation (default)\n");
01564   (void) fprintf(vis_stderr, "   set ardc_fanin_constrain_mode <m>\n");
01565   (void) fprintf(vis_stderr, "       m = 0 : constrains w.r.t. the reachable states of fanin machines\n");
01566   (void) fprintf(vis_stderr, "               (default)\n");
01567   (void) fprintf(vis_stderr, "       m = 1 : constrains w.r.t. the reachable states of both fanin machines\n");
01568   (void) fprintf(vis_stderr, "               and itself\n");
01569   (void) fprintf(vis_stderr, "   set ardc_lmbm_initial_mode <m>\n");
01570   (void) fprintf(vis_stderr, "       m = 0 : use given initial states all the time\n");
01571   (void) fprintf(vis_stderr, "       m = 1 : use current reached states as initial states (default)\n");
01572   (void) fprintf(vis_stderr, "       m = 2 : use current frontier as initial states\n");
01573   (void) fprintf(vis_stderr, "   set ardc_mbm_reuse_tr <m>\n");
01574   (void) fprintf(vis_stderr, "       m = yes : use constrained transition relation for next iteration\n");
01575   (void) fprintf(vis_stderr, "       m = no  : use original transition relation for next iteration (default)\n");
01576   (void) fprintf(vis_stderr, "   set ardc_read_group <filename>\n");
01577   (void) fprintf(vis_stderr, "       <filename> file containing grouping information\n");
01578   (void) fprintf(vis_stderr, "   set ardc_write_group <filename>\n");
01579   (void) fprintf(vis_stderr, "       <filename> file to write grouping information\n");
01580   (void) fprintf(vis_stderr, "   set ardc_verbosity <n>\n");
01581   (void) fprintf(vis_stderr, "       n = 0 - 3 (default = 0)\n");
01582   return 1;
01583 } /* end of CommandPrintArdcOptions */
01584 
01585 
01906 static int
01907 CommandPrintTfmOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
01908 {
01909   int c;
01910 
01911   if (*hmgr == NULL) {
01912     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
01913     return 1;
01914   }
01915 
01916   util_getopt_reset();
01917   while ((c = util_getopt(argc, argv, "hH")) != EOF) {
01918     switch(c) {
01919       case 'h':
01920         goto usage;
01921       case 'H':
01922         goto usage_tfm;
01923       default:
01924         goto usage;
01925     }
01926      /* NOT REACHED */
01927  }
01928 
01929   /* print transition function based image computation options */
01930   Img_PrintTfmOptions();
01931   return 0;
01932 
01933 usage:
01934   (void) fprintf(vis_stderr,"usage: print_tfm_options [-h] [-H]\n");
01935   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
01936   (void) fprintf(vis_stderr, "  -H  print the transition function based ");
01937   (void) fprintf(vis_stderr, "image computation set command usage\n");
01938   return 1;
01939 usage_tfm:
01940   (void) fprintf(vis_stderr, "   set tfm_split_method <m>\n");
01941   (void) fprintf(vis_stderr, "       m = 0 : input splitting (default)\n");
01942   (void) fprintf(vis_stderr, "       m = 1 : output splitting\n");
01943   (void) fprintf(vis_stderr, "       m = 2 : mixed (input split + output split)\n");
01944   (void) fprintf(vis_stderr, "   set tfm_input_split <m>\n");
01945   (void) fprintf(vis_stderr, "       m = 0 : support before splitting (default)\n");
01946   (void) fprintf(vis_stderr, "       m = 1 : support after splitting\n");
01947   (void) fprintf(vis_stderr, "       m = 2 : estimate BDD size after splitting\n");
01948   (void) fprintf(vis_stderr, "       m = 3 : top variable\n");
01949   (void) fprintf(vis_stderr, "   set tfm_pi_split_flag <m>\n");
01950   (void) fprintf(vis_stderr, "       m = yes : choose either state or input variable as splitting variable\n");
01951   (void) fprintf(vis_stderr, "                 (default)\n");
01952   (void) fprintf(vis_stderr, "       m = no  : choose only state variable as splitting variable\n");
01953   (void) fprintf(vis_stderr, "   set tfm_range_comp <m>\n");
01954   (void) fprintf(vis_stderr, "       m = 0 : do not convert to range computation\n");
01955   (void) fprintf(vis_stderr, "       m = 1 : convert image to range computation (default)\n");
01956   (void) fprintf(vis_stderr, "       m = 2 : use a threshold (tfm_range_threshold, default for hybrid)\n");
01957   (void) fprintf(vis_stderr, "   set tfm_range_threshold <n>\n");
01958   (void) fprintf(vis_stderr, "       n (default = 10)\n");
01959   (void) fprintf(vis_stderr, "   set tfm_range_try_threshold <n>\n");
01960   (void) fprintf(vis_stderr, "       n (default = 2)\n");
01961   (void) fprintf(vis_stderr, "   set tfm_range_check_reorder <m>\n");
01962   (void) fprintf(vis_stderr, "       m = yes : force to reorder before checking tfm_range_threshold\n");
01963   (void) fprintf(vis_stderr, "       m = no  : do not reorder (default)\n");
01964   (void) fprintf(vis_stderr, "   set tfm_tie_break_mode <m>\n");
01965   (void) fprintf(vis_stderr, "       m = 0 : the closest variable to top (default)\n");
01966   (void) fprintf(vis_stderr, "       m = 1 : the smallest BDD size after splitting\n");
01967   (void) fprintf(vis_stderr, "   set tfm_output_split <m>\n");
01968   (void) fprintf(vis_stderr, "       m = 0 : smallest BDD size (default)\n");
01969   (void) fprintf(vis_stderr, "       m = 1 : largest BDD size\n");
01970   (void) fprintf(vis_stderr, "       m = 2 : top variable\n");
01971   (void) fprintf(vis_stderr, "   set tfm_turn_depth <n>\n");
01972   (void) fprintf(vis_stderr, "       n (default = 5, -1 for hybrid)\n");
01973   (void) fprintf(vis_stderr, "   set tfm_find_decomp_var <m>\n");
01974   (void) fprintf(vis_stderr, "       m = yes : try to find a decomposable variable (articulation point)\n");
01975   (void) fprintf(vis_stderr, "       m = no  : do not try (default)\n");
01976   (void) fprintf(vis_stderr, "   set tfm_sort_vector_flag <m>\n");
01977   (void) fprintf(vis_stderr, "       m = yes : sort function vectors to utilize cache (default for tfm)\n");
01978   (void) fprintf(vis_stderr, "       m = no  : do not sort (default for hybrid)\n");
01979   (void) fprintf(vis_stderr, "   set tfm_print_stats <m>\n");
01980   (void) fprintf(vis_stderr, "       m = yes : print statistics for cache and recursions\n");
01981   (void) fprintf(vis_stderr, "       m = no  : do not print (default)\n");
01982   (void) fprintf(vis_stderr, "   set tfm_print_bdd_size <m>\n");
01983   (void) fprintf(vis_stderr, "       m = yes : print BDD size of all intermediate product\n");
01984   (void) fprintf(vis_stderr, "       m = no  : do not print (default)\n");
01985   (void) fprintf(vis_stderr, "   set tfm_split_cube_func <m>\n");
01986   (void) fprintf(vis_stderr, "       m = yes : find a cube function element,\n");
01987   (void) fprintf(vis_stderr, "                 then apply output splitting in input splitting\n");
01988   (void) fprintf(vis_stderr, "       m = no  : do not try (default)\n");
01989   (void) fprintf(vis_stderr, "   set tfm_find_essential <m>\n");
01990   (void) fprintf(vis_stderr, "       m = 0 : do not try (default)\n");
01991   (void) fprintf(vis_stderr, "       m = 1 : try to find essential variables\n");
01992   (void) fprintf(vis_stderr, "       m = 2 : on and off dynamically\n");
01993   (void) fprintf(vis_stderr, "   set tfm_print_essential <m>\n");
01994   (void) fprintf(vis_stderr, "       m = 0 : do not print (default)\n");
01995   (void) fprintf(vis_stderr, "       m = 1 : print only at end\n");
01996   (void) fprintf(vis_stderr, "       m = 2 : print at every image computation\n");
01997   (void) fprintf(vis_stderr, "   set tfm_use_cache <m>\n");
01998   (void) fprintf(vis_stderr, "       m = 0 : do not use cache (default for hybrid)\n");
01999   (void) fprintf(vis_stderr, "       m = 1 : use cache (default)\n");
02000   (void) fprintf(vis_stderr, "       m = 2 : store all intermediate results\n");
02001   (void) fprintf(vis_stderr, "   set tfm_global_cache <m>\n");
02002   (void) fprintf(vis_stderr, "       m = yes : use only one global cache (default)\n");
02003   (void) fprintf(vis_stderr, "       m = no  : use one cache per machine\n");
02004   (void) fprintf(vis_stderr, "   set tfm_max_chain_length <n>\n");
02005   (void) fprintf(vis_stderr, "       n (default = 2)\n");
02006   (void) fprintf(vis_stderr, "   set tfm_init_cache_size <n>\n");
02007   (void) fprintf(vis_stderr, "       n (default = 1001)\n");
02008   (void) fprintf(vis_stderr, "   set tfm_auto_flush_cache <m>\n");
02009   (void) fprintf(vis_stderr, "       m = 0 : flush cache only when requested\n");
02010   (void) fprintf(vis_stderr, "       m = 1 : flush cache at the end of image computation (default)\n");
02011   (void) fprintf(vis_stderr, "       m = 2 : flush cache before reordering\n");
02012   (void) fprintf(vis_stderr, "   set tfm_compose_intermediate_vars <m>\n");
02013   (void) fprintf(vis_stderr, "       m = yes : compose all intermediate vars\n");
02014   (void) fprintf(vis_stderr, "       m = no  : do not compose (default)\n");
02015   (void) fprintf(vis_stderr, "   set tfm_pre_split_method <m>\n");
02016   (void) fprintf(vis_stderr, "       m = 0 : input splitting (domain cofactoring, default)\n");
02017   (void) fprintf(vis_stderr, "       m = 1 : output splitting (constraint cofactoring)\n");
02018   (void) fprintf(vis_stderr, "       m = 2 : mixed (input split + output split)\n");
02019   (void) fprintf(vis_stderr, "       m = 3 : substitution\n");
02020   (void) fprintf(vis_stderr, "   set tfm_pre_input_split <m>\n");
02021   (void) fprintf(vis_stderr, "       m = 0 : support before splitting (default)\n");
02022   (void) fprintf(vis_stderr, "       m = 1 : support after splitting\n");
02023   (void) fprintf(vis_stderr, "       m = 2 : estimate BDD size after splitting\n");
02024   (void) fprintf(vis_stderr, "       m = 3 : top variable\n");
02025   (void) fprintf(vis_stderr, "   set tfm_pre_output_split <m>\n");
02026   (void) fprintf(vis_stderr, "       m = 0 : smallest BDD size (default)\n");
02027   (void) fprintf(vis_stderr, "       m = 1 : largest BDD size\n");
02028   (void) fprintf(vis_stderr, "       m = 2 : top variable\n");
02029   (void) fprintf(vis_stderr, "   set tfm_pre_dc_leaf_method <m>\n");
02030   (void) fprintf(vis_stderr, "       m = 0 : substitution (default)\n");
02031   (void) fprintf(vis_stderr, "       m = 1 : constraint cofactoring\n");
02032   (void) fprintf(vis_stderr, "       m = 2 : hybrid\n");
02033   (void) fprintf(vis_stderr, "   set tfm_pre_minimize <m>\n");
02034   (void) fprintf(vis_stderr, "       m = yes : minimize function vector w.r.t. a chosen function\n");
02035   (void) fprintf(vis_stderr, "                 in constraint cofactoring\n");
02036   (void) fprintf(vis_stderr, "       m = no  : do not minimize (default)\n");
02037   (void) fprintf(vis_stderr, "   set tfm_verbosity <n>\n");
02038   (void) fprintf(vis_stderr, "       n = 0 - 2 (default = 0)\n");
02039   return 1;
02040 } /* end of CommandPrintTfmOptions */
02041 
02042 
02343 static int
02344 CommandPrintHybridOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
02345 {
02346   int c;
02347 
02348   if (*hmgr == NULL) {
02349     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
02350     return 1;
02351   }
02352 
02353   util_getopt_reset();
02354   while ((c = util_getopt(argc, argv, "hH")) != EOF) {
02355     switch(c) {
02356       case 'h':
02357         goto usage;
02358       case 'H':
02359         goto usage_hybrid;
02360       default:
02361         goto usage;
02362     }
02363   }
02364 
02365   /* print hybrid image computation options */
02366   Img_PrintHybridOptions();
02367   return 0;
02368 
02369 usage:
02370   (void) fprintf(vis_stderr,"usage: print_hybrid_options [-h] [-H]\n");
02371   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
02372   (void) fprintf(vis_stderr,
02373                 "  -H  print the hybrid image computation set command usage\n");
02374   return 1;
02375 usage_hybrid:
02376   (void) fprintf(vis_stderr, "   set hybrid_mode <m>\n");
02377   (void) fprintf(vis_stderr, "       m = 0 : start with only transition function\n");
02378   (void) fprintf(vis_stderr, "       m = 1 : start with both transition function and relation at the beginning (default)\n");
02379   (void) fprintf(vis_stderr, "       m = 2 : start with only transition relation\n");
02380   (void) fprintf(vis_stderr, "   set hybrid_tr_split_method <m>\n");
02381   (void) fprintf(vis_stderr, "       m = 0 : use support (default)\n");
02382   (void) fprintf(vis_stderr, "       m = 1 : use estimate BDD size\n");
02383   (void) fprintf(vis_stderr, "   set hybrid_build_partial_tr <m>\n");
02384   (void) fprintf(vis_stderr, "       m = yes : build partial transition relation\n");
02385   (void) fprintf(vis_stderr, "       m = no  : build full transition relation (default)\n");
02386   (void) fprintf(vis_stderr, "   set hybrid_partial_num_vars <n>\n");
02387   (void) fprintf(vis_stderr, "       n (default = 8)\n");
02388   (void) fprintf(vis_stderr, "   set hybrid_partial_method <m>\n");
02389   (void) fprintf(vis_stderr, "       m = 0 : use BDD size (default)\n");
02390   (void) fprintf(vis_stderr, "       m = 1 : use support\n");
02391   (void) fprintf(vis_stderr, "   set hybrid_delayed_split <m>\n");
02392   (void) fprintf(vis_stderr, "       m = yes : apply splitting to transition relation at once\n");
02393   (void) fprintf(vis_stderr, "       m = no  : do not apply (default)\n");
02394   (void) fprintf(vis_stderr, "   set hybrid_split_min_depth <n>\n");
02395   (void) fprintf(vis_stderr, "       n (default = 1)\n");
02396   (void) fprintf(vis_stderr, "   set hybrid_split_max_depth <n>\n");
02397   (void) fprintf(vis_stderr, "       n (default = 5)\n");
02398   (void) fprintf(vis_stderr, "   set hybrid_pre_split_min_depth <n>\n");
02399   (void) fprintf(vis_stderr, "       n (default = 0)\n");
02400   (void) fprintf(vis_stderr, "   set hybrid_pre_split_max_depth <n>\n");
02401   (void) fprintf(vis_stderr, "       n (default = 4)\n");
02402   (void) fprintf(vis_stderr, "   set hybrid_lambda_threshold <f>\n");
02403   (void) fprintf(vis_stderr, "       f (default = 0.6)\n");
02404   (void) fprintf(vis_stderr, "   set hybrid_pre_lambda_threshold <f>\n");
02405   (void) fprintf(vis_stderr, "       f (default = 0.65)\n");
02406   (void) fprintf(vis_stderr, "   set hybrid_conjoin_vector_size <n>\n");
02407   (void) fprintf(vis_stderr, "       n (default = 10)\n");
02408   (void) fprintf(vis_stderr, "   set hybrid_conjoin_relation_size <n>\n");
02409   (void) fprintf(vis_stderr, "       n (default = 2)\n");
02410   (void) fprintf(vis_stderr, "   set hybrid_conjoin_relation_bdd_size <n>\n");
02411   (void) fprintf(vis_stderr, "       n (default = 200)\n");
02412   (void) fprintf(vis_stderr, "   set hybrid_improve_lambda <f>\n");
02413   (void) fprintf(vis_stderr, "       f (default = 0.1)\n");
02414   (void) fprintf(vis_stderr, "   set hybrid_improve_vector_size <n>\n");
02415   (void) fprintf(vis_stderr, "       n (default = 3)\n");
02416   (void) fprintf(vis_stderr, "   set hybrid_improve_vector_bdd_size <f>\n");
02417   (void) fprintf(vis_stderr, "       f (default = 30.0)\n");
02418   (void) fprintf(vis_stderr, "   set hybrid_decide_mode <m>\n");
02419   (void) fprintf(vis_stderr, "       m = 0 : use only lambda\n");
02420   (void) fprintf(vis_stderr, "       m = 1 : use lambda and special checks\n");
02421   (void) fprintf(vis_stderr, "       m = 2 : use lambda and improvement\n");
02422   (void) fprintf(vis_stderr, "       m = 3 : use all (default)\n");
02423   (void) fprintf(vis_stderr, "   set hybrid_reorder_with_from <m>\n");
02424   (void) fprintf(vis_stderr, "       m = yes : include from set in reordering relation array (default)\n");
02425   (void) fprintf(vis_stderr, "       m = no  : do not include\n");
02426   (void) fprintf(vis_stderr, "   set hybrid_pre_reorder_with_from <m>\n");
02427   (void) fprintf(vis_stderr, "       m = yes : include from set in reordering relation array\n");
02428   (void) fprintf(vis_stderr, "       m = no  : do not include (default)\n");
02429   (void) fprintf(vis_stderr, "   set hybrid_lambda_mode <m>\n");
02430   (void) fprintf(vis_stderr, "       m = 0 : total lifetime with ps/pi variables (default)\n");
02431   (void) fprintf(vis_stderr, "       m = 1 : active lifetime with ps/pi variables\n");
02432   (void) fprintf(vis_stderr, "       m = 2 : total lifetime with ps/ns/pi variables\n");
02433   (void) fprintf(vis_stderr, "   set hybrid_pre_lambda_mode <m>\n");
02434   (void) fprintf(vis_stderr, "       m = 0 : total lifetime with ns/pi variables\n");
02435   (void) fprintf(vis_stderr, "       m = 1 : active lifetime with ps/pi variables\n");
02436   (void) fprintf(vis_stderr, "       m = 2 : total lifetime with ps/ns/pi variables (default)\n");
02437   (void) fprintf(vis_stderr, "       m = 3 : total lifetime with ps/pi variables\n");
02438   (void) fprintf(vis_stderr, "   set hybrid_lambda_with_from <m>\n");
02439   (void) fprintf(vis_stderr, "       m = yes : include from set in lambda computation (default)\n");
02440   (void) fprintf(vis_stderr, "       m = no  : do not include\n");
02441   (void) fprintf(vis_stderr, "   set hybrid_lambda_with_clustering <m>\n");
02442   (void) fprintf(vis_stderr, "       m = yes : compute lambda after clustering\n");
02443   (void) fprintf(vis_stderr, "       m = no  : do not cluster (default)\n");
02444   (void) fprintf(vis_stderr, "   set hybrid_synchronize_tr <m>\n");
02445   (void) fprintf(vis_stderr, "       m = yes : rebuild transition relation whenever function vector changes\n");
02446   (void) fprintf(vis_stderr, "       m = no  : do not rebuild (default)\n");
02447   (void) fprintf(vis_stderr, "   set hybrid_img_keep_pi <m>\n");
02448   (void) fprintf(vis_stderr, "       m = yes : keep all pi variables in forward tr\n");
02449   (void) fprintf(vis_stderr, "       m = no  : quantify out local pi variables (default)\n");
02450   (void) fprintf(vis_stderr, "   set hybrid_pre_keep_pi <m>\n");
02451   (void) fprintf(vis_stderr, "       m = yes : keep all pi variables in backward tr and preimages\n");
02452   (void) fprintf(vis_stderr, "       m = no  : quantify out local pi variables (default)\n");
02453   (void) fprintf(vis_stderr, "   set hybrid_pre_canonical <m>\n");
02454   (void) fprintf(vis_stderr, "       m = yes : canonicalize the function vector for preimage\n");
02455   (void) fprintf(vis_stderr, "       m = no  : do not canonicalize (default)\n");
02456   (void) fprintf(vis_stderr, "   set hybrid_tr_method <m>\n");
02457   (void) fprintf(vis_stderr, "       m = iwls95 (default)\n");
02458   (void) fprintf(vis_stderr, "       m = mlp\n");
02459   return 1;
02460 } /* end of CommandPrintHybridOptions */
02461 
02462 
02545 static int
02546 CommandPrintMlpOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
02547 {
02548   int c;
02549 
02550   if (*hmgr == NULL) {
02551     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
02552     return 1;
02553   }
02554 
02555   util_getopt_reset();
02556   while ((c = util_getopt(argc, argv, "hH")) != EOF) {
02557     switch(c) {
02558       case 'h':
02559         goto usage;
02560       case 'H':
02561         goto usage_mlp;
02562       default:
02563         goto usage;
02564     }
02565   }
02566 
02567   /* print hybrid image computation options */
02568   Img_PrintMlpOptions();
02569   return 0;
02570 
02571 usage:
02572   (void) fprintf(vis_stderr,"usage: print_mlp_options [-h] [-H]\n");
02573   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
02574   (void) fprintf(vis_stderr,
02575                 "  -H  print the MLP image computation set command usage\n");
02576   return 1;
02577 usage_mlp:
02578   (void) fprintf(vis_stderr, "   set mlp_cluster <m>\n");
02579   (void) fprintf(vis_stderr, "       m = 0 : linear clustering\n");
02580   (void) fprintf(vis_stderr, "       m = 1 : affinity based tree clustering (default)\n");
02581   (void) fprintf(vis_stderr, "   set mlp_reorder <m>\n");
02582   (void) fprintf(vis_stderr, "       m = 0 : no reordering after clustering (default)\n");
02583   (void) fprintf(vis_stderr, "       m = 1 : reorder using MLP after clustering (inside)\n");
02584   (void) fprintf(vis_stderr, "       m = 2 : reorder using MLP after clustering (outside)\n");
02585   (void) fprintf(vis_stderr, "       m = 3 : reorder using IWLS95 after clustering\n");
02586   (void) fprintf(vis_stderr, "   set mlp_pre_reorder <m>\n");
02587   (void) fprintf(vis_stderr, "       m = 0 : no reordering after clustering (default)\n");
02588   (void) fprintf(vis_stderr, "       m = 1 : reorder using MLP after clustering (inside)\n");
02589   (void) fprintf(vis_stderr, "       m = 2 : reorder using MLP after clustering (outside)\n");
02590   (void) fprintf(vis_stderr, "       m = 3 : reorder using IWLS95 after clustering\n");
02591   (void) fprintf(vis_stderr, "   set mlp_postprocess <m>\n");
02592   (void) fprintf(vis_stderr, "       m = 0 : no postprocessing (default)\n");
02593   (void) fprintf(vis_stderr, "       m = 1 : do postprocessing after ordering\n");
02594   (void) fprintf(vis_stderr, "       m = 2 : do postprocessing after clustering or reordering\n");
02595   (void) fprintf(vis_stderr, "       m = 3 : do both 1 and 2\n");
02596   return 1;
02597 } /* end of CommandPrintMlpOptions */
02598 
02599 
02677 static int
02678 CommandPrintGuidedSearchOptions(Hrc_Manager_t ** hmgr, int  argc, char ** argv)
02679 {
02680   int c;
02681   if (*hmgr == NULL) {
02682     fprintf(vis_stderr,"** hrc error: Hierarchy manager is empty\n");
02683     return 1;
02684   }
02685 
02686   util_getopt_reset();
02687   while ((c = util_getopt(argc, argv, "h")) != EOF) {
02688     switch(c) {
02689       case 'h':
02690         goto usage;
02691       default:
02692         goto usage;
02693     }
02694      /* NOT REACHED */
02695   }
02696 
02697   FsmGuidedSearchPrintOptions();
02698   return 0;
02699  usage:
02700   (void) fprintf(vis_stderr,"usage: print_guided_search_options [-h]\n");
02701   (void) fprintf(vis_stderr, "  -h  print the command usage\n");
02702   return 1;
02703 
02704 } /* end of CommandGuidedSearchPrintOptions */
02705 
02706 
02716 static void
02717 TimeOutHandle(void)
02718 {
02719   longjmp(timeOutEnv, 1);
02720 }