singularity

#learnings

Build Your Own Lisp, Chapter 5

Chomsky Hierarchy

#1

LHS -[produces]-> RHS

Formal Grammar

Chomsky Hierarchy of Grammars and Languages


A Chomsky grammar is a finite mechanism that produces a usually infinite set of strings, a “language.” Unlike many other set generation mechanisms, this production process assigns a structure to the produced string, which can be utilized to attach semantics to it. For context-free (Type 2) grammars, this structure is a tree, which allows the semantics to be composed from the semantics of the branches. This is the basis of the importance of context-free grammars.


TYPE 0 GRAMMARS - REGULAR

TYPE 1 GRAMMARS - CONTEXT FREE

TYPE 2 GRAMMARS - CONTEXT SENSITIVE

TYPE 3 GRAMMARS - RECURSIVELY ENUMERABLE

TYPE 4* GRAMMARS - FINITE CHOICE GRAMMAR

2.6 Grammars that Produce the Empty Language 2.7 The Limitations of CF and FS Grammars


  1. By J. Finkelstein - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=9405226