CSE 428: Lectures
WEEK 1 (Jan 10)
Introduction. Administrativia. Overview
of the course. (Sethi, 1.3)
The formal definition of Programming Languages.
Example: a subset of the English sentences.
Syntax: Context Free Grammars,
derivations, language generated by a grammar. [Lecture
notes] (Sethi, 2.1-4)
WEEK 2 (Jan 17)
Syntax: Derivation trees. Ambiguity. A simple language
of expressions. Precedence and associativity.
[Lecture notes] (Sethi, 2.4-5)
Exercise: unambiguous grammars for the language of balanced
Expressions with a left-associative operator ("-").
Expressions with a right-associative operator ("^").
Use of parse trees in language implementation.
(Assignment 1 distributed)
WEEK 3 (Jan 25)
Extending the language of expressions
with identifiers and declarations.
Environment and scope
A simple "eval" interpreter for the language of expressions.
[Lecture notes (interpreter for exp)].
Introduction to the Imperative paradigm. Environment
and State in Imperative
Languages. Assignment, Conditional, and While command.
Declarations of variables and blocks.
notes] (Sethi Ch. 3,
excluding Sections 3.5 and 3.6).
(Assignment 1 due, Assignment 2 distributed)
WEEK 4 (Jan 31)
An interpreter for a mini imperative language.
[Lecture notes (interpreter for imp)].
Introduction to procedures and functions.
Parameter-passing methods: Call by value,
by reference, by value-result, and by name
(Assignment 2 due, Assignment 3 distributed)
WEEK 5 (Feb 7)
Some issues about compilation.
Stack-based implementation for imperative languages.
Lexical scope and dynamic scope.
Lexical scope and nested declarations of
functions and procedures:
necessity of a static (access) link.
Allocation and deallocation of dynamic variables.
Dangling references and memory leaks.
(Sethi, 4.7 and 4.8)
(Assignment 3 due, Test 1 distributed)
WEEK 6 (Feb 14)
Preparation for the midterm:
Explanation and discussion of solution of Test 1
MidTerm 1 exam (in class).
WEEK 7 (Feb 21)
Objects and classes in C++.
Data and methods.
Object creation in C++: as local/global objects, by using a
declaration, and as dynamic objects, by using "new".
Constructors and destructors methods.
The concept of "this".
Example: definition of a circular list in C++.
Example of Programming in C++: The Erathostenes' Sieve.
Demand driven and data driven solutions.
(Assignment 4 distributed)
WEEK 8 (Feb 28)
- Tue. OO in Java.
Main differences between Java and C++.
Introduction to concurrency.
Creation of threads in Java.
Life-cycle of a thread. Example: the program PingPong.
- Thu. The problem of Race condition and the
solution offered by Java (synchronization).
Suspension and resumption of threads
via wait() and notify().
(Assignment 4 due, Assignment 5 distributed)
Spring break (Mar 6)
WEEK 9 (Mar 13)
The meaning of synchronized methods:
An extended example: Producers and consumers on
a common buffer
- Thu. Java applets. The notion of Semaphore.
(Assignment 6 distributed)
WEEK 10 (Mar 20)
- Tue. Introduction to functional programming and to ML
(Sethi Ch. 8)
(Assignment 5 due)
- Thu. Definition of functions by pattern matching.
Data types in ML
[Lecture notes , more notes]
(Sethi 9.1-9.5 excluding 9.3)
(Assignment 7 distributed)
WEEK 11 (Mar 27)
Preparation for the midterm:
Explanation and discussion of solution of Test 2
(Assignment 6 due)
- Thu. Higher Order in ML.
MidTerm 2 exam (after class).
WEEK 12 (Apr 3)
- Tue. MidTerm 2 exam (in class).
- Thu. Curried functions. Types in programming languages.
Type checking and type inference. Polymorphism.
The type system of ML.
As another example of polymorphism, see
also: Templates in C++.
(Assignment 8 distributed)
WEEK 13 (Apr 10)
Introduction to Logic Programming and Prolog.
Distinctive features: Unification and backtracking.
Applications: AI, fast prototyping, databases.
Syntax of Programs: facts and rules. Querying a program.
Example: a database representing the
matherhood relation. Deriving new relations:
grand_mother and ancestor.
Lists in Prolog.
Functions defined by predicates.
Example: Definition of append.
Comparison with ML.
Invertibility. Use of append
for splitting a list.
(Assignment 7 due)
- Thu. Metaprogramming (Lecture given by Mike Nidel)
(Assignment 8 due, Assignment 9 distributed)
WEEK 14 (Apr 17)
- Tue. Operational Semantics of Prolog.
Unification. SLD-trees (also called Search trees in Sethi).
Leftmost selection rule. Depth-first visit of the tree.
The order of atoms in a body (or query)
and the order of the clauses in the program
affects the order of solutions,
and the presence/absence of infinite loops.
Examples: plus and ancestor.
(Sethi 11.4 and 11.5)
- Thu. Extra-logical features in Prolog:
(1) Arithmetics. Examples:
definition of predicates
computing the length of a list and the
sum of the elements of a list.
(2) Cut. Examples: Definition of
not and if_then_else
by using cut.
The ``guess and verify'' (aka ``generate and test'') technique.
Example: slow_sort. Example:
Use of Logic Programming in Artificial Intelligence.
Example: Solving intelligence tests.
(Sethi 11.4 and 11.6)
(Assignment 9 due, Test 3 distributed)
WEEK 15 (Apr 24)
- Tue. Logic Programming as a Metalanguage.
Examples: A parser for a mini-imperative language.
A type-system (with type-inference) for mini-ML.
Preparation for the final exam:
Explanation and discussion of solution of Test 3
Note: The above schedule is subject to change.