190 likes | 317 Views
CSCI 2670 Introduction to Theory of Computing. September 2, 2004. Agenda. Last class 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.
E N D
CSCI 2670Introduction to Theory of Computing September 2, 2004
Agenda • Last class • 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
Next week • Section 1.3 and part of Section 1.4 • Read pages 63 - 74
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
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)
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)
Example 1 • Q’={,{q1}, {q2}, {q3}, {q1,q2}, {q1,q3}, {q2,q3}, {q1,q2,q3}} q2 0 q1 1 0 q3
Example 1 • q0’={q1} q2 0 q1 1 0 q3
Example 1 • F’={{q3}, {q1,q3}, {q2,q3}, {q1,q2,q3}} q2 0 q1 1 0 q3
1 q2 0 q1 0 q3 Example 1 1
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}
Closure of NFA’s under regular operations • Remainder of class • Union • Concatenation • Kleene star
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
M1 M2 M Construct M from M1 and M2 ε ε
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
M1 M2 M Construct M from M1 and M2 ε ε
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
ε ε ε M1 M Construct M from M1