diff --git a/DFA.java b/DFA.java index b4280c8..ca675e0 100644 --- a/DFA.java +++ b/DFA.java @@ -14,6 +14,18 @@ public class DFA { private boolean finalstates[]; // constructs a new DFA object from a file as per the in class specs + /* + * format of the input file: + * IntegerN - the number of terminal characters in the machine + * Terminal * N - all of the terminals separated by a space + * NumStates - number of states in the machine + * - next is NumStates * IntegerN rows of transitions + * StartState TerminalTransitionChar EndState + * NumFinalStates - number of final states + * FinalStates - the final states of the machine separated by spaces + * + * Check the minmachine.txt file for a complete minimizable example. + */ DFA ( String filename ) { BufferedReader infile = null; numstates = 0; diff --git a/minmachine.txt b/minmachine.txt new file mode 100644 index 0000000..f90ff13 --- /dev/null +++ b/minmachine.txt @@ -0,0 +1,17 @@ +2 +a b +6 +0 a 1 +0 b 3 +1 a 3 +1 b 4 +2 a 1 +2 b 4 +3 a 4 +3 b 3 +4 a 4 +4 b 4 +5 a 5 +5 b 5 +1 +4