Pushdown Automata PDAs
description
Transcript of Pushdown Automata PDAs
![Page 1: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/1.jpg)
Courtesy Costas Busch - RPI 1
Pushdown AutomataPDAs
![Page 2: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/2.jpg)
Courtesy Costas Busch - RPI 2
Pushdown Automaton -- PDAInput String
Stack
States
![Page 3: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/3.jpg)
Courtesy Costas Busch - RPI 3
Initial Stack Symbol
Stack
$
Stack
z
bottomspecial symbol
stackhead top
![Page 4: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/4.jpg)
Courtesy Costas Busch - RPI 4
The States
q1 q2a, b c
Inputsymbol
Popsymbol
Pushsymbol
q1 q2cba /,
Alternatively
![Page 5: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/5.jpg)
Courtesy Costas Busch - RPI 5
q1 q2a, b c
a
b top
input
stack
a
Replaceeh
$eh
$
c
![Page 6: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/6.jpg)
Courtesy Costas Busch - RPI 6
q1 q2a, c
a a
Pushb
eh
$eh
$
bc
top
input
stack
![Page 7: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/7.jpg)
Courtesy Costas Busch - RPI 7
q1 q2a, b
a a
Popb
eh
$eh
$
top
input
stack
![Page 8: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/8.jpg)
Courtesy Costas Busch - RPI 8
q1 q2a,
a a
No Changeb
eh
$eh
$
btop
input
stack
![Page 9: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/9.jpg)
Courtesy Costas Busch - RPI 9
q1 q2$,a
a a
Pop$ top
input
stack
A Possible Transition
empty
![Page 10: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/10.jpg)
Courtesy Costas Busch - RPI 10
q1 q2cba ,
a input
A Bad Transition
The automaton Halts in state and Rejects the input string
Empty stack
q1
HALT
![Page 11: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/11.jpg)
Courtesy Costas Busch - RPI 11
q1 q2ca ,
a input
A Bad Transition
The automaton Halts in state and Rejects the input string
Empty stack
q1
HALT
![Page 12: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/12.jpg)
Courtesy Costas Busch - RPI 12
q1 q2zyx ,
No transition is allowed to be followedWhen the stack is empty
Empty stack
![Page 13: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/13.jpg)
Courtesy Costas Busch - RPI 13
q1 q2ba $,
a a
Pop$ top
input
stack
A Good Transition
b
![Page 14: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/14.jpg)
Courtesy Costas Busch - RPI 14
Non-Determinism
q1
q2a, b c
q3a, b c
q1 q2, b c
transition
These are allowed transitions in a Non-deterministic PDA (NPDA)
![Page 15: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/15.jpg)
Courtesy Costas Busch - RPI 15
NPDA: Non-Deterministic PDA
Example:
,
a, a
b, a q0 q1 q2 q3
b, a
, $ $
![Page 16: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/16.jpg)
Courtesy Costas Busch - RPI 16
a, a
b, a 0q q1 q2 q3
Execution Example:Inputa a a b b b
currentstate
b, a
Time 0
, , $ $
Stack$
![Page 17: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/17.jpg)
Courtesy Costas Busch - RPI 17
a, a
b, a q0 q1 q2 q3
Inputa a a b b b
b, a
Time 1
, , $ $
Stack$
![Page 18: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/18.jpg)
Courtesy Costas Busch - RPI 18
a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b$a
b, a
Time 2
, , $ $
![Page 19: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/19.jpg)
Courtesy Costas Busch - RPI 19
a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b$aa
b, a
Time 3
, , $ $
![Page 20: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/20.jpg)
Courtesy Costas Busch - RPI 20
a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b
$aaa
b, a
Time 4
, , $ $
![Page 21: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/21.jpg)
Courtesy Costas Busch - RPI 21
a, a
b, a q0 q1 q2 q3
Inputa a a b b b
Stack$aaa
b, a
Time 5
, , $ $
![Page 22: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/22.jpg)
Courtesy Costas Busch - RPI 22
a, a
b, a q0 q1 q2 q3
Inputa a a b b b
$a
Stack
b, a
Time 6
, , $ $
a
![Page 23: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/23.jpg)
Courtesy Costas Busch - RPI 23
a, a
b, a q0 q1 q2 q3
Inputa a a b b b
$Stack
b, a
Time 7
, , $ $
a
![Page 24: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/24.jpg)
Courtesy Costas Busch - RPI 24
a, a
b, a q0 q1 q2 q3
Inputa a a b b b
b, a
Time 8
accept, , $ $
$Stack
![Page 25: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/25.jpg)
Courtesy Costas Busch - RPI 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
![Page 26: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/26.jpg)
Courtesy Costas Busch - RPI 26
The input stringis accepted by the NPDA:
aaabbb
a, a
b, a q0 q1 q2 q3
b, a
, , $ $
![Page 27: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/27.jpg)
Courtesy Costas Busch - RPI 27
}0:{ nbaL nn
is the language accepted by the NPDA:
a, a
b, a q0 q1 q2 q3
b, a
In general,
, , $ $
![Page 28: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/28.jpg)
Courtesy Costas Busch - RPI 28
Another NPDA example
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
NPDA M
}{)( RwwML
![Page 29: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/29.jpg)
Courtesy Costas Busch - RPI 29
Execution Example:Input
Time 0
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
a ab b
![Page 30: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/30.jpg)
Courtesy Costas Busch - RPI 30
Inputa ab
Time 1
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
ab
![Page 31: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/31.jpg)
Courtesy Costas Busch - RPI 31
InputTime 2
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
aa ab bb
![Page 32: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/32.jpg)
Courtesy Costas Busch - RPI 32
InputTime 3
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
aa ab bb
Guess the middle of string
![Page 33: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/33.jpg)
Courtesy Costas Busch - RPI 33
InputTime 4
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
aa ab bb
![Page 34: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/34.jpg)
Courtesy Costas Busch - RPI 34
InputTime 5
Stack$
, $ $1q q2
bbaa
,,
, q0
bbaa
,,
a ab b a
![Page 35: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/35.jpg)
Courtesy Costas Busch - RPI 35
InputTime 6
Stack$
, $ $q1
bbaa
,,
, q0
bbaa
,,
a ab b
acceptq2
![Page 36: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/36.jpg)
Courtesy Costas Busch - RPI 36
Rejection Example:Input
Time 0
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
a b b b
![Page 37: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/37.jpg)
Courtesy Costas Busch - RPI 37
InputTime 1
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
aa b b b
![Page 38: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/38.jpg)
Courtesy Costas Busch - RPI 38
InputTime 2
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
ab
a b b b
![Page 39: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/39.jpg)
Courtesy Costas Busch - RPI 39
InputTime 3
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
ab
Guess the middle of string
a b b b
![Page 40: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/40.jpg)
Courtesy Costas Busch - RPI 40
InputTime 4
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
ab
a b b b
![Page 41: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/41.jpg)
Courtesy Costas Busch - RPI 41
InputTime 5
Stack$
, $ $1q q2
bbaa
,,
, q0
bbaa
,,
aa b b b
There is no possible transition.
Input is not consumed
![Page 42: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/42.jpg)
Courtesy Costas Busch - RPI 42
Another computation on same string:Input Time 0
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
a b b b
![Page 43: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/43.jpg)
Courtesy Costas Busch - RPI 43
InputTime 1
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
aa b b b
![Page 44: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/44.jpg)
Courtesy Costas Busch - RPI 44
InputTime 2
Stack$
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
ab
a b b b
![Page 45: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/45.jpg)
Courtesy Costas Busch - RPI 45
InputTime 3
Stack$ab
a b b b
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
b
![Page 46: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/46.jpg)
Courtesy Costas Busch - RPI 46
InputTime 4
Stack
a b b b
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
$abbb
![Page 47: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/47.jpg)
Courtesy Costas Busch - RPI 47
InputTime 5
Stack
a b b b
$abbb
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
No final state is reached
![Page 48: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/48.jpg)
Courtesy Costas Busch - RPI 48
, $ $q1 q2
bbaa
,,
, q0
bbaa
,,
There is no computation that accepts string abbb
)(MLabbb
![Page 49: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/49.jpg)
Courtesy Costas Busch - RPI 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
![Page 50: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/50.jpg)
Courtesy Costas Busch - RPI 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
ORThe stack head moves below the bottom of the stack
![Page 51: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/51.jpg)
Courtesy Costas Busch - RPI 51
Another NPDA example
abaa
,,
q0
NPDA M
}1:{)( mnbaML mn
![Page 52: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/52.jpg)
Courtesy Costas Busch - RPI 52
Execution Example:Input
Time 0
Stack
a a b
$,,,
bab
aa
q0
$
![Page 53: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/53.jpg)
Courtesy Costas Busch - RPI 53
InputTime 1
Stack
a a b
q0
a$
$,,,
bab
aa
![Page 54: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/54.jpg)
Courtesy Costas Busch - RPI 54
InputTime 2
Stack
a a b
q0
aa
$
$,,,
bab
aa
![Page 55: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/55.jpg)
Courtesy Costas Busch - RPI 55
InputTime 3
Stack
a a b
q0
a
accept
$
$,,,
bab
aa
![Page 56: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/56.jpg)
Courtesy Costas Busch - RPI 56
Rejection example:Input
Time 0
Stack
a b b
q0
b$
![Page 57: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/57.jpg)
Courtesy Costas Busch - RPI 57
InputTime 1
Stack
q0
aa b b b$
$,,,
bab
aa
![Page 58: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/58.jpg)
Courtesy Costas Busch - RPI 58
InputTime 2
Stack
q0
a b b b$
$,,,
bab
aa
![Page 59: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/59.jpg)
Courtesy Costas Busch - RPI 59
InputTime 3
Stack
q0
a b b b
$,,,
bab
aa
![Page 60: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/60.jpg)
Courtesy Costas Busch - RPI 60
InputTime 4
Stack
q0Halt and Reject
a b b b
$,,,
bab
aa
![Page 61: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/61.jpg)
Courtesy Costas Busch - RPI 61
Pushing Strings
q1 q2a, b w
Inputsymbol
Popsymbol
Pushstring
![Page 62: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/62.jpg)
Courtesy Costas Busch - RPI 62
q1 q2a, b cdf
a
b top
input
stack
a
Pusheh h
e
cdf
pushedstring
Example:
$ $
![Page 63: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/63.jpg)
Courtesy Costas Busch - RPI 63
Another NPDA example
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
NPDA M
}:{)( ba nnwML
![Page 64: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/64.jpg)
Courtesy Costas Busch - RPI 64
Time 0Inputa ab b b
currentstate
a
$Stack
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
Execution Example:
![Page 65: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/65.jpg)
Courtesy Costas Busch - RPI 65
Time 1Inputa ab b ba
$Stack
0
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
![Page 66: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/66.jpg)
Courtesy Costas Busch - RPI 66
Time 3Inputa bb b a
$Stack
a
$
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
0
![Page 67: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/67.jpg)
Courtesy Costas Busch - RPI 67
Time 4Inputa bb b a
$Stack
a1
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
![Page 68: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/68.jpg)
Courtesy Costas Busch - RPI 68
Time 5Inputa bb b a
$Stack
a11
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
![Page 69: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/69.jpg)
Courtesy Costas Busch - RPI 69
Time 6Inputa bb b a
$Stack
a1
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
1
![Page 70: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/70.jpg)
Courtesy Costas Busch - RPI 70
Time 7Inputa bb b a
$Stack
a1
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
![Page 71: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/71.jpg)
Courtesy Costas Busch - RPI 71
Time 8Inputa bb b a a
$Stack
$$, q1 q2
a, $ 0$a, 0 00a,1
b, $ 1$b, 1 11b, 0
accept
![Page 72: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/72.jpg)
Courtesy Costas Busch - RPI 72
Formalities for NPDAs
![Page 73: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/73.jpg)
Courtesy Costas Busch - RPI 73
q1 q2a, b w
)},{(),,( 21 wqbaq
Transition function:
![Page 74: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/74.jpg)
Courtesy Costas Busch - RPI 74
q1
q2wba ,
q3wba ,
)},(),,{(),,( 321 wqwqbaq
Transition function:
![Page 75: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/75.jpg)
Courtesy Costas Busch - RPI 75
Formal DefinitionNon-Deterministic Pushdown Automaton NPDA
),,,δ,Γ,Σ,( 0 FzqQM
States
Inputalphabet
Stackalphabet
Transitionfunction
Finalstates
Stackstartsymbol
Initialstate
![Page 76: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/76.jpg)
Courtesy Costas Busch - RPI 76
Instantaneous Description
),,( suq
Currentstate Remaining
input
Currentstackcontents
![Page 77: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/77.jpg)
Courtesy Costas Busch - RPI 77
a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b$aa
b, a
Time 4:
, , $ $
Example: Instantaneous Description$),,( 1 aaabbbq
a
![Page 78: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/78.jpg)
Courtesy Costas Busch - RPI 78
a, a
b, a q0 q1 q2 q3
Input
Stack
a a a b b b$aa
b, a
Time 5:
, , $ $
Example: Instantaneous Description$),,( 2 aabbq
a
![Page 79: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/79.jpg)
Courtesy Costas Busch - RPI 79
We write:
$),,($),,( 21 aabbqaaabbbq
Time 4 Time 5
![Page 80: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/80.jpg)
Courtesy Costas Busch - RPI 80
a, a
b, a q0 q1 q2 q3
b, a
, , $ $
,$),(,$),($),,($),,($),,($),,($),,(
,$),(,$),(
3222
111
10
qqabqaabbqaaabbbqaaabbbqaaabbbq
aaabbbqaaabbbq
A computation:
![Page 81: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/81.jpg)
Courtesy Costas Busch - RPI 81
,$),(,$),($),,($),,($),,($),,($),,(
,$),(,$),(
3222
111
10
qqabqaabbqaaabbbqaaabbbqaaabbbq
aaabbbqaaabbbq
For convenience we write:
,$),(,$),( 30 qaaabbbq
![Page 82: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/82.jpg)
Courtesy Costas Busch - RPI 82
Formal Definition
Language of NPDA :M
)}',,(),,(:{)( 0 sqswqwML f
Initial state Final state
)(ML
![Page 83: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/83.jpg)
Courtesy Costas Busch - RPI 83
Example:,$),(,$),( 30 qaaabbbq
a, a
b, a q0 q1 q2 q3
b, a
, , $ $
NPDA :M
)(MLaaabbb
![Page 84: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/84.jpg)
Courtesy Costas Busch - RPI 84
,$),(,$),( 30 qbaq nn
a, a
b, a q0 q1 q2 q3
b, a
, , $ $
NPDA :M
)(MLba nn
![Page 85: Pushdown Automata PDAs](https://reader036.fdocuments.net/reader036/viewer/2022081520/56816836550346895dddf55a/html5/thumbnails/85.jpg)
Courtesy Costas Busch - RPI 85
a, a
b, a q0 q1 q2 q3
b, a
, , $ $
NPDA :M
}0:{)( nbaML nnTherefore: