Вы находитесь на странице: 1из 17

1

THEORY OF AUTOMATA

AAMER KHAN
ABBOTTABAD UNIVERSITY OF SCIENCE &
TECHNOLOGY

Lecture 5 (AUTOMATA THEORY)


2 Ways of Writing Languages
Chapter 5
Previous Outline
3

 Basics & Related Terminologies


 Descriptive Way Vs Tabular Way
 Examples
Chapter 1-3

 Recursive Way
 Examples

 Regular Expression
 Examples
Ways of Defining a Language
4

 Descriptive way
 Recursive way
 Regular Expression
 Finite Automata (FA) or Finite State Machine (FSM)
Ways of Defining a Language
5

 Finite Automata (F.A) or Finite State Machine (FSM)


Finite Automata
6

 An FA is defined as follows:-
Finite no of states in which one state must be initial state and more than one or
may be none can be the final states.
Also known as Finite state machine, Finite state automata
It represents an abstract machine which is used to represent a regular
language
A regular expression can also be represented using Finite Automata
Sigma Σ provides the input letters from which input strings can be formed.
 FA Distinguishing Rule: For each state, there must be an out going
transition for each input letter in Sigma Σ.
Σ = {a,b} and states = 0,1,2
where 0 is an initial state and 2 is the final state.
Finite Automata
7

 Transitions: 1st Method


Old state Input Next
At state 0 reading a,b go to state 1, State
0 a 1
At state 1 reading a, b go to state 2
0 b 1
At state 2 reading a, b go to state 2 1 a 2
1 b 2
+2 a 2
+2 b 2
Finite Automata
8

 Transitions: 2nd Method


Old States New States
Reading a Reading b
0- 1 1
1 2 2
2+ 2 2

Old States New States


Reading a Reading b
0- 1 2
1 2 2
2+ 2 2
Finite Automata
9
Finite Automata
10
Finite Automata
11

Regular expression
(aaa+b)*
Finite Automata
12
Finite Automata
13
Finite Automata
14
Finite Automata
15
Finite Automata Λ+a+b+(a+b)*(ab+ba+aa)

16

 Martin method:
Make each state label, as it progresses, based on the input strings.
Based on the conditions of the Regular expressions or FA, only required states
are marked final. Not every FA can be modeled in this way!
17

Thanks

Вам также может понравиться