Download presentation
Presentation is loading. Please wait.
1
CSCI 2670 Introduction to Theory of Computing
September 2, 2004
2
Agenda Last class Today NFA examples
Presented theorem regarding equivalence of DFA’s and NFA’s Today Quiz Prove four theorems Equivalence of DFA’s and NFA’s Union, concatenation, and Kleene star are regular operators
3
Next week Section 1.3 and part of Section 1.4 Read pages
4
Equivalence of DFAs and NFAs
Theorem: Every non-deterministic finite automaton has an equivalent deterministic finite automaton Both FAs accept the same language Proof method Construction Similar to method used for calculating strings Follow all paths in parallel where states represent parallel paths
5
Proof idea Given NFA M1={Q,,,q0,F} construct DFA M2={Q’,,’,q0’,F’} with L(M1)=L(M2) Intuition Recall :Q×εP(Q) Our DFA’s transition function will generate paths within P(Q) ’: P(Q)×P(Q)
6
Defining M2 Determine Q’, q0, and F’
Q’ = P(Q) q0’ = {q0} F’ = {R Q’ | R F } i.e., R contains at least one of M1’s accept states Defining ’ (for now ignore ε jumps)
7
Example Q’={,{q1}, {q2}, {q3}, {q1,q2}, {q1,q3}, {q2,q3}, {q1,q2,q3}}
q1 1 q3 Q’={,{q1}, {q2}, {q3}, {q1,q2}, {q1,q3}, {q2,q3}, {q1,q2,q3}}
8
Example 1 q2 q1 1 q3 q0’={q1}
9
Example 1 q2 q1 1 q3 F’={{q3}, {q1,q3}, {q2,q3}, {q1,q2,q3}}
10
Example 1 {q1} {q2,q3} {q2} {q1,q3} {q3} {q1,q2} {q1,q2,q3} 1 1 q2
1 {q1} {q2,q3} {q2} {q1,q3} {q3} {q1,q2} {q1,q2,q3} 1 q1 q2 q3 1 1
11
What about ε jumps? For each R P(Q), define function E(R)
E(R) = {q | q can be reach by 0 or more ε jumps from some r R} Redefine ’(R,a) to include E(R) ’(R,a) = {q | q E((r,a)) for some r R}
12
Closure of NFA’s under regular operations
Remainder of class Union Concatenation Kleene star
13
Union is a regular operation
Theorem: The class of regular languages is closed under the union operation Proof approach: Assume A1 and A2 are both regular languages with A1=L(M1) and A2=L(M2) and create an NFA M such that L(M) = A1A2 Method: Proof by construction
14
Construct M from M1 and M2 M M1 ε ε M2
15
Concatenation is a regular operation
Theorem: The class of regular languages is closed under the concatenation operation Proof approach: Assume A1 and A2 are both regular languages with A1=L(M1) and A2=L(M2) and create an NFA M such that L(M) = A1A2 Method: Proof by construction
16
Construct M from M1 and M2 M M1 ε ε M2
17
Kleene star is a regular operation
Theorem: The class of regular languages is closed under the Kleene operation Proof approach: Assume A1 is a regular language with A1=L(M1) and create an NFA M such that L(M) = A1* Method: Proof by construction
18
Construct M from M1 M ε ε M1
19
Have A Wonderful Labor Day!!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.