CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 10262
Times: TR 2:30-3:45
Location: ECSS 2.311
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: ECSS 3.704, Fri 3:15-5:15
Teaching Assistant: Neda Saeedloei
TA's Office Hours: ECSS 4.621, Thu 4:00-6:00

Final Grades

Final exam grades and final course grades are now available through eLearning. Please note that there are FOUR different grades:

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

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 (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 2:35pm) on the due date. No late homeworks will be accepted.

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

Final (35%): The final exam for the course is scheduled for Tuesday, December 15 at 2:00pm. 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 plagarism, 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 or paraphrasing someone else's answer to a similar homework problem, which does not show that you have learned the material yourself and does not prepare you for the exams.


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 Pre-assignment: Download and install OCaml. Compile and execute the Fibonacci example
Lecture 1:
Thu 8/20
Course Introduction: Functional vs. Imperative programming, Type-safe languages, intro to OCaml
Lecture Slides
OCaml Lecture 1 Notes
Lecture 2:
Tue 8/25
OCaml: Parametric Polymorphism
Lecture Slides
OCaml Lecture 2 Notes
Assignment 1 due
(OCaml intro)
Lecture 3:
Thu 8/27
OCaml: List folding, tail recursion, standard libraries, exception-handling
Lecture Slides
OCaml Lecture 3 Notes
Operational Semantics
Lecture 4:
Tue 9/1
Large-step Semantics: Intro
See Assignment 2 on eLearning for lecture notes.
Assignment 2 due
(IMP Interpreter)
Lecture 5:
Thu 9/3
Large-step Semantics: Proof techniques
Lecture Notes
Lecture 6:
Tue 9/8
Small-step Semantics
Lecture Notes
Denotational Semantics
Lecture 7:
Thu 9/10
Denotational Semantics: Semantic Domains and Valuation Functions
Lecture Notes
Assignment 3 due
(Operational Semantics)
Lecture 8:
Tue 9/15
Denotational Semantics: Fixed Points
See notes for Lecture 7.
Lecture 9:
Thu 9/17
Fixed-point Induction
Lecture Notes
Lecture 10:
Tue 9/22
Fixpoints and CPO's
Lecture Notes
Assignment 4 due
Lecture 11:
Thu 9/24
Equivalence of Operational and Denotational Semantics
Lecture 12:
Tue 9/29
Equivalence of Operational and Denotational Semantics
Lecture 13:
Thu 10/1
Midterm Review
Sample Midterm Exam
Tue 10/6
Midterm Exam
Type Theory
Lecture 14:
Thu 10/8
Type Theory: Introduction
(See Assignment 5 for lecture notes.)
Assignment 5 due
(IMP Type-checker)
Lecture 15:
Tue 10/13
Type theory: Progress & Subject Reduction
Lecture Notes
Lecture 16:
Thu 10/15
Type theory: Progress & Subject Reduction
Lecture 17:
Tue 10/20
Type theory: Progress & Subject Reduction
Lambda Calculus
Lecture 18:
Thu 10/22
Untyped Lambda Calculus
Lecture Slides
(See Assignment 6 for lecture notes.)
Assignment 6 due
(Lambda calculus)
Lecture 19:
Tue 10/27
Untyped Lambda Calculus: Encoding other languages
Lecture 20:
Thu 10/29
Simply Typed Lambda Calculus
Lecture Notes
Lecture 21:
Tue 11/3
Polymorphic Lambda Calculus
(See notes for lecture 20.)
Assignment 7 due
(Functional IMP)
Lecture 22:
Thu 11/5
Functions: Call-by-Value, Call-by-Reference, Call-by-Name, Call-by-Need
Formal Verification of Programs
Lecture 23:
Tue 11/10
Axiomatic Semantics: Hoare Logic
Lecture Slides
Lecture Notes
Lecture 24:
Thu 11/12
Axiomatic Semantics: Loop Invariants, Weakest Precondition, Strongest Postcondition Assignment 8 due
(Hoare Logic)
Logic Programming in Prolog
Lecture 25:
Tue 11/17
Logic Programming: Part I
Lecture Slides
Lecture 26:
Thu 11/19
Logic Programming: Part II
Course Evaluations
(See Lecture 25 slides.)
Lecture 27:
Tue 11/24
Logic Programming: Part III
(See Lecture 25 slides.)
Assignment 9 due
Thu 11/26 No Class (Thanksgiving Break)
Lecture 28:
Tue 12/1
Final Review
Sample Final Exam
Lecture 29:
Thu 12/3
Final Review (cont.)
Tue 12/15
Final Exam