Pushdown Automata PDAs - PowerPoint PPT Presentation

About This Presentation
Title:

Pushdown Automata PDAs

Description:

Costas Busch - RPI. 10. input. A Bad Transition. The automaton ... Costas Busch - RPI. 12. No transition is allowed to be followed. When the stack is empty ... – PowerPoint PPT presentation

Number of Views:312
Avg rating:3.0/5.0
Slides: 86
Provided by: costas
Learn more at: http://www.cs.rpi.edu
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
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
A Possible Transition
input
stack
empty
Pop
top
10
A Bad Transition
input
Empty stack

HALT
The automaton Halts in state and Rejects the
input string
11
A Bad Transition
input
Empty stack

HALT
The automaton Halts in state and Rejects the
input string
12
No transition is allowed to be followed When the
stack is empty
Empty stack
13
A Good Transition
input
stack
Pop
top
14
Non-Determinism
These are allowed transitions in a
Non-deterministic PDA (NPDA)
15
NPDA Non-Deterministic PDA
Example
16
Execution Example
Time 0
Input
Stack
current state
17
Time 1
Input
Stack
18
Time 2
Input
Stack
19
Time 3
Input
Stack
20
Time 4
Input
Stack
21
Time 5
Input
Stack
22
Time 6
Input
Stack
23
Time 7
Input
Stack
24
Time 8
Input
Stack
accept
25
A string is accepted if there is a computation
such that
All the input is consumed
AND The last state is a final state
At the end of the computation, we do not care
about the stack contents
26
The input string is accepted by the NPDA
27
In general,
is the language accepted by the NPDA
28
Another NPDA example
NPDA
29
Execution Example
Time 0
Input
Stack
30
Time 1
Input
Stack
31
Time 2
Input
Stack
32
Time 3
Input
Guess the middle of string
Stack
33
Time 4
Input
Stack
34
Time 5
Input
Stack
35
Time 6
Input
Stack
accept
36
Rejection Example
Time 0
Input
Stack
37
Time 1
Input
Stack
38
Time 2
Input
Stack
39
Time 3
Input
Guess the middle of string
Stack
40
Time 4
Input
Stack
41
Time 5
There is no possible transition.
Input
Input is not consumed
Stack
42
Another computation on same string
Input
Time 0
Stack
43
Time 1
Input
Stack
44
Time 2
Input
Stack
45
Time 3
Input
Stack
46
Time 4
Input
Stack
47
Time 5
Input
No final state is reached
Stack
48
There is no computation that accepts string
49
A string is rejected if there is no computation
such that
All the input is consumed
AND The last state is a final state
At the end of the computation, we do not care
about the stack contents
50
In other words, a string is rejected if in every
computation with this string
The input cannot be consumed OR The input is
consumed and the last state is not a final
state OR The stack head moves below the bottom of
the stack
51
Another NPDA example
NPDA
52
Execution Example
Time 0
Input
Stack
53
Time 1
Input
Stack
54
Time 2
Input
Stack
55
Time 3
Input
Stack
accept
56
Rejection example
Time 0
Input
Stack
57
Time 1
Input
Stack
58
Time 2
Input
Stack
59
Time 3
Input
Stack
60
Time 4
Input
Stack
Halt and Reject
61
Pushing Strings
Pop symbol
Input symbol
Push string
62
Example
input
pushed string
stack
top
Push
63
Another NPDA example
NPDA
64
Execution Example
Time 0
Input
Stack
current state
65
Time 1
Input
Stack
66
Time 3
Input
Stack
67
Time 4
Input
Stack
68
Time 5
Input
Stack
69
Time 6
Input
Stack
70
Time 7
Input
Stack
71
Time 8
Input
Stack
accept
72
Formalities for NPDAs

73
Transition function
74
Transition function
75
Formal Definition
Non-Deterministic Pushdown Automaton
NPDA
Final states
States
Input alphabet
Stack start symbol
Transition function
Initial state
Stack alphabet
76
Instantaneous Description
Current state
Current stack contents
Remaining input
77
Example
Instantaneous Description
Input
Time 4
Stack
78
Example
Instantaneous Description
Input
Time 5
Stack
79
We write
Time 4
Time 5
80
A computation
81
For convenience we write
82
Formal Definition
Language of NPDA
Initial state
Final state
83
Example
NPDA
84
NPDA
85
Therefore
NPDA
Write a Comment
User Comments (0)
About PowerShow.com