Download presentation
Presentation is loading. Please wait.
1
Costas Busch - RPI1 Pushdown Automata PDAs
2
Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States
3
Costas Busch - RPI3 Initial Stack Symbol Stack bottom special symbol stack head top
4
Costas Busch - RPI4 The States Input symbol Pop symbol Push symbol
5
Costas Busch - RPI5 top input stack Replace
6
Costas Busch - RPI6 Push top input stack
7
Costas Busch - RPI7 Pop top input stack
8
Costas Busch - RPI8 No Change top input stack
9
Costas Busch - RPI9 Pop top input stack A Possible Transition empty
10
Costas Busch - RPI10 input A Bad Transition The automaton Halts in state and Rejects the input string Empty stack HALT
11
Costas Busch - RPI11 input A Bad Transition The automaton Halts in state and Rejects the input string Empty stack HALT
12
Costas Busch - RPI12 No transition is allowed to be followed When the stack is empty Empty stack
13
Costas Busch - RPI13 Pop top input stack A Good Transition
14
Costas Busch - RPI14 Non-Determinism These are allowed transitions in a Non-deterministic PDA (NPDA)
15
Costas Busch - RPI15 NPDA: Non-Deterministic PDA Example:
16
Costas Busch - RPI16 Execution Example: Input current state Time 0 Stack
17
Costas Busch - RPI17 Input Time 1 Stack
18
Costas Busch - RPI18 Input Stack Time 2
19
Costas Busch - RPI19 Input Stack Time 3
20
Costas Busch - RPI20 Input Stack Time 4
21
Costas Busch - RPI21 Input Stack Time 5
22
Costas Busch - RPI22 Input Stack Time 6
23
Costas Busch - RPI23 Input Stack Time 7
24
Costas Busch - RPI24 Input Time 8 accept Stack
25
Costas Busch - RPI25 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
Costas Busch - RPI26 The input string is accepted by the NPDA:
27
Costas Busch - RPI27 is the language accepted by the NPDA: In general,
28
Costas Busch - RPI28 NPDA example NPDA
29
Costas Busch - RPI29 Execution Example: Input Time 0 Stack
30
Costas Busch - RPI30 Input Time 1 Stack
31
Costas Busch - RPI31 Input Time 2 Stack
32
Costas Busch - RPI32 Input Time 3 Stack Guess the middle of string
33
Costas Busch - RPI33 Input Time 4 Stack
34
Costas Busch - RPI34 Input Time 5 Stack
35
Costas Busch - RPI35 Input Time 6 Stack accept
36
Costas Busch - RPI36 Rejection Example: Input Time 0 Stack
37
Costas Busch - RPI37 Input Time 1 Stack
38
Costas Busch - RPI38 Input Time 2 Stack
39
Costas Busch - RPI39 Input Time 3 Stack Guess the middle of string
40
Costas Busch - RPI40 Input Time 4 Stack
41
Costas Busch - RPI41 Input Time 5 Stack There is no possible transition. Input is not consumed
42
Costas Busch - RPI42 Another computation on same string: Input Time 0 Stack
43
Costas Busch - RPI43 Input Time 1 Stack
44
Costas Busch - RPI44 Input Time 2 Stack
45
Costas Busch - RPI45 Input Time 3 Stack
46
Costas Busch - RPI46 Input Time 4 Stack
47
Costas Busch - RPI47 Input Time 5 Stack No final state is reached
48
Costas Busch - RPI48 There is no computation that accepts string
49
Costas Busch - RPI49 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
Costas Busch - RPI50 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
Costas Busch - RPI51 Another NPDA example NPDA
52
Costas Busch - RPI52 Execution Example: Input Time 0 Stack
53
Costas Busch - RPI53 Input Time 1 Stack
54
Costas Busch - RPI54 Input Time 2 Stack
55
Costas Busch - RPI55 Input Time 3 Stack accept
56
Costas Busch - RPI56 Rejection example: Input Time 0 Stack
57
Costas Busch - RPI57 Input Time 1 Stack
58
Costas Busch - RPI58 Input Time 2 Stack
59
Costas Busch - RPI59 Input Time 3 Stack
60
Costas Busch - RPI60 Input Time 4 Stack Halt and Reject
61
Costas Busch - RPI61 Pushing Strings Input symbol Pop symbol Push string
62
Costas Busch - RPI62 top input stack Push pushed string Example:
63
Costas Busch - RPI63 Another NPDA example NPDA
64
Costas Busch - RPI64 Time 0 Input current state Stack Execution Example:
65
Costas Busch - RPI65 Time 1 Input Stack
66
Costas Busch - RPI66 Time 3 Input Stack
67
Costas Busch - RPI67 Time 4 Input Stack
68
Costas Busch - RPI68 Time 5 Input Stack
69
Costas Busch - RPI69 Time 6 Input Stack
70
Costas Busch - RPI70 Time 7 Input Stack
71
Costas Busch - RPI71 Time 8 Input Stack accept
72
Costas Busch - RPI72 Formalities for NPDAs
73
Costas Busch - RPI73 Transition function:
74
Costas Busch - RPI74 Transition function:
75
Costas Busch - RPI75 Formal Definition Non-Deterministic Pushdown Automaton NPDA States Input alphabet Stack alphabet Transition function Final states Stack start symbol Initial state
76
Costas Busch - RPI76 Instantaneous Description Current state Remaining input Current stack contents
77
Costas Busch - RPI77 Input Stack Time 4: Example:Instantaneous Description
78
Costas Busch - RPI78 Input Stack Time 5: Example:Instantaneous Description
79
Costas Busch - RPI79 We write: Time 4 Time 5
80
Costas Busch - RPI80 A computation:
81
Costas Busch - RPI81 For convenience we write:
82
Costas Busch - RPI82 Formal Definition Language of NPDA : Initial state Final state
83
Costas Busch - RPI83 Example: NPDA :
84
Costas Busch - RPI84 NPDA :
85
Costas Busch - RPI85 NPDA : Therefore:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.