automata-5 - Automata Chapter 5. Context-Free Languages 5....

Info iconThis preview shows pages 1–6. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Automata Chapter 5. Context-Free Languages 5. Context-Free Languages With L={a n b n : n 0}, Let h(a) = (, h(b) = ) Then (()) and ((())) are in L. Nested structure in programming languages. We need something beyond regular languages context-free languages Parsing : explain a sentence through its grammatical derivation . 5.1 Context-Free Grammars Definition 5.1 A grammar G=(V, T, S, P) is context-free if all productions in P have the form A x , where A V and x (V T)* . A language L is context-free iff 5 a context-free grammar G such that L=L(G). Regular languages .vs. Context-free languages ? 5.1 Context-Free Grammars Ex 5.1 G =({S}, {a, b}, S, P) with productions S aSa, S bSb, S L(G) =? Ex 5.2 S abB, A aaBb, B bbAa, A Ex 5.3 Show L={a n b m : n m} is context-free Linear grammar vs context-free grammar? 5.1 Context-Free Grammars Definition 5.2 A derivation is leftmost if in each step the leftmost variable in the sentential form is replaced. If in each step the rightmost variable is replaced, we call the derivation rightmost ....
View Full Document

Page1 / 17

automata-5 - Automata Chapter 5. Context-Free Languages 5....

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

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