|
|||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||
In computer science, a formal grammar is said to be in Chomsky normal form if all of its production rules are of the form:
where A, B and C are nonterminal symbols, α is a terminal symbol (a symbol that represents a constant value), S is the start symbol, and λ is the empty string. Also, neither B nor C may be the start symbol. Every grammar in Chomsky normal form is context-free, and conversely, every context-free grammar can be efficiently transformed into an equivalent one which is in Chomsky normal form. With the exception of the optional rule S Because of these properties, many proofs in the field of languages and computability make use of the Chomsky normal form. These properties also yield various efficient algorithms based on grammars in Chomsky normal form; for example, the CYK algorithm that decides whether a given string can be generated by a given grammar uses the Chomsky normal form. The Chomsky normal form is named after Noam Chomsky, the US linguist who invented the Chomsky hierarchy. Alternative definitionSome sources define Chomsky normal form in the following slightly different way: A formal grammar is in Chomsky normal form if all of its production rules are of the form:
where A, B and C are nonterminal symbols, and α is a terminal symbol. When using this definition, B or C may be the start symbol. This definition differs from the previous one in that it precludes the possibility that the grammar will generate the empty string, λ. It remains true that any context-free grammar accepting a language L can be efficiently transformed into a grammar in Chomsky normal form that accepts L-{λ}. The principal advantage of this later definition is that proofs are generally marginally simpler, due to the fact that each step in a derivation never decreases the length of the resulting string. Its disadvantage, of course, is that special consideration is needed if the original grammar generated λ. See alsoReferences
|
| All Right Reserved © 2007, Designed by Stylish Blog. |