Courtesy Costas Busch - RPI1 Pushdown Automata PDAs
Courtesy Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States
Courtesy Costas Busch - RPI3 Initial Stack Symbol Stack bottom special symbol stack head top
Courtesy Costas Busch - RPI4 The States Input symbol Pop symbol Push symbol Alternatively
Courtesy Costas Busch - RPI5 top input stack Replace
Courtesy Costas Busch - RPI6 Push top input stack
Courtesy Costas Busch - RPI7 Pop top input stack
Courtesy Costas Busch - RPI8 No Change top input stack
Courtesy Costas Busch - RPI9 Pop top input stack A Possible Transition empty
Courtesy Costas Busch - RPI10 input A Bad Transition The automaton Halts in state and Rejects the input string Empty stack HALT
Courtesy Costas Busch - RPI11 input A Bad Transition The automaton Halts in state and Rejects the input string Empty stack HALT
Courtesy Costas Busch - RPI12 No transition is allowed to be followed When the stack is empty Empty stack
Courtesy Costas Busch - RPI13 Pop top input stack A Good Transition
Courtesy Costas Busch - RPI14 Non-Determinism These are allowed transitions in a Non-deterministic PDA (NPDA)
Courtesy Costas Busch - RPI15 NPDA: Non-Deterministic PDA Example:
Courtesy Costas Busch - RPI16 Execution Example: Input current state Time 0 Stack
Courtesy Costas Busch - RPI17 Input Time 1 Stack
Courtesy Costas Busch - RPI18 Input Stack Time 2
Courtesy Costas Busch - RPI19 Input Stack Time 3
Courtesy Costas Busch - RPI20 Input Stack Time 4
Courtesy Costas Busch - RPI21 Input Stack Time 5
Courtesy Costas Busch - RPI22 Input Stack Time 6
Courtesy Costas Busch - RPI23 Input Stack Time 7
Courtesy Costas Busch - RPI24 Input Time 8 accept Stack
Courtesy 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
Courtesy Costas Busch - RPI26 The input string is accepted by the NPDA:
Courtesy Costas Busch - RPI27 is the language accepted by the NPDA: In general,
Courtesy Costas Busch - RPI28 Another NPDA example NPDA
Courtesy Costas Busch - RPI29 Execution Example: Input Time 0 Stack
Courtesy Costas Busch - RPI30 Input Time 1 Stack
Courtesy Costas Busch - RPI31 Input Time 2 Stack
Courtesy Costas Busch - RPI32 Input Time 3 Stack Guess the middle of string
Courtesy Costas Busch - RPI33 Input Time 4 Stack
Courtesy Costas Busch - RPI34 Input Time 5 Stack
Courtesy Costas Busch - RPI35 Input Time 6 Stack accept
Courtesy Costas Busch - RPI36 Rejection Example: Input Time 0 Stack
Courtesy Costas Busch - RPI37 Input Time 1 Stack
Courtesy Costas Busch - RPI38 Input Time 2 Stack
Courtesy Costas Busch - RPI39 Input Time 3 Stack Guess the middle of string
Courtesy Costas Busch - RPI40 Input Time 4 Stack
Courtesy Costas Busch - RPI41 Input Time 5 Stack There is no possible transition. Input is not consumed
Courtesy Costas Busch - RPI42 Another computation on same string: Input Time 0 Stack
Courtesy Costas Busch - RPI43 Input Time 1 Stack
Courtesy Costas Busch - RPI44 Input Time 2 Stack
Courtesy Costas Busch - RPI45 Input Time 3 Stack
Courtesy Costas Busch - RPI46 Input Time 4 Stack
Courtesy Costas Busch - RPI47 Input Time 5 Stack No final state is reached
Courtesy Costas Busch - RPI48 There is no computation that accepts string
Courtesy 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
Courtesy 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
Courtesy Costas Busch - RPI51 Another NPDA example NPDA
Courtesy Costas Busch - RPI52 Execution Example: Input Time 0 Stack
Courtesy Costas Busch - RPI53 Input Time 1 Stack
Courtesy Costas Busch - RPI54 Input Time 2 Stack
Courtesy Costas Busch - RPI55 Input Time 3 Stack accept
Courtesy Costas Busch - RPI56 Rejection example: Input Time 0 Stack
Courtesy Costas Busch - RPI57 Input Time 1 Stack
Courtesy Costas Busch - RPI58 Input Time 2 Stack
Courtesy Costas Busch - RPI59 Input Time 3 Stack
Courtesy Costas Busch - RPI60 Input Time 4 Stack Halt and Reject
Courtesy Costas Busch - RPI61 Pushing Strings Input symbol Pop symbol Push string
Courtesy Costas Busch - RPI62 top input stack Push pushed string Example:
Courtesy Costas Busch - RPI63 Another NPDA example NPDA
Courtesy Costas Busch - RPI64 Time 0 Input current state Stack Execution Example:
Courtesy Costas Busch - RPI65 Time 1 Input Stack
Courtesy Costas Busch - RPI66 Time 3 Input Stack
Courtesy Costas Busch - RPI67 Time 4 Input Stack
Courtesy Costas Busch - RPI68 Time 5 Input Stack
Courtesy Costas Busch - RPI69 Time 6 Input Stack
Courtesy Costas Busch - RPI70 Time 7 Input Stack
Courtesy Costas Busch - RPI71 Time 8 Input Stack accept
Courtesy Costas Busch - RPI72 Formalities for NPDAs
Courtesy Costas Busch - RPI73 Transition function:
Courtesy Costas Busch - RPI74 Transition function:
Courtesy Costas Busch - RPI75 Formal Definition Non-Deterministic Pushdown Automaton NPDA States Input alphabet Stack alphabet Transition function Final states Stack start symbol Initial state
Courtesy Costas Busch - RPI76 Instantaneous Description Current state Remaining input Current stack contents
Courtesy Costas Busch - RPI77 Input Stack Time 4: Example:Instantaneous Description
Courtesy Costas Busch - RPI78 Input Stack Time 5: Example:Instantaneous Description
Courtesy Costas Busch - RPI79 We write: Time 4 Time 5
Courtesy Costas Busch - RPI80 A computation:
Courtesy Costas Busch - RPI81 For convenience we write:
Courtesy Costas Busch - RPI82 Formal Definition Language of NPDA : Initial state Final state
Courtesy Costas Busch - RPI83 Example: NPDA :
Courtesy Costas Busch - RPI84 NPDA :
Courtesy Costas Busch - RPI85 NPDA : Therefore: