Presentation is loading. Please wait.

Presentation is loading. Please wait.

FORMAL LANGUAGES AND AUTOMATA THEORY

Similar presentations


Presentation on theme: "FORMAL LANGUAGES AND AUTOMATA THEORY"— Presentation transcript:

1 FORMAL LANGUAGES AND AUTOMATA THEORY
C K Nagpal M.Tech. Ph.D. Associate Professor Computer Engg. YMCA University of Science & Technology

2 Chapter 3 Finite Automata
In these slides, we will cover the following topics: • Basic structure of a finite automaton • String processing by a finite automaton • Acceptance of a string by a finite automaton • Deterministic and nondeterministic behaviour of finite automata • Meaning of equivalence in automata theory Concept of finite automata with output Concept of Moore and Mealy machines and their mutual conversion Utility of finite automata with null moves for reducing design complexity Conversion from ϵ-NFA to DFA using ϵ-closure

3 Finite State Machine (FSM)
Definition of FSM String recognition by FSM Finite Automaton: An automaton in the form of an FSM

4 Finite Automata A finite automaton is a five-tuple structure M(Q, Σ, q0, δ , F ), where Q is a finite set of states in which the finite automaton can exist Σ is a set of input symbols that can be fed to the finite automaton q0 is the starting state of the finite automaton δ is the set of transition functions that determine the next state, given the current state of the finite automaton and the current input symbol, and F is the set of final states (also referred to as acceptor states).

5 An Example of Finite Automaton
q0 q4 q1 q2 q3 a b c Q = {q0, q1, q2, q3, q4} Transition Functions ∑ = {a, b, c} δ(q0, a)= q1 Initial State → q0 δ(q1, b)= q2 F= {q2, q4} δ(q1, c)= q4 δ(q2, c)= q3 δ(q3, b)= q4

6 String Acceptance by Finite Automaton
δ(q0, abc) = δ (q1, bc) = δ (q2, c) = q3 (not accepted) δ(q0, ac) = δ (q1, c) = q4 (accepted) Properties of Extended Transition Function No transition using null string Transitions are performed character by character q0 q4 q1 q2 q3 a b c

7 DFA and NDFA Deterministic finite automaton (DFA)
One definite output corresponding to every input set of current state and input symbol Output may be no transition machine implementable Non Deterministic finite automata (NDFA) More than one possible outputs corresponding to same input set not machine implementable A string is accepted by NDFA if at least path, output of possible many, leads to final state For machine implementation it has to be converted to equivalent DFA.

8 Equivalence of DFAs Two DFAs are equivalent if there behavior towards string acceptance is same Structurally different equivalent Finite Automata S B A 1 1 Q T P R

9 Level Equivalence and Reduction in Finite Automaton
Two Finite Automata are said to be n level equivalent if their behavior is same for all the possible string up to the length n. For n level equivalence to exist, it is necessary that the n-1must already be existent The concept of level equivalence can be used to reduce the size of a given automaton

10 Finite Automata with Outputs
A finite automaton with output is a six-tuple structure M(Q, Σ, q0,δ, Δ, λ) where 1. Q is the set of states, 2. Σ is the set of input symbols, 3. q0 is the initial state, 4. δ is the transition function from Σ × Q to Q, 5. Δ is the finite set of outputs, and 6. λ is the output function.

11 Finite Automata with Outputs (Contd.)
Moore Machine Out put depends only upon current state Mealy machine Output depends upon both current state and the input symbol

12 Shift Register as Moore Machine

13 Shift Register as Mealy machine

14 Finite Automata with Null Moves
A null string move can not occur in the final description of a finite automaton. A finite automaton with ϵ moves is normally created in the intermediate state of its design to distribute the complexity of design or to enhance the understanding of the reader. But all the ϵ moves are to be removed before presenting the finite automaton finally. c b A C D E a A ϵ c B C D E a b

15 Removal of Null Moves A B ϵ a A B ϵ a ϵ A B a

16 ϵ-closure ϵ(A)={A, B, C, D} ϵ(C)={C,D} ϵ(B)={B} ϵ(D)={D} ϵ(F)={F} C D

17 Conversion from ϵ-NFA to DFA using ϵ-closure
ϵ-NFA representing the RE 1*(10)*1* Required DFA for RE 1*(10)*1*


Download ppt "FORMAL LANGUAGES AND AUTOMATA THEORY"

Similar presentations


Ads by Google