Pushdown Automata PDAs - PowerPoint PPT Presentation

1 / 77
About This Presentation
Title:

Pushdown Automata PDAs

Description:

Pushdown Automaton -- PDA. Input String. Stack. States. Prof. Busch - LSU. 3. Initial Stack Symbol ... Automaton halts! If the automaton attempts to pop from ... – PowerPoint PPT presentation

Number of Views:193
Avg rating:3.0/5.0
Slides: 78
Provided by: Costas5
Category:

less

Transcript and Presenter's Notes

Title: Pushdown Automata PDAs


1
Pushdown AutomataPDAs

2
Pushdown Automaton -- PDA
Input String
Stack
States
3
Initial Stack Symbol
Stack
Stack
stack head
top
bottom
special symbol
Appears at time 0
4
The States
Pop symbol
Input symbol
Push symbol
5
input
stack
top
Replace
6
input
stack
top
Push
7
input
stack
top
Pop
8
input
stack
top
No Change
9
Pop from Empty Stack
input
Pop
Automaton halts!
stack
top
If the automaton attempts to pop from empty
stack then it halts and rejects input
10
Non-Determinism
PDAs are non-deterministic
Allowed non-deterministic transitions
11
Example PDA
PDA
12
Basic Idea
  • Push the as
  • on the stack

2. Match the bs on input with as on stack
3. Match found
13
Execution Example
Time 0
Input
Stack
current state
14
Time 1
Input
Stack
15
Time 2
Input
Stack
16
Time 3
Input
Stack
17
Time 4
Input
Stack
18
Time 5
Input
Stack
19
Time 6
Input
Stack
20
Time 7
Input
Stack
21
Time 8
Input
Stack
accept
22
A string is accepted if there is a computation
such that
All the input is consumed
AND The last state is an accepting state
we do not care about the stack contents at the
end of the accepting computation
23
Rejection Example
Time 0
Input
Stack
current state
24
Rejection Example
Time 1
Input
Stack
current state
25
Rejection Example
Time 2
Input
Stack
current state
26
Rejection Example
Time 3
Input
Stack
current state
27
Rejection Example
Time 4
Input
Stack
current state
28
Rejection Example
Time 4
Input
Stack
reject
current state
29
There is no accepting computation for
The string is rejected by the PDA
30
Another PDA example
PDA
31
Basic Idea
  • Push v
  • on stack

3. Match on input with v on stack
2. Guess middle of input
4. Match found
32
Execution Example
Time 0
Input
Stack
33
Time 1
Input
Stack
34
Time 2
Input
Stack
35
Time 3
Input
Guess the middle of string
Stack
36
Time 4
Input
Stack
37
Time 5
Input
Stack
38
Time 6
Input
Stack
accept
39
Rejection Example
Time 0
Input
Stack
40
Time 1
Input
Stack
41
Time 2
Input
Stack
42
Time 3
Input
Guess the middle of string
Stack
43
Time 4
Input
Stack
44
Time 5
There is no possible transition.
Input
Input is not consumed
Stack
45
Another computation on same string
Input
Time 0
Stack
46
Time 1
Input
Stack
47
Time 2
Input
Stack
48
Time 3
Input
Stack
49
Time 4
Input
Stack
50
Time 5
Input
No accept state is reached
Stack
51
There is no computation that accepts string
52
Pushing Popping Strings
Pop string
Input symbol
Push string
53
Example
input
stack
top
push string
top
pop string
Replace
54
Equivalent transitions
pop
push
55
Another PDA example
PDA
56
Execution Example
Time 0
Input
Stack
current state
57
Time 1
Input
Stack
58
Time 3
Input
Stack
59
Time 4
Input
Stack
60
Time 5
Input
Stack
61
Time 6
Input
Stack
62
Time 7
Input
Stack
63
Time 8
Input
Stack
accept
64
Formalities for PDAs

65
Transition function
66
Transition function
67
Formal Definition
Pushdown Automaton (PDA)
Accept states
States
Input alphabet
Stack start symbol
Transition function
Initial state
Stack alphabet
68
Instantaneous Description
Current state
Current stack contents
Remaining input
69
Example
Instantaneous Description
Input
Time 4
Stack
70
Example
Instantaneous Description
Input
Time 5
Stack
71
We write
Time 4
Time 5
72
A computation
73
For convenience we write
74
Language of PDA
Language accepted by PDA
Initial state
Accept state
75
Example
PDA
76
PDA
77
Therefore
PDA
Write a Comment
User Comments (0)
About PowerShow.com