Exemplo n.º 1
0
JNIEXPORT void JNICALL Java_rwth_i2_ltl2ba4j_internal_jnibridge_BAJni_tl_1parse
(JNIEnv *env, jobject obj) {
  if (!(uform == NULL)) {
    tl_parse();
  } else {
    fprintf(stderr,"tl_parse(): arf arf!\n");
  }
}
Exemplo n.º 2
0
int
tl_main(int argc, char *argv[])
{	int i;
	extern int xspin, s_trail;

	tl_verbose = 0; /* was: tl_verbose = verbose; */
	if (xspin && s_trail)
	{	tl_clutter = 1;
		/* generating claims for a replay should
		   be done the same as when generating the
		   pan.c that produced the error-trail */
	} else
	{	tl_clutter = 1-xspin;	/* use -X -f to turn off uncluttering */
	}
	newstates  = 0;
	state_cnt  = 0;
	tl_errs    = 0;
	tl_terse   = 0;
	All_Mem = 0;
	memset(uform, 0, sizeof(uform));
	hasuform=0;
	cnt=0;
	claim_name = (char *) 0;

	ini_buchi();
	ini_cache();
	ini_rewrt();
	ini_trans();

	while (argc > 1 && argv[1][0] == '-')
	{
		switch (argv[1][1]) {
		case 'd':	newstates = 1;	/* debugging mode */
				break;
		case 'f':	argc--; argv++;
				for (i = 0; argv[1][i]; i++)
				{	if (argv[1][i] == '\t'
					||  argv[1][i] == '\"'
					||  argv[1][i] == '\n')
						argv[1][i] = ' ';
				}
				strcpy(uform, argv[1]);
				hasuform = (int) strlen(uform);
				break;
		case 'v':	tl_verbose++;
				break;
		case 'n':	tl_terse = 1;
				break;
		case 'c':	argc--; argv++;
				claim_name = (char *) emalloc(strlen(argv[1])+1);
				strcpy(claim_name, argv[1]);
				break;
		default :	printf("spin -f: saw '-%c'\n", argv[1][1]);
				goto nogood;
		}
		argc--; argv++;
	}
	if (hasuform == 0)
	{
nogood:		printf("usage:\tspin [-v] [-n] -f formula\n");
		printf("	-v verbose translation\n");
		printf("	-n normalize tl formula and exit\n");
		exit(1);
	}
	tl_balanced();

	if (tl_errs == 0)
		tl_parse();

	if (tl_verbose) tl_stats();
	return tl_errs;
}