This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 14b: Decidable problems of context-free lan- guages The following decision problems about context-free 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
- Algorithms, Formal language, Context-free grammar, Chomsky NF