This program is taking input from the file nfa.txt and pritinf the output into the file dfa.txt
Input Format
N M // N- number of states , M- Number of Symbol Used
C 1--C //C - Numbe of final states ,1--c - to declare which states are the final states
K //Number of transition function
a s b 1---b // a is the previous state , s is the input symbol (Symbol starts from 1 --- n and states always starts from 0--n), b is the number of states is goes to after taking that particular symbol , 1--b is the states that which it goes.
-----------
-----------
-----------
----------k times
5 2
1 4
9
0 1 2 0 1
0 2 1 3
1 1 1 2
1 2 1 2
2 1 1 4
3 1 1 3
3 2 1 2
4 1 1 4
4 2 1 3
DFA for the corresponding NFA
0 0,1 3
0,1 0,1,2 2,3
3 3 2
0,1,2 0,1,2,4f 2,3
2,3 3,4f 2
2 4f -1
0,1,2,4f 0,1,2,4f 2,3
3,4f 3,4f 2,3
4f 4f 3
-1 -1 -1
where f means the final states and -1 means phi