/* $Id: instantiator.c,v 1.4 2001/09/13 14:13:15 bertl Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rw1.h" #include "lts.h" #include "svc.h" #include "svcerrno.h" #include #ifdef BCG #include "bcg_user.h" #endif typedef void (*INIT)(void); typedef void (*FINAL)(void); typedef void (*AFTERSTEP) (int state, int n); typedef struct { INIT init; LTScallback instep; AFTERSTEP afterstep; FINAL final; } TASK; typedef struct { ATerm *action; int *from, *depth; int nr; } BACK; static TASK *task; char *who = "Instantiator"; ATbool o_flag = ATfalse; static FILE *output = NULL; static ATermList actions = NULL; #define P(msg) fprintf(stderr,"%s\n",msg) #define BUFLEN 1024 static char filename[BUFLEN], outputfile[BUFLEN], inputfile[BUFLEN]; static BACK back = {NULL,NULL,0}; static unsigned int explored = 0, visited = 0, transitions = 0, hash = 1; static SVCbool svc_num = 0; static SVCfile svcFile[1]; static SVCparameterIndex parameterIndex = 0; static ATbool monitor = ATfalse, cadp = ATfalse; static void helpmsg(void) { P("Usage: instantiator [options] [input file]"); P(""); P("The following options can be used"); P("-help:\t\tyields this message"); P("-version:\tget the version number of this release"); P("-i:\t\ttau replaced by i (Needed for CADP)"); P("-simple:\truns an instantiator without extra features."); P("\t\tThis instantiator runs fast on \"small\" specifications"); P("\t\tinstead of a compiled rewrite system."); P("-nohash:\tno hash tables will be used"); P("-deadlock:\tonly print the deadlock states, and an account of how states"); P("\t\thave been visited. Use a .dlk file instead of a .aut file"); P("-trace [:][,[:]]*:"); P("\t\tprints the traces to each action in the list of actions."); P("\t\tIf the action is prefixed by a colon then the process halts"); P("\t\tafter printing the trace."); P("-monitor:\tMonitor function on"); P("-svc-term:\twrites transition system in SVC format"); P("-svc-num:\tsee -svc-term, either states are represented by numbers"); P("\t\t(instead of statevectors)"); #ifdef BCG P("-bcg:\t\twrites transition system in BCG format"); #endif P("-prerewr:\tThe conditions in the summands will be rewritten first"); P("-alt