CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 22290
Times: TR 1:00-2:15
Location: JSOM 2.901
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: TR 2:15-3:15 in ECSS 3.704
Teaching Assistant: Owolabi Legunsen (owolabi.legunsen AT utdallas)
TA's Office Hours: M 10:00-12:00 in ECSS 4.701

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

Quizzes (15%): On indicated assignment due dates (see the course schedule below), students will solve one or two problems individually at the start of class as a quiz. The quiz problems will be similar to the homework problems, but short enough to solve in class. The quizzes will be closed-book and closed-notes.

Midterm (25%): There will be an in-class midterm exam in class on Thursday, March 7th. 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 9th. 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 consult solution sets from previous semesters of the course, or collaborate with students who have such solutions. These sources are off-limits because such "collaborations" tend to involve simply copying someone else's answer to a similar homework problem, which does not prepare you for the quizzes and exams.


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

Tentative Course Schedule

Date Topic Assignments
Functional Programming
Lecture 1:
Tue 1/15
Course Introduction: Functional vs. Imperative programming, type-safe languages, intro to OCaml
Lecture Slides
OCaml Transcript
Assignment 1 due 1/24
(OCaml Intro)
Lecture 2:
Thu 1/17
OCaml: Parametric polymorphism
Lecture Slides
OCaml Transcript
Lecture 3:
Tue 1/22
OCaml: List folding, tail recursion, exception-handling
Lecture Slides
OCaml Transcript
Operational Semantics
Lecture 4:
Thu 1/24
Large-step Semantics: Intro
Lecture Slides
See Assignment 2 (available via eLearning) for lecture notes.
Assignment 2 due 1/31
(IMP Interpreter)
Lecture 5:
Tue 1/29
Large-step Semantics: Proof techniques
Lecture Notes
Lecture 6:
Thu 1/31
Small-step Semantics
Quiz 1: OCaml
Lecture Notes
Assignment 3 due 2/12
(Operational Semantics)
Denotational Semantics
Lecture 7:
Tue 2/5
Denotational Semantics: Semantic domains and valuation functions
Lecture Notes
Lecture 8:
Thu 2/7
Denotational Semantics: Fixed points
Lecture Notes
Supplementary notes on Complete Partial Orders (CPOs)
Lecture 9:
Tue 2/12
Fixed-point Induction
Lecture Notes
Quiz 2: Operational Semantics
Assignment 4 due 2/21
Lecture 10:
Thu 2/14
Semantic Equivalence
Lecture 11:
Tue 2/19
Software-Proof Co-development
Coq Demo
Type Theory
Lecture 12:
Thu 2/21
Type Theory: Introduction
See Assignment 5 (available via eLearning) for lecture notes.
Quiz 3: Denotational Semantics
Assignment 5 due 3/5
(IMP Type-checker)
Lecture 13:
Tue 2/26
Type Theory: Soundness
Lecture Notes
Lecture 14:
Thu 2/28
Type Theory: Type-based Information Flow Security
Lecture 15:
Tue 3/5
Midterm Review
Sample midterm exam with solutions
Thu 3/7
Midterm Exam
No Class:
Tue 3/12
No class: Spring break
No Class:
Thu 3/14
No class: Spring break
Untyped Lambda Calculus
Lecture 16:
Tue 3/19
Untyped Lambda Calculus
(See Assignment 6 reference section for lecture notes.)
Quiz 4: Type Theory
Assignment 6 due 4/2
(Lambda calculus)
Lecture 17:
Thu 3/21
Untyped Lambda Calculus: Encodings and reductions
(See Assignment 6 reference section for lecture notes.)
Typed Lambda Calculus
Lecture 18:
Tue 3/26
Simply-typed Lambda Calculus
Lecture Notes
Lecture 19:
Thu 3/28
System F
(See notes for Lecture #18.)
Lecture 20:
Tue 4/2
System F: Curry-Howard isomorphism Assignment 7 due 4/11
(Functional IMP)
Lecture 21:
Thu 4/4
Functions: Evaluation strategies
Lecture 22:
Tue 4/9
Summary/Comparison of Modern Language Features
Quiz 5: Lambda Calculus
Logic Programming
Lecture 23:
Thu 4/11
Logic Programming: Part I
Lecture Slides
Assignment 8 due 4/23
Lecture 24:
Tue 4/16
Logic Programming: Part II
(See slides from Lecture 23)
Lecture 25:
Thu 4/18
Logic Programming: Part III
(See slides from Lecture 23)
Formal Verification
Lecture 26:
Tue 4/23
Axiomatic Semantics: Hoare Logic
Quiz 6: Prolog
Lecture Slides
Lecture Notes
Assignment 9 due 5/2
(Hoare Logic)
Lecture 27:
Thu 4/25
Axiomatic Semantics: Loop invariants, weakest precondition, strongest postcondition
Lecture 28:
Tue 4/30
Final Review
Lecture Slides
Sample Final Exam (with solutions)
Lecture 29:
Thu 5/2
Final Review
Quiz 7: Axiomatic Semantics
Thu 5/9
Final Exam in JSOM 2.802