Prof. Busch - LSU1 Pushdown Automata PDAs
Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States
Prof. Busch - LSU3 Initial Stack Symbol Stack bottomspecial symbol stack head top Appears at time 0
Prof. Busch - LSU4 The States Input symbol Pop symbol Push symbol
Prof. Busch - LSU5 top input stack Replace
Prof. Busch - LSU6 Push top input stack
Prof. Busch - LSU7 Pop top input stack
Prof. Busch - LSU8 No Change top input stack
Prof. Busch - LSU9 Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions
Prof. Busch - LSU10 Example PDA PDA :
Prof. Busch - LSU11 Basic Idea: 1.Push the a’s on the stack 2. Match the b’s on input with a’s on stack 3. Match found
Prof. Busch - LSU12 Execution Example: Input current state Time 0 Stack
Prof. Busch - LSU13 Input Time 1 Stack
Prof. Busch - LSU14 Input Stack Time 2
Prof. Busch - LSU15 Input Stack Time 3
Prof. Busch - LSU16 Input Stack Time 4
Prof. Busch - LSU17 Input Stack Time 5
Prof. Busch - LSU18 Input Stack Time 6
Prof. Busch - LSU19 Input Stack Time 7
Prof. Busch - LSU20 Input Time 8 accept Stack
Prof. Busch - LSU21 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
Prof. Busch - LSU22 Rejection Example: Input current state Time 0 Stack
Prof. Busch - LSU23 Rejection Example: Input current state Time 1 Stack
Prof. Busch - LSU24 Rejection Example: Input current state Time 2 Stack
Prof. Busch - LSU25 Rejection Example: Input current state Time 3 Stack
Prof. Busch - LSU26 Rejection Example: Input current state Time 4 Stack
Prof. Busch - LSU27 Rejection Example: Input current state Time 4 Stack reject
Prof. Busch - LSU28 The string is rejected by the PDA There is no accepting computation for
Prof. Busch - LSU29 Another PDA example PDA :
Prof. Busch - LSU30 Basic Idea: 1.Push v on stack 2. Guess middle of input 3. Match on input with v on stack 4. Match found
Prof. Busch - LSU31 Execution Example: Input Time 0 Stack
Prof. Busch - LSU32 Input Time 1 Stack
Prof. Busch - LSU33 Input Time 2 Stack
Prof. Busch - LSU34 Input Time 3 Stack Guess the middle of string
Prof. Busch - LSU35 Input Time 4 Stack
Prof. Busch - LSU36 Input Time 5 Stack
Prof. Busch - LSU37 Input Time 6 Stack accept
Prof. Busch - LSU38 Rejection Example: Input Time 0 Stack
Prof. Busch - LSU39 Input Time 1 Stack
Prof. Busch - LSU40 Input Time 2 Stack
Prof. Busch - LSU41 Input Time 3 Stack Guess the middle of string
Prof. Busch - LSU42 Input Time 4 Stack
Prof. Busch - LSU43 Input Time 5 Stack There is no possible transition. Input is not consumed
Prof. Busch - LSU44 Another computation on same string: Input Time 0 Stack
Prof. Busch - LSU45 Input Time 1 Stack
Prof. Busch - LSU46 Input Time 2 Stack
Prof. Busch - LSU47 Input Time 3 Stack
Prof. Busch - LSU48 Input Time 4 Stack
Prof. Busch - LSU49 Input Time 5 Stack No accept state is reached
Prof. Busch - LSU50 There is no computation that accepts string
Prof. Busch - LSU51 Pushing & Popping Strings Input symbol Push string Pop string
Prof. Busch - LSU52 top input stack Replace push string Example: pop string top
Prof. Busch - LSU53 pop push Equivalent transitions
Prof. Busch - LSU54 Another PDA example PDA
Prof. Busch - LSU55 Time 0 Input current state Stack Execution Example:
Prof. Busch - LSU56 Time 1 Input Stack
Prof. Busch - LSU57 Time 3 Input Stack
Prof. Busch - LSU58 Time 4 Input Stack
Prof. Busch - LSU59 Time 5 Input Stack
Prof. Busch - LSU60 Time 6 Input Stack
Prof. Busch - LSU61 Time 7 Input Stack
Prof. Busch - LSU62 Time 8 Input Stack accept
Prof. Busch - LSU63 Formalities for PDAs
Prof. Busch - LSU64 Transition function:
Prof. Busch - LSU65 Transition function:
Prof. Busch - LSU66 Formal Definition Pushdown Automaton (PDA) States Input alphabet Stack alphabet Transition function Accept states Stack start symbol Initial state
Prof. Busch - LSU67 Instantaneous Description Current state Remaining input Current stack contents
Prof. Busch - LSU68 Input Stack Time 4: Example:Instantaneous Description
Prof. Busch - LSU69 Input Stack Time 5: Example:Instantaneous Description
Prof. Busch - LSU70 We write: Time 4 Time 5
Prof. Busch - LSU71 A computation:
Prof. Busch - LSU72 For convenience we write:
Prof. Busch - LSU73 Language of PDA Language accepted by PDA : Initial state Accept state
Prof. Busch - LSU74 Example: PDA :
Prof. Busch - LSU75 PDA :
Prof. Busch - LSU76 PDA : Therefore: