CSE 428: Lectures

    WEEK 1 (Jan 10)
  1. Tue. Introduction. Administrativia. Overview of the course. (Sethi, 1.3)
  2. Thu. 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)
  3. WEEK 2 (Jan 17)

  4. Tue. Syntax: Derivation trees. Ambiguity. A simple language of expressions. Precedence and associativity. [Lecture notes] (Sethi, 2.4-5)
  5. Thu. Exercise: unambiguous grammars for the language of balanced parentheses. Expressions with a left-associative operator ("-"). Expressions with a right-associative operator ("^"). Dangling-else ambiguity. Use of parse trees in language implementation. [Lecture notes] (Sethi, 2.6) (Assignment 1 distributed)
  6. WEEK 3 (Jan 25)

  7. Tue. Extending the language of expressions with identifiers and declarations. Environment and scope [Lecture notes]. A simple "eval" interpreter for the language of expressions. [Lecture notes (interpreter for exp)].
  8. Thu. Introduction to the Imperative paradigm. Environment and State in Imperative Languages. Assignment, Conditional, and While command. Declarations of variables and blocks. [Lecture notes] (Sethi Ch. 3, excluding Sections 3.5 and 3.6). (Assignment 1 due, Assignment 2 distributed)
  9. WEEK 4 (Jan 31)

  10. Tue. An interpreter for a mini imperative language. [Lecture notes (interpreter for imp)].
  11. Thu. Introduction to procedures and functions. Parameter-passing methods: Call by value, by reference, by value-result, and by name [Lecture notes]. (Sethi 5.1-3) (Assignment 2 due, Assignment 3 distributed)
  12. WEEK 5 (Feb 7)

  13. Tue. Some issues about compilation. Activation records. 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. [Lecture notes]. (Sethi 5.3-7)
  14. Thu. Allocation and deallocation of dynamic variables. Pointers. Dangling references and memory leaks. [Lecture notes]. (Sethi, 4.7 and 4.8) (Assignment 3 due, Test 1 distributed)
  15. WEEK 6 (Feb 14)

  16. Tue. Preparation for the midterm: Explanation and discussion of solution of Test 1
  17. Thu. MidTerm 1 exam (in class).
  18. WEEK 7 (Feb 21)

  19. Tue. 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++. (Sethi 6.5-6)
  20. Thu. Example of Programming in C++: The Erathostenes' Sieve. Demand driven and data driven solutions. [Lecture notes] (Sethi 7.5) (Assignment 4 distributed)
  21. WEEK 8 (Feb 28)

  22. 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. [Lecture notes] (Arnold-Gosling 9.1-2)
  23. Thu. The problem of Race condition and the solution offered by Java (synchronization). Suspension and resumption of threads via wait() and notify(). [Lecture notes] (Arnold-Gosling 9.1-2) (Assignment 4 due, Assignment 5 distributed)
  24. Spring break (Mar 6)

    WEEK 9 (Mar 13)

  25. Tue. The meaning of synchronized methods: locks. An extended example: Producers and consumers on a common buffer [Lecture notes] (Arnold-Gosling 9.3-6)
  26. Thu. Java applets. The notion of Semaphore. [Slides] (Assignment 6 distributed)
  27. WEEK 10 (Mar 20)

  28. Tue. Introduction to functional programming and to ML [Lecture notes] (Sethi Ch. 8) (Assignment 5 due)
  29. 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)
  30. WEEK 11 (Mar 27)

  31. Tue. Preparation for the midterm: Explanation and discussion of solution of Test 2
  32. (Assignment 6 due)
  33. Thu. Higher Order in ML. [Lecture notes] (Sethi 9.3) MidTerm 2 exam (after class).
  34. WEEK 12 (Apr 3)

  35. Tue. MidTerm 2 exam (in class).
  36. Thu. Curried functions. Types in programming languages. Type checking and type inference. Polymorphism. The type system of ML. [Lecture notes] As another example of polymorphism, see also: Templates in C++. (Sethi 6.7) (Assignment 8 distributed)
  37. WEEK 13 (Apr 10)

  38. Tue. 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. [code] Lists in Prolog. Functions defined by predicates. Example: Definition of append. Comparison with ML. Invertibility. Use of append for splitting a list. [code] (Sethi 11-11.3) (Assignment 7 due)
  39. Thu. Metaprogramming (Lecture given by Mike Nidel) [slides] (Assignment 8 due, Assignment 9 distributed)
  40. WEEK 14 (Apr 17)

  41. 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)
  42. 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: N_queens.
    Use of Logic Programming in Artificial Intelligence. Example: Solving intelligence tests.
    (Sethi 11.4 and 11.6) (Assignment 9 due, Test 3 distributed)
  43. WEEK 15 (Apr 24)

  44. Tue. Logic Programming as a Metalanguage. Examples: A parser for a mini-imperative language. A type-system (with type-inference) for mini-ML.
  45. Thu. Preparation for the final exam: Explanation and discussion of solution of Test 3
  46. Note: The above schedule is subject to change.