0% found this document useful (0 votes)
10 views

Chomsky Hierarchy Material

Uploaded by

ksai.mb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Chomsky Hierarchy Material

Uploaded by

ksai.mb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Chomsky Hierarchy

Chomsky Hierarchy represents the class of languages that are accepted by


the different machine. The category of language in Chomsky's Hierarchy is
as given below:

1. Type 0 known as Unrestricted Grammar.


2. Type 1 known as Context Sensitive Grammar.
3. Type 2 known as Context Free Grammar.
4. Type 3 Regular Grammar.

1
This is a hierarchy. Therefore every language of type 3 is also of type 2, 1 and 0.
Similarly, every language of type 2 is also of type 1 and type 0, etc

Type 3 Grammar:
Type-3 grammars generate regular languages. These languages are exactly
all languages that can be accepted by a finite-state automaton. Type 3 is
the most restricted form of grammar .

Type 3 Grammar is known as Regular Grammar. Regular languages are


those languages which can be described using regular expressions. These
languages can be modeled by NFA or DFA.

Type 3 is most restricted form of grammar. The Type 3 grammar should be


Type 2 and Type 1.

Type 3 should be in the given form only :


V --> VT / T (left-regular grammar)
(or)
V --> TV /T (right-regular grammar)
For example:
S --> a
The above form is called strictly regular grammar.
There is another form of regular grammar called extended regular grammar. In
this form:
V --> VT* / T*. (extended left-regular grammar)
(or)
V --> T*V /T* (extended right-regular grammar)
For example :
S --> ab.

Type 2 Grammar:
Type 2 Grammar is known as Context Free Grammar. Context free languages
are the languages which can be represented by the context free grammar
(CFG). Type 2 should be type 1.

The language generated by the grammar is recognized by a Pushdown


automata

The production rule is of the form

2
1. A → α
Where A is any single non-terminal and is any combination of terminals and non-
terminals

For example:

1. A → aBb
2. A → b
3. B → a
For example:
S --> AB
A --> a
B --> b
3. Type 1 grammar:
These grammars generate context-sensitive languages. These are of the form: α → β, with the
following condition |β| >=|α|,i.e. length of β is greater then length of α.

Type 1 grammar is known as Context Sensitive Grammar. The context


sensitive grammar is used to represent context sensitive language. The
context sensitive grammar follows the following rules:

o The context sensitive grammar may have more than one symbol on
the left hand side of their production rules.
o The number of symbols on the left-hand side must not exceed the
number of symbols on the right-hand side.
o The rule of the form A → ε is not allowed unless A is a start symbol. It
does not occur on the right-hand side of any rule.
o The Type 1 grammar should be Type 0.

For example:

1. S → AT
2. T → xy
3. A → a

3
Type 0 Grammar:
Type 0 grammar is known as Unrestricted grammar. There is no restriction
on the grammar rules of these types of languages. These languages can be
efficiently modeled by Turing machines.

Examples

1. bAa → aa
2. S → s

You might also like