Finite Automata Theorems - Unit I SUSAN ELIAS Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering September 17, 2012
Unit I - Guidelines Formal Definitions Definition of DFA 2.2.1 Notations for DFA 2.2.3 ˆδ for DFA 2.2.4 Language of DFA 2.2.5 Definition of NFA 2.3.2 ˆδ for NFA 2.3.3 Language of NFA 2.3.4 Definition of ɛ-nfa 2.5.2 ˆδ and Language for ɛ-nfa 2.5.4 Theorems Problems
Unit I - Guidelines Formal Definitions Theorems NFA - DFA Theorems 2.11, 2.12 Theorem 2.22 Forms of Proofs - Chapter 1-1.2, 1.3, 1.4 Problems Design of DFA Problems Convert NFA, ɛ-nfa to DFA Problems
Introduction NFA - DFA To prove that NFA is equivalent to DFA ɛ-nfa - DFA To prove that ɛ-nfa is equivalent to DFA
Introduction Induction Principle : If we Prove S(i) and we prove that for all n i, S(n) implies S(n+1), then we may conclude S(n) for all n i.
Introduction IF-AND-ONLY-IF Statements A if and only if B A iff B A is equivalent to B
Introduction A if and only if B if part : if B then A only if part : if A then B
Introduction NFA - DFA Theorem 2.12 A language L is accepted by some DFA if and only if L is accepted by some NFA ɛ-nfa - DFA Theorem 2.22 A language L is accepted by some ɛ-nfa if and only if L is accepted by some DFA
NFA-DFA NFA - DFA Theorem 2.12 A language L is accepted by some DFA if and only if L is accepted by some NFA if part : Theorem 2.11 - Subset construction only if part : Trivial
NFA-DFA NFA - DFA - Theorem 2.11 If D = (Q D, Σ, δ D, {q 0 }, F D ) is a DFA constructed from NFA N = (Q N, Σ, δ N, q 0, F N ) by subset construction, then L(D) = L(N) Proof : Prove by induction on w that ˆ δ D ({q 0 }, w) = ˆ δ N (q 0, w) BASIS: Let w = 0 that is w = ɛ. By the Basis definition of ˆδ for DFA s and NFA s, both δˆ D ({q 0 }, ɛ) and δˆ N (q 0, ɛ) are {q 0 } INDUCTION: Let w be of length n + 1, assume the statement for length n Break w up as w = xa, where a is the first symbol of w. By the inductive hypothesis δˆ D ({q 0 }, x) = δˆ N (q 0, x) Let both these sets of N s states be {p 1, p 2,, p k }
NFA - DFA - Theorem 2.11 INDUCTION: The inductive part of the definition of ˆδ for NFA s says that δˆ N (q 0, w) = k i=1 δ N(p i, a) - (1) The subset construction on the other hand says that δ D ({p 1, p 2,, p k }, a) = k i=1 δ N(p i, a) - (2) Using Equation(2) and the fact that δˆ D ({q 0 }, x) = {p 1, p 2,, p k } in the inductive part of the definition of ˆδ for DFA s: δˆ D (q 0, w) = δ D ( δˆ D ({q 0 }, x), a) = δ D ({p 1, p 2,, p k }, a) = k i=1 δ N(p i, a) - (3) Thus Equations (1) and (3) demonstrate that δˆ D ({q 0 }, w) = δˆ N (q 0, w). When we observe that D and N both accept w if and only if δˆ D ({q 0 }, w) or δˆ N (q 0, w) respectively contain a state in F N the proof that L(D) = L(N) is complete
NFA - DFA - Theorem 2.12 NFA - DFA Theorem 2.12 A language L is accepted by some DFA if and only if L is accepted by some NFA if part : Theorem 2.11 - Subset construction only if part : Trivial - A transition diagram for a DFA can also be interpreted as the transition diagram for an NFA which happens to have exactly one choice of transition in any situation.
ɛ-nfa-dfa ɛ-nfa-dfa Theorem Theorem 2.22 A language L is accepted by some ɛ-nfa if and only if L is accepted by some DFA if part : Let L(D) be the language of a DFA Turn D into an ɛ NFA E by adding transitions δ(q, ɛ) = for all states q of D. Turn all the transitions of D on input symbol as δ E (q, a) = {p} Now transitions of E and D are the same only if part : Modified Subset Construction.
NFA-DFA - Theorem 2.22 Only-If part: Let E = (Q E, Σ, δ E, {q 0 }, F E ) be an ɛ NFA. Apply Modified Subset construction to produce DFA D = (Q D, Σ, δ D, {q 0 }, F D ). Need to show that L(D) = L(E) We prove that δˆ E (q 0, w) = δˆ D (q D, w) by induction on length of w BASIS: If w = 0, then w = ɛ It is known that δˆ E (q 0, ɛ) = ECLOSE(q 0 ) It is also known that q D = ECLOSE(q 0 ) It is known that for a DFA ˆδ(p, ɛ) = p for any state p So δˆ D (q D, ɛ) = ECLOSE(q 0 ) Thus is is proved that δˆ E (q 0, ɛ) = δˆ D (q D, ɛ) INDUCTION:
NFA - DFA - Theorem 2.22 INDUCTION: Suppose w = xa, where a is the final symbol of w and assume that the statement holds for x. That is δˆ E (q 0, x) = δˆ D (q 0, x) Let both these sets of states be {p 1, p 2,, p k } By the definition of ˆδ for ɛ-nfa we compute δˆ E (q 0, w) by 1 Let {r 1, r 2,, r m } be k i=1 δ E (p i, a) 2 Then δˆ E (q 0, w) = m j=1 ECLOSE(r j) Steps (1) and (2) are the same steps used in the Modified Subset Construction Thus δ ˆ D (q D, w) which is δ D ({p 1, p 2,, p k }, a) is the same set as δˆ E (q 0, w) Thus it is proved that δˆ E (q 0, w) = δˆ D (q D, w)