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

CS402 (Formal Language and Automata Theory) : Chomsky Classification of Grammar

Formal grammars can be classified into different types based on Chomsky hierarchy. Type-0 grammars are the most general and generate recursively enumerable languages recognized by Turing machines. Type-1 grammars are context-sensitive and generate languages recognized by linear bounded automata. Type-2 grammars are context-free and generate languages recognized by pushdown automata. Type-3 grammars are regular and generate languages recognized by finite state automata. The document provides examples of each grammar type and explains their relationship to formal language theory.

Uploaded by

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

CS402 (Formal Language and Automata Theory) : Chomsky Classification of Grammar

Formal grammars can be classified into different types based on Chomsky hierarchy. Type-0 grammars are the most general and generate recursively enumerable languages recognized by Turing machines. Type-1 grammars are context-sensitive and generate languages recognized by linear bounded automata. Type-2 grammars are context-free and generate languages recognized by pushdown automata. Type-3 grammars are regular and generate languages recognized by finite state automata. The document provides examples of each grammar type and explains their relationship to formal language theory.

Uploaded by

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

CS402 (Formal Language and Automata Theory)

Chomsky classification of Grammar

Presented By:
NAME: PUNEET AGARWAL
ROLL NO: 13000117076
STREAM: CSE (A)
SEM: 4th
YEAR: 2019
INTRODUCTION

Formal Grammars
A formal grammar of this type consists of a finite set of production rules (left-hand side → right-hand side), where each
side consists of a finite sequence of the following symbols:
 a finite set of nonterminal symbols (indicating that some production rule can yet be applied)
 a finite set of terminal symbol (indicating that no production rule can be applied)
 a start symbol (a distinguished nonterminal symbol)
A formal grammar provides an axiom schema for (or generates) a formal language, which is a (usually infinite) set
of finite-length sequences of symbols that may be constructed by applying production rules to another sequence of
symbols (which initially contains just the start symbol). A rule may be applied by replacing an occurrence of the symbols
on its left-hand side with those that appear on its right-hand side. A sequence of rule applications is called a derivation.
Such a grammar defines the formal language: all words consisting solely of terminal symbols which can be reached by
a derivation from the start symbol.
Non-terminals are often represented by uppercase letters, terminals by lowercase letters, and the start symbol by S. For
example, the grammar with terminals {a, b}, non-terminals {S, A, B}, production rules
 S → AB
 S → ε (where ε is the empty string)
 A → aS
 B→b

The following is a simpler grammar that defines the same language: Terminals {a, b}, Non-terminals {S}, Start symbol S,
Production rules
 S → aSb
 S→ε
Formal Language

A grammar for a toy subset of English Language is given by:


Terminals
{generate, hate, great, green, ideas, linguists}
Non-terminals
{SENTENCE, NOUNPHRASE, VERBPHRASE, NOUN, VERB, ADJ}

Production rules
 SENTENCE → NOUNPHRASE VERBPHRASE
 NOUNPHRASE → ADJ NOUNPHRASE
 NOUNPHRASE → NOUN
 VERBPHRASE → VERB NOUNPHRASE
 VERBPHRASE → VERB
The Hierarchy

Grammar Languages Automaton

Recursively
Type-0 Turing machine
enumerable

Type-1 Context-sensitive Linear-bounded non-deterministic Turing machine

Type-2 Context-free Non-deterministic pushdown automaton

Type-3 Regular Finite state automaton


Types of Grammers

Type-0 grammars
Type-0 grammars include all formal grammars. They generate exactly all
languages that can be recognized by a Turing machine. These languages are
also known as the recursively enumerable or Turing-recognizable languages. Note
that this is different from the recursive languages, which can be decided by
an always-halting Turing machine.
Type-1 grammars
Type-1 grammars generate context-sensitive languages. These grammars have
rules of form with non-terminals. The rule is allowed if {\displaystyle S}does not
appear on the right side of any rule. The languages described by these grammars
are exactly all languages that can be recognized by a linear bounded
automation (a nondeterministic Turing machine whose tape is bounded by a
constant times the length of the input.)
Type-2 grammars
Type-2 grammars generate the context-free languages. These are defined by
rules of the form with being a nonterminal and being a string of terminals and/or
non-terminals. These languages are exactly all languages that can be
recognized by a non-deterministic pushdown automaton.
Type-3 grammars
Type-3 grammars generate the regular languages. Such a grammar restricts its
rules to a single nonterminal on the left-hand side and a right-hand side consisting
of a single terminal, possibly followed by a single nonterminal (right regular).
Alternatively, the right-hand side of the grammar can consist of a single terminal,
possibly preceded by a single nonterminal (left regular). These generate the same
languages.
CONCLUSION

After completion of this paper, a brief idea on the different types of


grammars as classified by Noam Chomsky can be understood clearly.
The basis of their classification can also be understood and furthermore
we also get to know about the significance of it.

It is an important topic in the syllabus of CS402 (Formal Language &


Automata Theory). So a paper for having a brief on the topic was
prepared and hence, successful.
REFERENCES

 https://www.tutorialspoint.com/ChomskyClassificationOfGram
mer
 Class notes
 Theory of Computer Science by K.L.P. Mishra and N.
Chandrasekaran
 https://en.m.wikipedia.org/wiki/ChomskyHierarchy
THANK YOU

You might also like