languages

Definition

Chomsky Hierarchy

The Chomsky hierarchy classifies formal languages by increasing expressive power. Its levels are regular languages (, context-free languages (, context-sensitive languages (), recursive language (), and recursively enumerable languages ().

Each class properly contains the one below it. Formally:

Closure

Operation
Unionyesyesyesyes
Concatenationyesyesyesyes
Kleene Staryesyesyesyes
Complementyesnoyesno
Intersectionyesnoyesyes
Intersection with Regular Languagesyesyesyesyes
Homomorphismsyesyesnoyes
-free homomorphismyesyesyesyes
gsm-mappingsyesyesnoyes
-free gsm-mappingsyesyesyesyes

Sub-languages

Being a subset does not determine the Chomsky type.

If , then can be of the same type as , a lower type, a higher type, or even lie outside the Chomsky hierarchy entirely.

Subset can have higher type

The regular language contains the context-sensitive language .

So a subset of a regular language can have higher Chomsky type than the language itself.

Subset can have lower type

The context-sensitive language contains the context-free language .

So a subset of a context-sensitive language can have lower Chomsky type than the language itself.

Subset can be arbitrary

The language is regular, but it contains every language over , including languages that are not even recursively enumerable.

So a subset of a regular language can be arbitrarily complex.

Types

Type 0 - Unconstrained

Definition

Grammar

A grammar is defined as 4-tuple , where

Without further constraints, is called unconstrained grammar or type-0 grammar and is the most general form of a grammar in the Chomsky hierarchy.

Link to original

Type 1 - Context-Sensitive

Definition

Context-Sensitive Grammar (Type-1)

A grammar is called context-sensitive (Type-1) if every production rule in is context-sensitive.

In words: a single non-terminal symbol may be replaced by a nonempty string, but only in its surrounding context.

Link to original

Type 2 - Context-Free

Definition

Context-Free Grammar

A grammar is called context-free if every production rule in is context-free.

Equivalently: A language is called context-free there exists a pushdown automaton that accepts it.

Link to original

Type 3 - Regular

Definition

Regular Grammar

A grammar is called regular if every production rule is regular.

Link to original