1. Automata Theory and Logic:
NFA to DFA
A TUTORIAL
BY
ANIMESH CHATURVEDI
AT
INDIAN INSTITUTE OF TECHNOLOGY INDORE (IIT-I)
2. Non-Deterministic Finite Automata (NFA)
an NFA may have more than one transition labeled with a certain symbol
an NFA may have no transitions labeled with a certain symbol
transitions may be labeled with ε, the empty string.
NFAs are usually easier to design than equivalent DFAs
Every DFA is also a non-deterministic finite automata (NFA)
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
3. NFA
Q = {q1, q2, q3, q4}, Σ = {0, 1},
δ is
q1 is the start state, and F = {q4}.
0 1 ε
q1 {q1, q2} {q1} Ø
q2 {q3} Ø {q3}
q3 Ø {q4} Ø
q4 {q4} {q4} Ø
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
4. NFA v/s DFA
DFA: For every string x, there is a unique path from initial state and associated with x.
x is accepted if and only if this path ends at a final state.
NFA: For any string x, there may exist none or more than one path from initial state and
associated with x.
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
5. Expressive power of DFA and NFA
Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA) have same
expressive power.
Given an NFA N, then we construct a DFA M, that accepts the same language
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
6. Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
7. Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
8. Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
9. Convert NFA to DFA
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
10. Convert NFA to DFA
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
11. Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
12. Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
13. Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
14. Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
15. DFA to Minimal DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
16. Up Next
A DFA represent a Regular Expression language
DFA or NDFA has less expressive power than Deterministic push down automata (DPDA)
17. References
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University
http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
Slide by: Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Slide by Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html