All Topics  
Chomsky hierarchy

 

   Email Print
   Bookmark   Link






 

Chomsky hierarchy



 
 
Within the field of computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, specifically in the area of formal languages, the Chomsky hierarchy (occasionally referred to as Chomsky–Schützenberger hierarchy) is a containment hierarchy
Containment hierarchy

A containment hierarchy is a hierarchical collection of strictly nested Set . Each entry in the hierarchy designates a set such that the previous entry is a strict superset, and the next entry is a strict subset....
 of classes of formal grammar
Formal grammar

In formal language theory, grammars, also called formal grammars or generative grammars, are a formalism used to describe formal languages – i.e....
s.

This hierarchy of grammars was described by Noam Chomsky
Noam Chomsky

Avram Noam Chomsky is an United States linguistics, philosopher, cognitive science, political activist, author, and lecturer. He is an Institute Professor emeritus and professor emeritus of linguistics at the Massachusetts Institute of Technology....
 in 1956 (see [1]). It is also named after Marcel-Paul Schützenberger
Marcel-Paul Schützenberger

Marcel-Paul "Marco" Sch?tzenberger was a France mathematician and Doctor of Medicine. His work had impact across the fields of formal language, combinatorics, and information theory....
 who played a crucial role in the development of the theory of formal language
Formal language

A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
s.

Formal grammars
A formal grammar of this type consists of:



