CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 12911
Times: TR 4:00-5:15
Location: ECSS 2.305
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: ECSS 3.704, Tue 2:00-4:00
Teaching Assistant: Meera Sridhar (mxs072100 AT utdallas)
TA's Office Hours: ECSS 3.403, Thur 2:00-4:00

Course Summary

This course will cover functional and logic programming, concepts of programming language design, and formal reasoning about programs and programming languages. The following are the course learning objectives:

  1. Functional Programming (ML/OCaml)
  2. Small-step and large-step operational semantics
  3. Denotational semantics
  4. Fixpoints, fixpoint induction
  5. Axiomatic semantics
  6. Type theory
  7. Untyped and simply typed lambda calculus
  8. Partial evaluation, non-determinism
  9. Logic programming

Through taking this course, students will learn the tradeoffs of imperative vs. non-imperative programming languages, issues involved in designing a programming language, the role of formal semantics and type-systems in reasoning about programs and languages, and proof techniques related to programming language design.

The course is open to Ph.D. students and Masters students. Interested undergraduates should see the instructor for permission to take the course.

Prerequisites: Discrete Structures (CS 3305/5333 or equivalent), Algorithm Analysis and Data Structures (CS 3345/5343 or equivalent), Automata Theory (CS 4384/5349 or equivalent). A solid background in all three of these areas will be heavily assumed throughout the course!

To Prepare for the Course...

Although the early course lectures will include a brief survey of the OCaml programming language, students will be expected to learn most of OCaml on their own. Therefore, if you want to get a head start, I recommend downloading and installing OCaml, and walking yourself through some of the many online tutorial examples:

Using OCaml from the UTD Server

If you can't get OCaml to work on your personal machine, you can use OCaml on the UTD CS Dept. Linux servers. To do so:

OCaml is available on each of the following CS servers: cslinux2.utdallas.edu, cscomp.utdallas.edu, cscomp1.utdallas.edu, cscomp2.utdallas.edu, cscomp3.utdallas.edu. When connecting from off-campus, ssh to cs1.utdallas.edu or cs2.utdallas.edu first, and then ssh to one of the other machines from there.

Grading

Homework (40%): Homeworks will be assigned approximately once per 1.5 weeks, and will consist of a mix of programming assignments and written assignments. All programming assignments will be done in Ocaml or Prolog. Written assignments will typically involve discrete math proofs. Homeworks must be turned in at the start of class (i.e., by 4:05pm) on the due date. No late homeworks will be accepted.

Midterm (25%): There will be an in-class midterm exam on Thursday, October 2. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.

Final (35%): The final exam for the course is scheduled for 2:00pm Thursday, December 11. The exam will be cumulative, covering all material in the course. Students will have 2 hours and 45 minutes to complete it.

Texts

The course has no required textbook, but we will make use of several online references:

Homework Materials

Tentative Course Schedule

Date Topic Assignments
Functional Programming with OCaml Pre-assignment: Download and install OCaml. Compile and execute the Fibonacci example
Lecture 1:
Thu 8/21
Course Introduction: Functional vs. Imperative programming, Type-safe languages, intro to OCaml
Lecture 1 OCaml Transcript
Lecture 2:
Tue 8/26
OCaml: Parametric Polymorphism
Lecture 2 OCaml Transcript
Assignment 1 due
(Ocaml intro)
Lecture 3:
Thu 8/28
OCaml: List folding, tail recursion, standard libraries, exception-handling
Lecture 3 Slides
Lecture 3 OCaml Transcript
Operational Semantics
Lecture 4:
Tue 9/2
Large-step Semantics: Intro
Lecture 4 Slides
See assignment 2 section 5 for lecture notes
Assignment 2 due
(IMP Interpreter)
Lecture 5:
Thu 9/4
Large-step Semantics: Proof techniques
Lecture 5 Notes
Lecture 6:
Tue 9/9
Small-step Semantics
See assignment 3 section 3.3 for lecture notes
Assignment 3 due
(Operational Semantics)
Denotational Semantics
Lecture 7:
Thu 9/11
Denotational Semantics: Semantic Domains and Valuation Functions
Lecture 7 Notes
Lecture 8:
Tue 9/16
Denotational Semantics: Fixed Points
See notes for lecture 7
Lecture 9:
Thu 9/18
Fixed-point Induction
Lecture 9 Notes
Assignment 4 due
(Fixpoints)
Lecture 10:
Tue 9/23
Fixpoints and CPO's
Lecture 10 Notes
Lecture 11:
Thu 9/25
Equivalence of Operational and Denotational Semantics
Lecture 12:
Tue 9/30
Midterm Review
Sample Midterm Exam
Midterm:
Thu 10/2
Midterm Exam
Type Theory
Lecture 13:
Tue 10/7
Type Theory: Introduction
See assignment 5 section 5 for lecture notes.
Assignment 5 due
(IMP Type-checker)
Lecture 14:
Thu 10/9
Type Theory: Progress & Subject Reduction
Lecture 14 Notes
Lecture 15:
Tue 10/14
Type theory: Progress & Subject Reduction (cont.)
See Lecture 14 notes.
Lecture 16:
Thu 10/16
Type theory: Progress & Subject Reduction (cont.)
See Lecture 14 notes.
Lambda Calculus
Lecture 17:
Tue 10/21
Untyped Lambda Calculus
Slides on History of Mathematics and Computation
See assignment 6 reference section for lecture notes.
Assignment 6 due
(Lambda calculus)
Lecture 18:
Thu 10/23
Simply Typed Lambda Calculus
Lecture 18-19 Notes
Lecture 19:
Tue 10/28
Polymorphic Lambda Calculus: Hindley-Milner Type-inference, Type-unification
See Lecture 18 notes.
Lecture 20:
Thu 10/30
Polymorphic Lambda Calculus: Curry-Howard Isomorphism
See Lecture 18 notes.
Assignment 7 due
(Functional IMP)
Lecture 21:
Tue 11/4
Functions: Call-by-Value, Call-by-Reference, Call-by-Name, Call-by-Need
Formal Verification of Programs
Lecture 22:
Thu 11/6
Axiomatic Semantics: Hoare Logic
C.A.R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576-580 and 583, October 1969.
Lecture 23:
Tue 11/11
Axiomatic Semantics: Loop Invariants, Weakest Precondition, Strongest Postcondition
Lecture 23 Notes
Assignment 8 due
(Hoare Logic)
Logic Programming in Prolog
Lecture 24:
Thu 11/13
Logic Programming: Part I
Lecture 25:
Tue 11/18
Logic Programming: Part II Assignment 9 due
(Prolog)
Lecture 26:
Thu 11/20
Logic Programming: Part III
Tue 11/25
Class Cancelled
Thu 11/27 No Class (Thanksgiving Break)
Lecture 27:
Tue 12/2
Final Review
Sample Final Exam
Lecture 28:
Thu 12/4
Final Review (continued)
Course Evaluations
Thu 12/11
2:00-4:45pm
Final Exam