Académique Documents
Professionnel Documents
Culture Documents
2
Contents Outline
• Epsilon NFA
• Closure of states
• Conversion of Epsilon NFA to DFA
3
NFA’s With ε-Transitions
• We can allow state-to-state transitions on ε input.
• These transitions are done spontaneously, without looking at
the input string.
• A convenience at times, but still only regular languages are
accepted.
Formal Definition of ε-NFA
ε-NFA
ε +,- . 0,1,..........9
q0 {q1} {q1} Ø Ø
q1 Ø Ø {q2} {q1,q4}
q2 Ø Ø Ø {q3}
q3 {q5} Ø Ø {q3}
q4 Ø Ø {q3} Ø
q5 Ø Ø Ø Ø
Example: ε-NFA to DFA
• ECLOSE(q0)={q0,q1}
• ECLOSE(δD ({q0,q1},+))=ECLOSE({q1})={q1}
• ECLOSE(δD ({q0,q1},-))=ECLOSE({q1})={q1}
• ECLOSE(δD ({q0,q1},.))=ECLOSE({q2})={q2}
• ECLOSE(δD ({q0,q1},0..9))=ECLOSE({q1,q4})=
{q1,q4}
Example: ε-NFA to DFA
• ECLOSE(q1)={q1}
• ECLOSE(δD ({q1},+))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q1},-))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q1},.))=ECLOSE({q2})={q2}
• ECLOSE(δD ({q1},0..9))=ECLOSE({q1,q4})=
{q1,q4}
Example: ε-NFA to DFA
• ECLOSE(q2)={q2}
• ECLOSE(δD ({q2},+))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q2},-))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q2},.))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q2},0..9))=ECLOSE({q3})={q3,q5}
Example: ε-NFA to DFA
• ECLOSE({q1,q4})={q1,q4}
• ECLOSE(δD ({q1,q4},+))=ECLOSE(Ø)= Ø
• ECLOSE(δD ({q1,q4},-))=ECLOSE(Ø)= Ø
• ECLOSE(δD ({q1,q4},.))=ECLOSE({q2,q3})
={q2,q3,q5}
• ECLOSE(δD ({q1,q4},0..9))=ECLOSE({q1,q4})=
{q1,q4}
Example: ε-NFA to DFA
• ECLOSE(q3)={q3,q5}
• ECLOSE(δD ({q3,q5},+))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q3,q5},-))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q3,q5},.))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q3,q5},0..9))=ECLOSE({q3})
• ={q3,q5}
Example: ε-NFA to DFA
• ECLOSE({q2,q3,q5})={q2,q3,q5}
• ECLOSE(δD ({q2,q3,q5},+))=ECLOSE(Ø)= Ø
• ECLOSE(δD ({q2,q3,q5},-))=ECLOSE(Ø)= Ø
• ECLOSE(δD ({q2,q3,q5},.))=ECLOSE(Ø)=Ø
• ECLOSE(δD ({q2,q3,q5},0..9))=ECLOSE({q3}) ={q3,q5}
Example: ε-NFA to DFA
+,- . 0..9
{q0,q1} {q1} {q2} {q1,q4}
{q1} Ø {q2} {q1,q4}
{q2} Ø Ø {q3,q5}
{q1,q4} Ø {q2,q3,q5} {q1,q4}
{q3,q5} Ø Ø {q3,q5}
{q2,q3,q5} Ø Ø {q3,q5}
An Application: Text Search
•A common problem in the age of the web and other on-
line text repositories is the following. Given a set of words,
find all documents that contain one (or all) of those words.
E.g. Search engine.
e b
2 3 4
Σ w
1
e 5 6 7 8
b a y
References
• Hopcroft J.E. and Ullman J.D., “Introduction to Automata Theory Languages and Computation”, Narosa Publications.
• https://en.wikipedia.org
• http://www.eecs.wsu.edu/
21
THANK YOU
For queries
Email: sheetal.ait@cumail.in
22