PushdownAutomata - Pushdown Automata Chapters 14-18...

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

View Full Document Right Arrow Icon
Pushdown Automata Chapters 14-18
Background image of page 1

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

View Full DocumentRight Arrow Icon
Generators vs. Recognizers For Regular Languages: regular expressions are generators FAs are recognizers For Context-free Languages CFGs are generators Pushdown Automata (PDAs) are recognizers
Background image of page 2
Languages generated by CFGs Languages defined by regular expressions All regular languages can be generated by CFGs and so can some non-regular languages
Background image of page 3

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

View Full DocumentRight Arrow Icon
PDA vs. FA Add a stack Each transition can specify optional push and pop operations using an independent alphabet use Λ (or e) to ignore stack operations a,e/A means with input ‘a’, pop nothing, push an ‘A’ Can use accepting states for success Or can just use an empty stack We’ll do both simultaneously (usually)
Background image of page 4
Example: a n b n X - + + Y a,e/A a,e/A b, A/e b, A/e
Background image of page 5

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

View Full DocumentRight Arrow Icon
Example: a n b n Every input ‘a’ pushes a ‘A’ on the stack Every input ‘b’ pops an ‘A’ off the stack if any other character appears, reject At end of input, the stack should be empty else the count was off, and we should reject Code: anbn.cpp
Background image of page 6
Example: PalindromeX Accepts strings of the form wcw R Pops the first half onto the stack We need the middle delimiter to know when to start comparing in reverse otherwise, the process would be non-deterministic each popped character should match the corresponding input character Diagram on next slide Code: palindromex.cpp
Background image of page 7

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

View Full DocumentRight Arrow Icon
PalindromeX - + a,e/a b,e/b c,e/e a,a/e b,b/e
Background image of page 8
Example: EvenPalindrome - + a,e/a b,e/b e,e/e a,a/e b,b/e No delimiter
Background image of page 9

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

View Full DocumentRight Arrow Icon
Determinism vs. Non-determinism Deterministic if: Only one transition exists for each combination of (q, a, X) = (state, input letter, stack top) If a = e, then no other rule exists for that q and X Other, multiple moves for the same state/input/stack are possible As long as an acceptable path exists, the machine accepts the input Interesting note: The class of languages accepted by NPDAs is larger than those accepted by DPDAs!
Background image of page 10
Languages accepted by nondeterministic PDA Languages accepted by deterministic PDA Languages accepted by FA or NFA or TG PDA more powerful than FA
Background image of page 11

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

View Full DocumentRight Arrow Icon
CFG => PDA Has two states: start, accepting Have an empty move from the
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2010 for the course CSE 555 taught by Professor Ffdfrg during the Spring '10 term at Academy of Design Tampa.

Page1 / 43

PushdownAutomata - Pushdown Automata Chapters 14-18...

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

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