PDA - Pushdown Automata PDAs Pushdown Automaton -- PDA...

Info iconThis preview shows pages 1–22. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Pushdown Automata PDAs Pushdown Automaton -- PDA Input String Stack States Initial Stack Symbol Stack $ Stack z bottom special symbol stack head top Appears at time 0 The States q 1 q 2 a , b → c Input symbol Pop symbol Push symbol q 1 q 2 a , b → c a b top input stack a Replace e h $ e h $ c q 1 q 2 a , λ → c a a Push b e h $ e h $ b c top input stack q 1 q 2 a , b → λ a a Pop b e h $ e h $ top input stack q 1 q 2 a , λ → λ a a No Change b e h $ e h $ b top input stack q 1 q 2 c b a → , a Pop top input stack Pop from Empty Stack Automaton halts! If the automaton attempts to pop from empty stack then it halts and rejects input Non-Determinism q 1 q 2 a , b → c q 3 a , b → c q 1 q 2 λ , b → c transition- λ PDAs are non-deterministic Allowed non-deterministic transitions Example PDA λ , λ → λ a , λ → a b , a → λ q q 1 q 2 q 3 b , a → λ λ , $ → $ PDA : M } : { ) ( ≥ = n b a M L n n λ , λ → λ a , λ → a b , a → λ q q 1 q 2 q 3 b , a → λ λ , $ → $ } : { ) ( ≥ = n b a M L n n 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 a , λ → a b , a → λ q q 1 q 2 q 3 Execution Example: Input a a a b b b current state b , a → λ Time 0 λ , λ → λ λ , $ → $ Stack $ a , λ → a b , a → λ q q 1 q 2 q 3 Input a a a b b b b , a → λ Time 1 λ , λ → λ λ , $ → $ Stack $ a , λ → a b , a → λ q q 1 q 2 q 3 Input Stack a a a b b b $ a b , a → λ Time 2 λ , λ → λ λ , $ → $ a , λ → a b , a → λ q q 1 q 2 q 3 Input Stack a a a b b b $ a a b , a → λ Time 3 λ , λ → λ λ , $ → $ a , λ → a b , a → λ q q 1 q 2 q 3 Input Stack a a a b b b $ a a a b , a → λ Time 4 λ , λ → λ λ , $ → $ a , λ → a b , a → λ q q 1 q 2 q 3 Input a a a b b b Stack $ a a a b , a → λ Time 5 λ , λ → λ λ , $ → $ a , λ → a b , a → λ q q 1 q 2 q 3 Input a a a b b b $ a Stack b , a → λ Time 6 λ , λ → λ λ , $ → $ a a , λ → a b , a → λ q q 1 q 2 q 3 Input a a a b b b $ Stack b , a → λ Time 7 λ , λ → λ λ , $ → $ a a , λ → a b , a → λ q q 1 q 2 q 3 Input a a a b b b b , a → λ Time 8 accept λ , λ → λ λ , $ → $ $ Stack A string is accepted if there is...
View Full Document

This note was uploaded on 12/02/2011 for the course AR 107 taught by Professor Gracegraham during the Fall '11 term at Montgomery College.

Page1 / 77

PDA - Pushdown Automata PDAs Pushdown Automaton -- PDA...

This preview shows document pages 1 - 22. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online