A formal grammar defines (or generates) a formal language, which is a (usually infinite) set of finite-length sequences of symbols (i.e.






Discussion
Ask a question about 'Chomsky hierarchy'
Start a new discussion about 'Chomsky hierarchy'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Within the field of computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, specifically in the area of formal languages, the Chomsky hierarchy (occasionally referred to as Chomsky–Schützenberger hierarchy) is a containment hierarchy
Containment hierarchy

A containment hierarchy is a hierarchical collection of strictly nested Set . Each entry in the hierarchy designates a set such that the previous entry is a strict superset, and the next entry is a strict subset....
 of classes of formal grammar
Formal grammar

In formal language theory, grammars, also called formal grammars or generative grammars, are a formalism used to describe formal languages – i.e....
s.

This hierarchy of grammars was described by Noam Chomsky
Noam Chomsky

Avram Noam Chomsky is an United States linguistics, philosopher, cognitive science, political activist, author, and lecturer. He is an Institute Professor emeritus and professor emeritus of linguistics at the Massachusetts Institute of Technology....
 in 1956 (see [1]). It is also named after Marcel-Paul Schützenberger
Marcel-Paul Schützenberger

Marcel-Paul "Marco" Sch?tzenberger was a France mathematician and Doctor of Medicine. His work had impact across the fields of formal language, combinatorics, and information theory....
 who played a crucial role in the development of the theory of formal language
Formal language

A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
s.

Formal grammars


A formal grammar of this type consists of:

  • a finite set of terminal symbols
  • a finite set of nonterminal symbols
  • a finite set of production rules with a left and a right-hand side consisting of a sequence of these symbols
  • a start symbol


A formal grammar defines (or generates) a formal language, which is a (usually infinite) set of finite-length sequences of symbols (i.e. strings
String (computer science)

In computer programming and some branches of mathematics, a string is an ordered sequence of symbols. These symbols are chosen from a predetermined set or alphabet....
) 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 to a sequence of symbols by replacing an occurrence of the symbols on the left-hand side of the rule with those that appear on the 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.

Nonterminals are usually represented by uppercase letters, terminals by lowercase letters, and the start symbol by . For example, the grammar with terminals , nonterminals , production rules
ε (where ε is the empty string)
and start symbol , defines the language of all words of the form (i.e. copies of followed by copies of ). The following is a simpler grammar that defines the same language: Terminals , Nonterminals , Start symbol , Production rules
ε


The hierarchy

The Chomsky hierarchy consists of the following levels:

  • Type-0 grammars (unrestricted grammar
    Unrestricted grammar

    In formal language theory, an unrestricted grammar is a formal grammar on which no restrictions are made on the left and right sides of the grammar's productions....
    s) include all formal grammars. They generate exactly all languages that can be recognized by a Turing machine
    Turing machine

    Turing machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm....
    . These languages are also known as the recursively enumerable language
    Recursively enumerable language

    In mathematics, logic and computer science, a recursively enumerable language is a type of formal language which is also called partially decidable or Turing-recognizable....
    s. Note that this is different from the recursive language
    Recursive language

    A recursive language in mathematics, logic and computer science is a type of formal language which is also called decidable or Turing-decidable....
    s which can be decided by an always-halting Turing machine
    Machine that always halts

    In computability theory, a machine that always halts?also called a decider or a total Turing machine ?is a Turing machine that halts for every input....
    .
  • Type-1 grammars (context-sensitive grammar
    Context-sensitive grammar

    A context-sensitive grammar is a formal grammar in which the left-hand sides and right-hand sides of any production rules may be surrounded by a context of terminal symbol and nonterminal symbols....
    s) generate the context-sensitive language
    Context-sensitive language

    In theoretical computer science, a context-sensitive language is a formal language that can be defined by a context-sensitive grammar. That is one of the four types of grammars in the Chomsky hierarchy....
    s. These grammars have rules of the form with a nonterminal and , and strings of terminals and nonterminals. The strings and may be empty, but must be nonempty. The rule is allowed if 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 automaton
    Linear bounded automaton

    A linear bounded automaton is a restricted form of a non-deterministic Turing machine. It possesses a tape made up of cells that can contain symbols from a finite set alphabet, a head that can read from or write to one cell on the tape at a time and can be moved, and a finite number of states....
     (a nondeterministic Turing machine whose tape is bounded by a constant times the length of the input.)
  • Type-2 grammars (context-free grammar
    Context-free grammar

    In formal language theory, a context-free grammar is a formal grammar in which every Production rule is of the formwhere V is a single nonterminal symbol, and w is a string of Terminal and nonterminal symbolss and/or nonterminals ....
    s) generate the context-free language
    Context-free language

    In formal language theory, a context-free language is a formal language generated by some context-free grammar. The set of all context-free languages is identical to the set of languages accepted by pushdown automaton....
    s. These are defined by rules of the form with a nonterminal and a string of terminals and nonterminals. These languages are exactly all languages that can be recognized by a non-deterministic pushdown automaton
    Pushdown automaton

    In automata theory, a pushdown automaton is a finite state machine that can make use of a Stack containing data....
    . Context free languages are the theoretical basis for the syntax of most programming language
    Programming language

    A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
    s.
  • Type-3 grammars (regular grammar
    Regular grammar

    Strictly regular grammars In computer science, a right regular grammar is a formal grammar such that all the production rules in P are of one of the following forms:...
    s) generate the regular language
    Regular language

    In theoretical computer science, a regular language is a formal language that satisfies the following equivalent properties:* it can be accepted by a deterministic finite state machine...
    s. 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 (or preceded, but not both in the same grammar) by a single nonterminal. The rule is also allowed here if does not appear on the right side of any rule. These languages are exactly all languages that can be decided by a finite state automaton. Additionally, this family of formal languages can be obtained by regular expressions. Regular languages are commonly used to define search patterns and the lexical structure of programming languages.


Note that the set of grammars corresponding to recursive languages is not a member of this hierarchy.

Every regular language is context-free, every context-free language is context-sensitive and every context-sensitive language is recursive and every recursive language is recursively enumerable. These are all proper inclusions, meaning that there exist recursively enumerable languages which are not context-sensitive, context-sensitive languages which are not context-free and context-free languages which are not regular.

The following table summarizes each of Chomsky's four types of grammars, the class of language it generates, the type of automaton that recognizes it, and the form its rules must have.

Grammar Languages Automaton Production rules (constraints)
Type-0 Recursively enumerable
Recursively enumerable language

In mathematics, logic and computer science, a recursively enumerable language is a type of formal language which is also called partially decidable or Turing-recognizable....
Turing machine
Turing machine

Turing machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm....
(no restrictions)
Type-1 Context-sensitive
Context-sensitive grammar

A context-sensitive grammar is a formal grammar in which the left-hand sides and right-hand sides of any production rules may be surrounded by a context of terminal symbol and nonterminal symbols....
Linear-bounded non-deterministic Turing machine
Linear bounded automaton

A linear bounded automaton is a restricted form of a non-deterministic Turing machine. It possesses a tape made up of cells that can contain symbols from a finite set alphabet, a head that can read from or write to one cell on the tape at a time and can be moved, and a finite number of states....
Type-2 Context-free
Context-free grammar

In formal language theory, a context-free grammar is a formal grammar in which every Production rule is of the formwhere V is a single nonterminal symbol, and w is a string of Terminal and nonterminal symbolss and/or nonterminals ....
Non-deterministic pushdown automaton
Pushdown automaton

In automata theory, a pushdown automaton is a finite state machine that can make use of a Stack containing data....
Type-3 Regular
Regular grammar

Strictly regular grammars In computer science, a right regular grammar is a formal grammar such that all the production rules in P are of one of the following forms:...
Finite state automaton
and


However, there are further categories of formal languages, some of which are given in the following table:


See also

  • Formal language
    Formal language

    A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....


External links