Chomsky Hierarchy
- is aย containment hierarchyย of classes ofย grammars
- used to understand the complexity of Human Languages
syntax definitions:
- ๐ด,๐ต -ย non-terminals
- ๐,๐,๐ย - terminals
- ๐ผ,๐ฟ,๐ฝย - strings of terminals and/or nonterminals (MAYBE empty)
- ๐พ - a string of terminals and/or nonterminals (MUST be nonempty)
- ๐ - an empty stringย (i.e. the string of length 0)
|
Chomsky Type
Automaton Accepting Formal Grammar/Language |
Grammar Production Rules |
Example Languages |
|---|---|---|
Type-4
Memory Lookup |
are defined by rules of the forms:
|
grammar rules G:
language of G:
|
Type-3
|
regular grammar is EITHER left or right regular grammar:
|
grammar rules G:
language of G:
|
Type-2
|
defined by rules of the form:
|
grammar rules G:
language of G:
|
Type-1
|
defined byย rules of the form:
the ruleย ๐ด โ ๐ย is allowed ifย ๐ดย does not appear on the right side of any rule |
grammar rules G:
language of G:
|
Type-0.5
|
recursive grammarย if it containsย production rulesย that areย recursive, meaning that expanding a non-terminal according to these rules can eventually lead to a string that includes the same non-terminal again. Otherwise, it is called a non-recursive grammar | |
Type-0
|
defined byย rules of the form:
|
Every regular language is context-free, every context-free language is context-sensitive, every context-sensitive language is recursive, and every recursive language is recursively enumerable