l16-handout

l16-handout - Lecture 16: Context-Free Languages Outline...

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

View Full Document Right Arrow Icon
Lecture 16: Context-Free Languages David Dill Department of Computer Science 1 Outline Context-free languages. 2 Context-Free Languages Regular languages have many wonderful properties, but not all languages are regular. Next, we’ll study a more powerful class of languages, the context-free langauges . Context-free languages were identified in the 1950’s by linguist Noam Chomsky, as a natural place in a hierarchy of languages, which included the regular languages. 3 Formal Definition of Context-Free Grammars A CFG is a 4-tuple ( V, T, P, S ) V is a finite set of non-terminal symbols , T is a finite set of variables (AKA terminal symbols ), P V × ( V T ) * is a finite set of productions , and S V is the Sentence symbol V and T must be disjoint sets. Productions are written A aBc . A is the left-hand side (LHS), also called the head , and aBc is the right-hand side (RHS), also called the body. 4
Background image of page 1

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

View Full DocumentRight Arrow Icon
Notation a, b, c, 0 , 1 , . . . are terminals A, B, S, . . . are non-terminals w, x, y, z are terminal strings ( T * ) α, β, γ are strings of terminals and/or non-terminals ( ( V T ) * ). Several productions with common heads can be combined: A a | Aa | bAb 5 Outline Language of a grammar Ambiguity Push Down Automata introduction
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2011 for the course CS 154 taught by Professor Motwani,r during the Winter '08 term at Stanford.

Page1 / 5

l16-handout - Lecture 16: Context-Free Languages Outline...

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

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