/* fsalequal.c 30/12/98 * * Test whether the accepted languages of two fsa's are equal. * * SYNOPSIS: fsalequal [-ip d/s] [-silent] [-v] filename1 filename2\n"); * * Input is from filename1 and filename2, which should contain fsa's. * Output to stdout only. * Exit code is 0 if languages equal, otherwise 2. * Languages can only be equal when the alphabets are. * (As usual, exit code 1 denotes an error.) * * OPTIONS: * -ip d/s input in dense or sparse format - dense is default * -v verbose * -silent no diagnostics
*/
if (fsa_minimize(&fsa1) == -1) exit(1); if (fsa_bfs(&fsa1) == -1) exit(1); if (fsa_minimize(&fsa2) == -1) exit(1); if (fsa_bfs(&fsa2) == -1) exit(1);
if (fsa_equal(&fsa1, &fsa2)) { if (kbm_print_level > 0)
printf("#The languages of the automata are equal.\n");
fsa_clear(&fsa1);
fsa_clear(&fsa2); exit(0);
} else { if (kbm_print_level > 0)
printf("#The languages of the automata are NOT equal.\n");
fsa_clear(&fsa1);
fsa_clear(&fsa2); exit(2);
}
}
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 und die Messung sind noch experimentell.