l18-handout

l18-handout - Outline CF closure properties. Lecture 18:...

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

Lecture 18: More Properties of Context-Free Languages David Dill Department of Computer Science 1 Outline CF closure properties. CF decision properties. 2 Closure Properties Substitutions A substitution is sort of a generalized homomorphism, where we map each member of Σ to a language , not a string. a Σ , s ( a ) = L a , where L a is a language (over any alphabet) s ( ² ) = { ² } s ( xa ) = s ( x ) · s ( a ) ( note: · is concatenation of languages, not strings.) s ( L ) = S w L s ( w ) 3 Substitution Theorem Theorem Substituting CFLs for terminal symbols in a CFL results in a CFL. Proof sketch Given CFGs for everything, create a new CFG. Convert the terminals of the original CFG to sentence symbols from the substituted CFGs. Make sure variables of all CFGs are disjoint. 4

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

View Full Document
Closure Properties The book does this with substitutions. Direct constructions are also easy. Union – Given G 1 with sentence symbol S 1 , and G 2 with S 2 , make the nonterminals disjoint, add new sentence symbol S , and the productions S S 1 | S 2 . L ( G ) = L ( G 1
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 / 3

l18-handout - Outline CF closure properties. Lecture 18:...

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

View Full Document
Ask a homework question - tutors are online