CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 22958
Times: TR 1:00–2:15
Location: CB 1.218
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: TR 2:15–3:15 in ECSS 3.704

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 (Prolog)
  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 formal, high-assurance software validation.

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

STUDENTS MUST ATTEND AT LEAST ONE OF THE FIRST THREE CLASSES. IF YOU MISS MORE THAN TWO OF THE FIRST THREE CLASSES (other than for excused absences—see below) THEN YOUR FINAL COURSE GRADE WILL AUTOMATICALLY BE REDUCED BY ONE FULL LETTER GRADE. The first three classes will cover logic programming in the Prolog programming language, which will introduce many concepts assumed throughout the rest of the course. Documented absences approved by university policy are exempted from this attendance requirement. These include illness with an accompanying doctor's note, and observance of religious holy days.

To better understand the in-class Prolog lectures at the start of the course, you should either install your own local version of SWI Prolog (preferred), or you can access the version installed on the UTD linux servers as follows:

To better understand the in-class OCaml demos starting in the second week of the course, you should do the following as preparation:

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:


Homework (25%): Homeworks will be assigned approximately once per 1.5 weeks, and will consist of a mix of programming assignments and written assignments. Programming assignments will be implemented in Prolog or OCaml. 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. To help students prepare for the next assignment, homework solutions will typically be revealed on each due date. Therefore, 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 are essentially extra homework problems solved individually in class without the help of the internet or collaboration with other students. The quizzes will be closed-book and closed-notes.

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

Final (35%): A final exam for the course has been tentatively scheduled by the university registrar for Thursday, May 3rd 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 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 this course, or collaborate with students who have such solutions. These sources are off-limits because such "collaborations" tend to involve simply copying or reverse-engineering 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

See Assignment 6 reference section for class notes.
Date Topic Assignments
Logic Programming
Lecture 1:
Tue 1/9
Logic Programming: Part I Assignment 1 due 1/25
Lecture 2:
Thu 1/11
Logic Programming: Part II
Lecture 3:
Tue 1/16
Logic Programming: Part III
Functional Programming
Lecture 4:
Thu 1/18
Course Introduction: Functional vs. Imperative programming, type-safe languages, intro to OCaml
Lecture Notes
Lecture 5:
Tue 1/23
OCaml: Parametric polymorphism
Lecture Notes
Lecture 6:
Thu 1/25
OCaml: List folding, tail recursion, exception-handling
Lecture Notes
Assignment 2 due 2/6
(OCaml Intro)
No Lecture:
Tue 1/30
Quiz #1: Logic Programming
Operational Semantics
Lecture 7:
Thu 2/1
Large-step Semantics: Intro
See Assignment 3 for lecture notes.
Lecture 8:
Tue 2/6
Large-step Semantics: Proof techniques
Lecture Notes
Assignment 3 due 2/13
(SIMPL Interpreter)
Lecture 9:
Thu 2/8
Small-step Semantics
Lecture Notes
Denotational Semantics
Lecture 10:
Tue 2/13
Denotational Semantics: Semantic domains and valuation functions
Lecture Notes
Quiz #2: Functional Programming
Assignment 4 due 2/22
(Operational Semantics)
Lecture 11:
Thu 2/15
Denotational Semantics: Fixed points
Lecture Notes
Lecture 12:
Tue 2/20
Fixed-point Induction
Lecture Notes
Supplemental Examples
Lecture 13:
Thu 2/22
Semantic Equivalence
Quiz #3: Operational Semantics
Assignment 5 due 3/8
Lecture 14:
Tue 2/27
Midterm Review
Sample Midterm Exam (w/solutions)
Thu 3/1
Midterm Exam
Type Theory
Lecture 15:
Tue 3/6
Type Theory: Introduction
Lecture 16:
Thu 3/8
Type Theory: Type-soundness, Progress and Preservation
Lecture Notes
Quiz #4: Denotational Semantics
Assignment 6 due 3/22
(SIMPL Type-checker)
No Class:
Tue 3/13
No Class: Spring break
No Class:
Thu 3/15
No Class: Spring break
Lecture 17:
Tue 3/20
Program-proof Co-development
Untyped Lambda Calculus
Lecture 18:
Thu 3/22
Untyped Lambda Calculus: Introduction
Quiz #5: Type Theory
Assignment 7 due 4/3
(Lambda calculus)
Lecture 19:
Tue 3/27
Untyped Lambda Calculus: Encodings and reductions
Typed Lambda Calculus
Lecture 20:
Thu 3/29
Simply-typed Lambda Calculus
Lecture Notes
Lecture 21:
Tue 4/3
System F: Type-inhabitation, Curry-Howard Isomorphism
Lecture Notes
Quiz #6: Lambda Calculus
Assignment 8 due 4/17
(Functional SIMPL)
Lecture 22:
Thu 4/5
Summary/Comparison of Modern Language Features: Static vs. dynamic typing, type-safety, function evaluation strategies
Lecture 23:
Tue 4/10
Summary/Comparison of Modern Language Features: Hindley-Milner type-inference, type polymorphism
Lecture Notes
Formal Verification
Lecture 24:
Thu 4/12
Axiomatic Semantics: Hoare Logic
Lecture 25:
Tue 4/17
Axiomatic Semantics: Loop invariants, Soundness, Relative Completeness
Lecture Notes
Assignment 9 due 4/26
(Hoare Logic)
Lecture 26:
Thu 4/19
Axiomatic Semantics: Weakest precondition, strongest postcondition
Lecture 27:
Tue 4/24
Final Review
Sample Final Exam w/Solutions
Lecture 28:
Thu 4/26
Final Review
Quiz #7: Axiomatic Semantics
Final Exam:
Thu 5/3 2:00–4:45pm
Final Exam (in usual classroom)