l15 - Lecture 15: Decision and closure properties of CFLs...

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

View Full Document Right Arrow Icon
Lecture 15: Decision and closure properties of CFLs David Dill Department of Computer Science 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Outline Closure properties of CFLs. Decision properties of CFLs 2
Background image of page 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 context-free language (over any alphabet) s ( ǫ ) = { ǫ } s ( xa ) = s ( x ) · s ( a ) ( note: · is concatenation of languages, not strings.) s ( L ) = u w L s ( w ) 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
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. Rename nonterminals all CFGs as necessary to make sure they are disjoint. Make a new CFG by converting the terminals of the original CFG to sentence symbols from the substituted CFGs, then take the union of all the productions. The result is a CFG for s(L). 4
Background image of page 4
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 ) L ( G 2 ) . Concatenation – Similarly, S S 1 S 2 . Kleene Closure – Similarly,
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

l15 - Lecture 15: Decision and closure properties of CFLs...

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