This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 14b: Decidable problems of contextfree lan guages The following decision problems about contextfree gram mar are decidable, i.e., there exist algorithms for solving them. 1. Given a CFG G and a string w , does G generate w ? 2. Given a CFG G , is e ∈ L ( G )? 3. Given a CFG G , is L ( G ) = ∅ ? There are no algorithms to decide 1. Given two CFGs G 1 and G 2 , is L ( G 1 ) ⊆ L ( G 2 )? 2. Given two CFGs G 1 and G 2 , is L ( G 1 ) = L ( G 2 )? 1 First, we state without proof the following theorem: Every CFG can be converted to the Chomsky normal form. Every rule of a CFG in Chomsky Normal form is of the form: X → Y Z or X → σ , where X, Y, Z are nonterminals, and σ is a terminal. There are no rules of the form X → e unless X is the start variable (i.e., e ∈ L ). Why is CNF useful? If a CFG G is in Chomsky NF, then a derivation of a string of length n is exactly 2 n − 1 steps long....
View
Full
Document
 Spring '10
 Prof.Tai
 Algorithms

Click to edit the document details