toc(df avs nfa)avishek130650107020

12
TOC THEORY OF COMPUTATION NON-DETERMINISTIC FINITE AUTOMATA V S DETERMINISTIC FINITE AUTOMATA NFA DFA Prepared By :- Avishek Sarkar (130650107020) Yatish Dhanani (130650107002) Tej Dave (140650107007)

Upload: avishek-sarkar

Post on 12-Feb-2017

131 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Toc(df avs nfa)avishek130650107020

TOCTHEORY OF COMPUTATION

NON-DETERMINISTIC FINITE AUTOMATA V S DETERMINISTIC FINITE AUTOMATA NFA DFA

Prepared By :- Avishek Sarkar (130650107020)Yatish Dhanani (130650107002)Tej Dave (140650107007)

Page 2: Toc(df avs nfa)avishek130650107020

NFA vs. DFA

NFAs can be constructed from DFAs using transitions:Called NFA-

Suppose M1 accepts L1, M2 accepts L2

Then an NFA can be constructed that accepts:

L1 U L2 (union)

L1L2 (concatenation)

L1* (Kleene star)

Page 3: Toc(df avs nfa)avishek130650107020

Closure Properties of NFA-s

M1

M1

M

M2

M2

L(M1) U L(M2)

L(M1) L(M2)

L(M)*

Page 4: Toc(df avs nfa)avishek130650107020

Deterministic vs nondeterministic

For every nondeterministic automata, there is an equivalent deterministic automata

Finite acceptors are equivalent if they both accept the same language

L(M1) = L(M2)

NFA to DFA Conversion

Page 5: Toc(df avs nfa)avishek130650107020

NFA to DFA Conversion

-> In DFA, label resultant state as a set of states

{q1, q2, q3,…}For a set of |Q| states, there are exactly 2Q subsets

Finite number of states

Page 6: Toc(df avs nfa)avishek130650107020

Removing Non-deterministic

• By simulating all moves of an NFA-λ in parallel using a DFA.

• λ-closure of a state is the set of states reachable using only the λ-transitions.

Page 7: Toc(df avs nfa)avishek130650107020

NFA-λ

q1

p1

q2

p3

p2

a

λ

λ

λ

p4a

}5,4,3,2,1{),1( pppppaqt

p5λ

Page 8: Toc(df avs nfa)avishek130650107020

λ – Closure

•Selected λ closures

q1: {q1,q2}

p1: {p1,p2,p3}

q2: {q2}

Page 9: Toc(df avs nfa)avishek130650107020

• Given an NFA-λ M1, construct a DFA M2 such that L(M) = L(DM).• Observe that • A node of the DFA = Set of nodes of NFA-λ

• Transition of the DFA = Transition among set of nodes of NFA- λ

Equivalence Construction

Page 10: Toc(df avs nfa)avishek130650107020

Start state of DFA =

Final/Accepting state of DFA = All subsets of states of NFA-λ

that contain an accepting state of the NFA-λ

})({- 0qclosure

Dead state of DFA =

Special States to Identify

Page 11: Toc(df avs nfa)avishek130650107020

Example

q0

q1

q2

aa

a

b

λ

c

• Identify λ-closures• q0: {q0}

• q1: {q1}

• q2: {q1,q2}

Page 12: Toc(df avs nfa)avishek130650107020

THANK YOU..!!!