CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 21438
Times: TR 1:00-2:15
Location: ECSS 2.203
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: M 1:30-3:30, ECSS 3.704
Teaching Assistant: Richard Wartell
TA's Office Hours: W 12:00-3:00, ECSS 3.613

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. Logic programming
  3. Small-step and large-step operational semantics
  4. Denotational semantics
  5. Fixpoints, fixpoint induction
  6. Axiomatic semantics
  7. Type theory
  8. Untyped and typed lambda calculi
  9. Partial evaluation, non-determinism

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...

The first two lectures of the course are very important so please do not skip them! If you know you will miss them, you should obtain the lecture notes from this webpage once they are posted, obtain the first homework assignment through eLearning, and do the following on your own:

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 Department Linux servers. To do so:

Using Prolog from the UTD Server

You can install your own local version of SWI Prolog or you can access the version installed on the UTD linux servers as follows:


Homework (25%): 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.

Quizzes (15%): Pop quizzes will be given in class approximately one per unit. They will be closed-book, closed-notes, and will typically consist of one or two short programming problems, or a set of about five multiple choice or short answer questions.

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

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

Homework Policy

Students may work individually or together with other students presently enrolled in the class to complete the assignments, but they must CITE ALL COLLABORATORS AND ANY OTHER SOURCES OF MATERIAL that they consulted, even if those sources weren't copied word-for-word. Copying or paraphrasing someone else's work without citing it is plagiarism, and may result in severe penalties such as an immediate failing grade for the course and/or expulsion from the computer science program. Therefore, please cite all sources!

Students may NOT collaborate with students who are not currently enrolled in the class. In particular, it is a violation of the class homework policy to collaborate with a student who took the class in a previous semester or to consult their old homework solutions. These sources are off-limits because such "collaborations" tend to involve simply copying someone else's answer to a similar homework problem, which teaches you to be a Xerox machine, not a computer scientist.


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

Tentative Course Schedule

Date Topic Assignments
Functional Programming with OCaml
Lecture 1:
Tue 1/11
Course Introduction: Functional vs. Imperative programming, Type-safe languages, intro to OCaml
Lecture Slides
Lecture Notes
Assignment 1 due
(OCaml intro)
Lecture 2:
Thu 1/13
OCaml: Parametric Polymorphism
Lecture Slides
Lecture Notes
Lecture 3:
Tue 1/18
OCaml: List folding, tail recursion, standard libraries, exception-handling
Lecture Slides
Lecture Notes
Operational Semantics
Lecture 4:
Thu 1/20
Large-step Semantics: Intro
Lecture Slides
See Section 6 of Assignment 2 for lecture notes.
Assignment 2 due
(IMP Interpreter)
Lecture 5:
Tue 1/25
Large-step Semantics: Proof techniques
Lecture Notes
Thu 1/27 No Class
Tue 2/1 No Class: University closed due to weather Assignment 3 due
(Operational Semantics)
Thu 2/3 No Class: University closed due to weather
Lecture 6:
Tue 2/8
Small-step Semantics
Lecture Notes
Denotational Semantics
Lecture 7:
Thu 2/10
Denotational Semantics: Semantic Domains and Valuation Functions
Lecture Notes
Assignment 4 due
Lecture 8:
Tue 2/15
Denotational Semantics: Fixed Points
Lecture Notes
Lecture 9:
Thu 2/17
Fixed-point Induction
Lecture Notes
Lecture 10:
Tue 2/22
Midterm Review
Sample Midterm Exam
Thu 2/24
Midterm Exam
Type Theory
Lecture 11:
Tue 3/1
Type Theory: Introduction
(See Assignment 5 for notes.)
Assignment 5 due
(IMP Type-checker)
Lecture 12:
Thu 3/3
Type Theory: Type Soundness
Lecture Notes
Lambda Calculus
Lecture 13:
Tue 3/8
Untyped Lambda Calculus
(See Assignment 6 for notes.)
Lecture 14:
Thu 3/10
Untyped Lambda Calculus: Encodings and Reductions
(See Assignment 6 for notes.)
Assignment 6 due
(Lambda calculus)
Tue 3/15 No Class (Spring Break)
Thu 3/17 No Class (Spring Break)
Lecture 15:
Tue 3/22
Simply-typed Lambda Calculus
Lecture Notes
Lecture 16:
Thu 3/24
System F: Curry-Howard Isomorphism Assignment 7 due
(Functional IMP)
Lecture 17:
Tue 3/29
System F: Hindley-Milner Type-inference
Lecture Notes
Lecture 18:
Thu 3/31
Summary/Comparison of Modern Language Features
Lecture 19:
Tue 4/5
Functions: Evaluation Strategies
Formal Verification of Programs
Lecture 20:
Thu 4/7
Axiomatic Semantics: Hoare Logic
C.A.R. Hoare. An Axiomatic Basis for Computer Programming. Communications of the ACM, 12(10):576-580,583, October 1969.
Assignment 8 due
(Hoare Logic)
Lecture 21:
Tue 4/12
Axiomatic Semantics: Loop Invariants, Weakest Precondition, Strongest Postcondition
Logic Programming in Prolog
Lecture 22:
Thu 4/14
Logic Programming: Part I
Lecture Slides
Lecture 23:
Tue 4/19
Logic Programming: Part II
Course Evaluations
See slides for Lecture 22
Assignment 9 due
Lecture 24:
Thu 4/21
Logic Programming: Part III
See slides for Lecture 22
Lecture 25:
Tue 4/26
Final Review
Sample Final Exam
Lecture 26:
Thu 4/28
Final Review
Thu 5/5
Final Exam