CS 331 Spring 2009  >  Additional Lecture Notes for Monday, January 26, 2009

CS 331 Spring 2009
Additional Lecture Notes for Monday, January 26, 2009

The following material was covered in class, in addition to the material from the text.

The Chomsky Hierarchy

In the late 1950s, linguist Noam Chomsky published a hierarchy of types of languages, defined in terms of the kinds of grammars that could describe them. Chomsky was trying to develop a framework for studying natural languages (e.g., English); however, his hierarchy has been found to be very useful in the theoretical study of computer programming languages.

Below is the hierarchy. In the Grammar column, upper-case letters represent nonterminal symbols, while lower-case letters represent terminal symbols.

Language Category Rules Allowed in Grammar
(Generator)
Recognizer Why We Care
Chomsky’s Number Name
Type 3 Regular
  • A → b
  • A → bC
Finite Automaton
Automaton starts in one of a finite number of states. It repeatedly reads a character, and, based only on the character read and the current state, chooses a new state. When the last character has been read, if we are in a “good” state, then the string that was read lies in the language.
  • This is what regular expressions can describe.
Type 2 Context Free
  • A → [anything]
Nondeterministic Push-Down Automaton
Think: Finite Automaton + Stack (roughly)
  • Most programming languages lie in this category.
  • This is what Backus-Naur Form (BNF) can describe.
  • This is what chapters 3 and 4 in the text are all about.
Type 1 Context Sensitive
  • [string1]A[string2] → [string1][anything][string2]
Don’t worry about it
“Linear Bounded Automaton”, if you must know
  • We don’t care much, actually.
Type 0 Recursively Enumerable
  • [anything] → [anything]
Turing Machine
Think: Computer
  • This category neatly encompasses the things that computers are capable of doing.

Notes


CS 331 Spring 2009: Additional Lecture Notes for Monday, January 26, 2009 / Updated: 26 Jan 2009 / Glenn G. Chappell / ffggc@uaf.edu Valid HTML 4.01!