![]() ![]() ****************************************************************************** * Compilation: javac NFA.java * Execution: java NFA regexp text * Dependencies: Stack.java Bag.java Digraph.java DirectedDFS.java * * % java NFA "(A*B|AC)D" AAAABD * true * * % java NFA "(A*B|AC)D" AAAAC * false * * % java NFA "(a|(bc)*d)*" abcbcd * true * * % java NFA "(a|(bc)*d)*" abcbcbcdaaaabcbcdaaaddd * true * * Remarks * - * The following features are not supported: * - The + operator * - Multiway or * - Metacharacters in the text * - Character classes. hello, please help me to write a program to convert NFA to DFA this program only print last states of DFA, thinks a lot. Conversion from NFA to DFA Suppose there is an NFA N < Q,, q0,, F > which recognizes a language L.On the other hand, DFA has one and only one move from a given state on a given input symbol. ![]() An NFA can also have NULL moves (moves without input symbol). Hence, it is called Deterministic Automaton. Below is the syntax highlighted version of NFA.java An NFA can have zero, one or more than one move from a given state on a given input symbol. In DFA, for each input symbol, one can determine the state to which the machine will move.
0 Comments
Leave a Reply. |