Finite Automata
-
Upload
donnelly-davis -
Category
Documents
-
view
61 -
download
3
description
Transcript of Finite Automata
FINITE AUTOMATA
Finite Automata
• Finite automata are recognizers– A recoganizer for a language L is a program that
takes as input a string x and answers “yes” if x is a sentence of L and “no ” otherwise.
–Finite automata can be :• Nondeterministic finite automata (NFA)
–no restrictions on the labels of their edges. –A symbol can label several edges out of the
same state, and , the empty string, is a possible label.
• Deterministic finite automata (DFA) – for each state, and for each symbol of its input
alphabet exactly one edge with that symbol leaving that state.
Nondeterministic Finite Automata
• A nondeterministic finite automaton (NFA) consists of:– A finite set of states S.– A set of input symbols Σ (the input alphabet).
empty string, is never a member of Σ.– A transition function that maps state-symbol
pairs to sets of states.
– A state S0 that is distinguished as the start state (or initial state).
– A set of states F, that is distinguished as the accepting states (or final states).
• An NFA can be represented diagrammatically by a labelled directed graph transition graph (transition diagram).– nodes represents states and the labelled edges
represent the transition function
• Eg for NFA-
which recognizes the language (a/b)*abba
0 21 3a b b
b
start
•The language defined (or accepted) by an NFA is the set of strings labeling some path from the start to an accepting state.
• The transitions of an NFA can be represented in tabular form called transition table
• Transition table for NFA of regular expression (a/b)*abb
• In transition table ,there is a row for each state, and a column
for each input symbol and є • The entry for row i and symbol a is the set of possible next
states that can be reached from state i on input a.
state Input symbol a b
0 {0,1} {0}
1 ---- {2}
2 ---- {3}