Formal Language and Automata Theory
Formal Language and Automata Theory
AND
AUTOMATA THEORY
MS. SUPARNA KARMAKAR
ASST. PROF.
DEPT OF IT
GNIT
INTRODUCTION TO
AUTOMATA THEORY
2
What is Automata Theory?
3
(A pioneer of automata theory)
Alan Turing (1912-1954)
4
Theory of Computation: A Historical
Perspective
1930s • Alan Turing studies Turing machines
• Decidability
• Halting problem
6
DEFINITION
INPUT: At each of the discrete instant of time t1, t2,……,tn the input values I1, I2,……,Ip, each of which can
take a finite number of fixed values from the input alphabet ∑, are applied to the input side of the model shown in
fig 1.1.
OUTPUT: O1,O2,……, Oq are the output of the model each of which can take a finite number of fixed values
from an output O.
STATES: At any instant of time the automaton can be in one of the states q1, q2, q3,…, qn
STATE RELATION: The next state of an automaton at any instant of time is determined by the present state and
the present input.
OUTPUT RELATION: The output is related to either state only or to both present state and the present input.
Alphabet
10
Strings
11
Powers of an alphabet
Let ∑ be an alphabet.
– ∑* = ∑0 U ∑1 U ∑2 U …
– ∑+ = ∑ 1 U ∑2 U ∑3 U …
12
Related Concept:
❑ KEEN CLOSURE OR KLEEN STAR : The Kleene star, Σ*, is a unary operator on a set of symbols or
strings, Σ, that gives the infinite set of all possible strings of all possible lengths over Σ including λ.
❑ POSITIVE CLOSURE:
The set Σ+ is the infinite set of all possible strings of all possible lengths over Σ excluding λ.
Representation: Σ+ = Σ* − { λ}
Example:
Let w = 100011
Q) Is w the language of strings with equal number of 0s and 1s?
15
Finite Automata
■ Some Applications
– Software for designing and checking the behavior of digital
circuits
– Lexical analyzer of a typical compiler
– Software for scanning large bodies of text (e.g., web pages) for
pattern finding
– Software for verifying systems of all types that have a finite
number of states (e.g., stock market transaction,
communication/network protocol)
16
Finite Automata : Examples
action
17
Structural expressions
■ Grammars
■ Regular expressions
– E.g., unix style to capture city names such as “Palo Alto CA”:
■ [A-Z][a-z]*([ ][A-Z][a-z]*)*[ ][A-Z][A-Z]