80 likes | 201 Views
A New Normal Form for Context-Sensitive Grammars. Presenter: Peter Varga Co-author: Benedek Nagy. Context-Free derivation trees. An upper bound can be given for the derivation tree’s depth in case of context-free grammars, if we use Chomsky normal form:.
E N D
A New Normal Form for Context-Sensitive Grammars Presenter: Peter Varga Co-author: Benedek Nagy
Context-Free derivation trees An upper bound can be given for the derivation tree’s depth in case of context-free grammars, if we use Chomsky normal form:
Derivation tree for context-sensitive grammars In the case of context-sensitive grammars a derivation tree can be given as well with the use of Penttonen normal form. In this tree there will be context branches: Penttonen normal form: Aa ABC ABAC
The problem is the following: A derivation of a finite word can be arbitrarily long because of those rules where the length of the left side equals with the length of the right side. Derivation tree for context-sensitive grammars
In this example the depth of the tree for a finite word has to be exponentially large.
Iteration-free normal form • Definition (Iteration-free normal form): A rule set called H is in iteration-free normal form, if H is in Penttonen normal form, and does not contain any context-sensitive iteration with the same context. • Theorem: Any grammar in Penttonen normal form can be derived to a grammar which is in iteration-free normal form, and the original and the derived grammar generates the same language.
The derivation tree with the use of the iteration-free normal form
Summary Context-free grammars Context-sensitive grammars Chomsky normal form Penttonen normal form Iteration-free normal form Finite derivation tree