/* fsaenumerate.c 16/1/95 * 25/1/99 added -s option, to print number of accept state * reached by each accepted word. * 30/12/98 added -l option, to print number of label of accept state * reached by each accepted word. * 22/12/98 - allow input/output from stdin, stdout. * 20/3/96 - added "-is n" option, to change the initial state of the fsa to * n (useful for coset reduction automata). * * Enumerates the accepted language of a fsa * * SYNOPSIS: * fsaenumerate [-is n] [-ip d/s] [-bfs/-dfs] min max [-l/-s] [filename]\n"); * * Input is from stdin or filename, which should contain a fsa. * Output is to stdout or filename.enumerate, and contains a list of the * accepted words of the finite state automaton with lengths l satisfying * min <= l <= max. * Note that the integers min and max must be specified. * * OPTIONS: * -is n change initial state of fsa to n * -ip d/s input in dense or sparse format - dense is default * -bfs/-dfs specifies listing according to breadth-first-search of * depth-first-search, resepctively. The latter is default, * and is somewhat quicker, since the bradth-first-search involves * repeated calls of the procedure, for each individual length. * -s For each accepted word printed, the number of the * accept state reached by that word in the fsa is printed as an * extra component to the word. * -l This only applies if the fsa has labeled states. * For each accepted word printed, the label number of the * accept state reached by that word in the fsa is printed as an * extra component to the word. * This is useful when generating Cayley graphs of groups from * the general multiplier.
*/
if (labels && stateno) {
fprintf(stderr, "Error: cannot use -s and -l together.\n"); exit(1);
} if (labels)
stateno = 2; if (n > testfsa.states->size) {
fprintf(stderr, "Error: specified initial state is too large.\n"); exit(1);
} if (n > 0 && testfsa.num_initial > 0) {
testfsa.initial[1] = n; /* This may destroy various properties of the automata */
testfsa.flags[MINIMIZED] = FALSE;
testfsa.flags[BFS] = FALSE;
testfsa.flags[ACCESSIBLE] = FALSE;
testfsa.flags[TRIM] = FALSE;
}
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.