Sie sind auf Seite 1von 18

Introduction to Theory of

Automata
Lecture # 1

1
Text and Reference Material

 Introduction to Computer Theory, by Daniel I.


Cohen, John Wiley and Sons, Inc., 1991, Second
Edition

2
What does automata mean?
It is the plural of automaton, and it means
“something that works automatically”

It accepts input, produces output, may have


some temporary storage and can make
decisions in transforming the input into the
output.

3
Automata Theory
 Automata theory is the study of abstract machines and
problems which they are able to solve
 A typical abstract machine consists of a definition in terms of
input, output, and the set of allowable operations used to turn
the former into the latter.
 Automata theory is a step in abstracting your attention away
from any particular kind of computer or particular
programming language
 In English we have letter, words and sentences (relationship)
 Not all collection of letters form a valid word, not all
collections of words form a valid sentence.
 Same in Computer Languages

4
Automata Theory (Cont...)
 Certain character strings are recognized (do, if, While)
 Certain strings of words are recognizable commands
 Certain set of commands become a program
 It is important that a program compiles whether or not it does what
the programmer intended
 If it compiles Its Valid and machine is responsible for executing the
specified instructions
 Its hard to state all the rules for the languages like ENGLISH,
PASHTO etc.
 But in programming languages we can insist on precise rules,
computers cannot understand informal speech

5
Introduction to Languages
 The collection of different types of inputs through which a
machine is operated is said to be language of a machine.
 Basically a language Comprises of three different entities
 Letters
 Words
 Sentences

There are certain parallelism between the fact that groups of


letters make up words and the fact that groups of words make
up sentences.
Not all collection of letters form a valid word, and not all
collection of words form a valid sentences.

6
Introduction to languages
There are two types of languages

Formal Languages (Syntactic languages)

Informal Languages (Semantic languages)

7
Formal Languages
The word formal means that all the rules for the language
are openly stated in terms of what strings symbols can
occur.
It is an abstraction of the general characteristics of
programming languages
It consists of a set of symbols and some rules of formation
of sentences
Sentences are formed by grouping the symbols

8
Central Concepts of Automata Theory
We have Three basic concepts in Automata.

Alphabet --- a set of symbols


Strings --- a list of symbols from an alphabet
Language --- a set of strings from the same alphabet

9
Alphabets
 Definition:
A finite non-empty set of symbols (letters), is called an
alphabet. It is denoted by Σ ( Greek letter sigma).
 Example:
Σ={a,b}a,b}
Σ={a,b}0,1} //important as this is the language //which the
computer understands.
Σ={a,b}i,j,k}

10
Strings
 Definition:
Concatenation of finite symbols from the alphabet is
called a string.
 Example:
If Σ= {a,b}a,b} then
a, abab, aaabb, ababababababababab

11
EMPTY STRING or NULL STRING
 Sometimes a string with no symbol at all is used, denoted
by (Small Greek letter Lambda) λ or (Capital Greek letter
Lambda) Λ, is called an empty string or null string.
The capital lambda will mostly be used to denote the empty
string, in further discussion.

12
Introduction to defining languages
 Lets start with an alphabet having only one letter, the ‘x’
 Σ = {a,b}x}
 L1 = {a,b}x xx xxx xxxx ……..}
 Or L1 = {a,b}xn for n = 1 2 3 4…..}
 Similarly L2 = {a,b}x xxx xxxxx xxxxxxx ……….}
 L2 = {a,b}x2n+1 for n = 0 1 2 3 4……..}

13
Length of the string
 The length of the string is the number of symbols in the string
 If a = xxxx then length(a) = 4
 Length(428) = 3
 Length(Λ) = 0

Reverse of the string


 The reverse of a string is obtained by writing the symbols in reverse
order.
 Reverse(xxx) = xxx
 Reverse(420) = 024

14
KLEENE CLOSURE
 Given an alphabet Σ, we wish to define a language in which
any string of letters from Σ is a word, even the null string
 This is called closure of the alphabet and denoted by Σ*
 This notation is sometimes known as Kleene star
 If Σ = {a,b}x}, then
 Σ* = L1 = {a,b}Λ x xx xxx xxxx……….}
 If Σ = {a,b}0 1} then
 Σ* = L2 = {a,b}Λ 0 1 00 01 10 11 000 001…….}
 If Σ = {a,b}a b c} then
 Σ* = L3 = {a,b}Λ a b c aa ab ac ba bb bc ca cb cc
aaa …..}

15
KLEENE CLOSURE
S+ is the set of all strings obtained by
concatenating one or more symbols
S ={y}
S+ ={y,yy,yyy,yyyy,…}

16
Example
1. Consider the language S*, where S = {a
b}.How many words does this language
have of length 2? of length 3? of length n?
Number of words = (Number of letters)^
(WordLength)
Length 2: 2^ 2 = 4
Length 3: 2 ^3 = 8
Length n: 2 ^n

17
End of Chapter

18

Das könnte Ihnen auch gefallen