Context Sensitive Language & Its Normal Form
Context Sensitive Language & Its Normal Form
CONTENTS:
1. CONTEXT SENSITIVE LANGUAGE a.Definition b.Example c.Properties 2. CONTEXT SENSITIVE GRAMMAR Defintion and example 3. KURODA NORMAL FORM a. Defintion b. Features c. Conversion of a grammar to kuroda normal form
SUBMITTED TO:
Lec. Sunny Sharma
SUBMITTED BY:
Meenakshi Dhiman MCA TYC(III) Roll no.2010 CSB 1029
EXAMPLE:
An example of a context-sensitive language that is not context-free is L = { ap : p is a prime number }. L can be shown to be a context-sensitive language by constructing a linear bounded automaton which accepts L. The language can easily be shown to be neither regular nor context free by applying the respective pumping lemmas for each of the language classes to L.
The concept of context-sensitive grammar was introduced by Noam Chomsky in the 1950s as a way to describe the syntax of natural language where it is indeed often the case that a word may or may not be appropriate in a certain place depending upon the context. A formal language that can be described by a context-sensitive grammar is called a contextsensitive language.
FORMAL DEFINITION:
A context sensitive grammar or type 1 grammar G consists of four tuples (V,T,P,S) where 1. V is the finite set of variables also called non-terminals. 2. T is the finite set of symbols called terminals that form the strings of language generated by the grammar.(V T=). 3. S is the special symbol called the start variable(sV). 4. P is the finite set of rules called the production rules of the form. 5. P:A Where A is the single non terminal i.e.AV and are the strings of terminal and non-terminals . is the left context and is the right context where and (V T)*.The string and may be empty. is the non empty string of non terminals and terminals. A
EXAMPLE:
This grammar generates the canonical non-context-free language :
More complicated grammars can be used to parse languages with even more letters. This language generates the non-context-free copy language,
, and other :
context sensitive grammar then it is said to be in normal form. The normal form in case of context sensitive grammar is KURODA NORMAL FORM.
KURODA NORMAL FORM: The Kuroda normal form is a concept of theoretical computer science , in connection with the context-sensitive languages is of interest. She is named after the linguist Sige-Yuki Kuroda named and describes a normal form of context-sensitive grammars , a subset of context-sensitive grammars, which loses over the amount of general context-sensitive grammars nothing in expressiveness. The importance of the Kuroda normal form is the very simple structure of the productions . The Kuroda normal form is a generalization of the Chomsky normal form , a normal form for context-free grammars.
DEFINITION: In formal language theory, a grammar is in Kuroda normal form if, and only if, all production rules are of the form:
AB CD or A BC or AB A where A, B, C and D are non terminal symbols and is a terminal symbol. Every grammar in Kuroda normal form is monotonic, and therefore, generates a contextsensitive language. Conversely, every context-sensitive language which does not generate the empty string can be generated by a grammar in Kuroda normal form. It is named for linguist S.Y. Kuroda.
FEATURES OF KURODA NORMAL FORM:
Every grammar in Kuroda normal form is a monotonic grammar . For each context-sensitive grammar G 1 with there exists a grammar G 2 in Kuroda normal form, which generates the same language, that is, L (G 1) = L (G 2). G 2 then also Kuroda normal form of context-sensitive grammar G is called 1.
All terminal symbols occurring in P 1 are replaced by a new variable terminal symbol a is the new productions introduced. Each production of the form be replaced by the following new productions: for all Here are Each production of the form For all For with , and . new variables.
A a,
all
. Here are new variables. The generated grammar is in Kuroda normal form and produces the same language as the grammar before.