11.01.2015 Views

Pushdown Automaton: CFL and the pumping lemma

Pushdown Automaton: CFL and the pumping lemma

Pushdown Automaton: CFL and the pumping lemma

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

From CFG to PDA<br />

Informally:<br />

1. Place <strong>the</strong> marker symbol $ <strong>and</strong> <strong>the</strong> start variable<br />

S on <strong>the</strong> stack.<br />

2. Repeat <strong>the</strong> following steps:<br />

– If <strong>the</strong> top of <strong>the</strong> stack is a variable A:<br />

Choose a rule A→ 1 … k <strong>and</strong> substitute A with 1 … k<br />

– If <strong>the</strong> top of <strong>the</strong> stack is a terminal a:<br />

Read next input symbol <strong>and</strong> compare to a<br />

If <strong>the</strong>y don’t match, reject (die)<br />

– If top of stack is $, go to accept state<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!