/* gpgenmult.c 3/11/94. * 6/8/98 large scale reorganisation to eliminate globals, etc. * 5/2/98 change generators from type char to type `gen'. * * SYNOPSIS: * gpgenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] [-mwd maxwdiffs] * [-m maxeqns] [-ns] [-f] groupname * * Input is from groupname.wa and groupname.diff2 * (and possibly from groupname.diff1 if -c option is * called). * Output is to groupname.gm * (or possibly to groupname.diff1 if -c option is called). * * OPTIONS: * -op d/s output in dense or sparse format - sparse is default * -v verbose * -silent no diagnostics * -l/-h large/huge hash-tables (for big examples) * -c (correction) * If equations are discovered which proves the word-acceptor * to be incorrect, then the first word-difference machine * (which should be in file groupname.diff1) is updated by making * it accept these equations. * There is no point in calling this option if gpwa was run * with input from groupname.diff2, since such an equation * cannot occur in that case. * -mwd maxwdiffs * At most maxwdiffs word-differences possible. * -m maxeqns * (only relevant if -c is called) * Abort the multiplier checking process after finding maxeqns * offending words w (see above) - default is MAXEQNS * -ns Don't stop if nontrivial equation found in word-acceptor * language. * -f read the transition table repeatedly from file while mimimizing. * this avoids storing the large table, but is a little slower. * * EXIT STATUS: * If new equations are discovered, then the exit status is 2 * (whether or not the correction option was called). * Otherwise, with normal output to groupname.gm, status is 0.
*/
if (foundeqns) { /*This is the case where new equations were found. */ if (correction) { if (kbm_print_level > 1)
printf(" #Altering wd-machine to make it accept new equations.\n"); if ((rfile = fopen(inf3, "r")) == 0) {
fprintf(stderr, "Cannot open file %s.\n", inf3); exit(1);
}
fsa_read(rfile, &diff1, DENSE, 0, maxwdiffs, TRUE, fsaname);
fclose(rfile); if (fsa_table_dptr_init(&diff1) == -1) exit(1);
reduce_word = diff_reduce; if (fsa_table_dptr_init(&diff1) == -1) exit(1);
/* We need to know the inverses of generators - let's just work them out!
*/
ngens = diff1.alphabet->base->size;
rs_wd.wd_fsa = &diff2; if (calculate_inverses(&inv, ngens, &rs_wd) == -1) exit(1);
i = 0; while (eqnptr[i].lhs && i < maxeqns) { if (add_wd_fsa(&diff1, eqnptr + i, inv, FALSE, &rs_wd) == -1) exit(1);
i++;
}
if (kbm_print_level > 1)
printf(" #Word-difference machine now has %d states.\n",
diff1.states->size);
tfree(inv);
fsa_clear(&diff1);
i = 0; while (eqnptr[i].lhs && i < maxeqns) {
tfree(eqnptr[i].lhs);
tfree(eqnptr[i].rhs);
i++;
}
tfree(eqnptr);
}
fsa_clear(&diff2); exit(2);
}
if (genmultptr == 0) exit(1);
if (kbm_print_level > 1)
printf(" #Number of states of triples before minimisation = %d.\n",
genmultptr->states->size); if (readback) { if (fsa_labeled_minimize(genmultptr) == -1) exit(1);
} elseif (fsa_ip_labeled_minimize(genmultptr) == -1) exit(1); if (kbm_print_level > 1)
printf(" #Number of states of triples after minimisation = %d.\n",
genmultptr->states->size);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.