CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 21472
Times: TR 1:00-2:15
Location: ECSS 2.312
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: TR 2:15-3:15 in ECSS 3.704
Teaching Assistant: Frederico Araujo
TA's Office Hours: Tue 10:00-12:00 in ECSS 4.209

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

STUDENTS MUST ATTEND AT LEAST TWO OF THE FIRST THREE CLASSES. IF YOU MISS MORE THAN ONE OF THE FIRST THREE CLASSES, YOU WILL NOT BE PERMITTED TO TAKE THE COURSE. The first three classes will cover functional programming in the OCaml programming language, which will be the basis for most of the rest of the course. To better understand the in-class OCaml demos, 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:

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. Programming assignments will be done in OCaml, Prolog, or possibly Coq. 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 are essentially extra homework problems solved individually in class without the help of internet solution sets 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 6. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.

Final (35%): The final exam for the course is scheduled for Thursday 5/8 at 2:00. 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 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/14
Course Introduction: Functional vs. Imperative programming, type-safe languages, intro to OCaml
Lecture slides
OCaml Transcript and Notes
Assignment 1 due 1/23
(OCaml Intro)
Lecture 2:
Thu 1/16
OCaml: Parametric polymorphism
Lecture slides
OCaml Transcript and Notes
Lecture 3:
Tue 1/21
OCaml: List folding, tail recursion, exception-handling
Lecture slides
OCaml Transcript and Notes
Operational Semantics
Lecture 4:
Thu 1/23
Large-step Semantics: Intro
See Assignment 2 (available via eLearning) for notes.
Assignment 2 due 1/30
(SIMPL Interpreter)
Lecture 5:
Tue 1/28
Large-step Semantics: Proof techniques
Lecture Notes
Lecture 6:
Thu 1/30
Small-step Semantics
Quiz 1: OCaml
Lecture Notes
Assignment 3 due 2/11
(Operational Semantics)
Denotational Semantics
Lecture 7:
Tue 2/4
Denotational Semantics: Semantic domains and valuation functions
Lecture Notes
No Class:
Thu 2/6
Class canceled due to weather
Lecture 8:
Tue 2/11
Denotational Semantics: Fixed points
Quiz 2: Operational Semantics
Notes on Complete Partial Orders
Lecture Notes
Assignment 4 due 2/20
Lecture 9:
Thu 2/13
Fixed-point Induction
Lecture Notes
Lecture 10:
Tue 2/18
Semantic Equivalence
Formal methods: Program-proof Co-development with Coq
Coq Transcript
Type Theory
Lecture 11:
Thu 2/20
Type Theory: Introduction
See reference section of Assignment 5 for lecture notes.
Quiz 3: Denotational Semantics
Assignment 5 due 3/4
(SIMPL Type-checker)
Lecture 12:
Tue 2/25
Type Theory: Type-soundness, Progress and Preservation
Lecture Notes
Lecture 13:
Thu 2/27
Type Theory: Type-based Information Flow Security
Lecture Slides
Lecture 14:
Tue 3/4
Midterm Review
Sample Midterm Exam with Solutions
Thu 3/6
Midterm Exam
No Class:
Tue 3/11
No class: Spring break
No Class:
Thu 3/13
No class: Spring break
Untyped Lambda Calculus
Lecture 15:
Tue 3/18
Untyped Lambda Calculus
See reference section of Assignment 6 for lecture notes.
Quiz 4: Type Theory
Assignment 6 due 3/27
(Lambda calculus)
Lecture 16:
Thu 3/20
Untyped Lambda Calculus: Encodings and reductions
See reference section of Assignment 6 for lecture notes.
Typed Lambda Calculus
Lecture 17:
Tue 3/25
Simply-typed Lambda Calculus
Lecture Notes
Lecture 18:
Thu 3/27
System F: Type-inhabitation, Curry-Howard Isomorphism
See Lecture 17 notes and Assignment 7 reference section for notes.
Quiz 5: Lambda Calculus
Assignment 7 due 4/10
(Functional SIMPL)
Lecture 19:
Tue 4/1
Summary/Comparison of Modern Language Features:
Weak vs. strong typing, type-safety, function evaluation strategies
Lecture 20:
Thu 4/3
Summary/Comparison of Modern Language Features:
Hindley-Milner type-inference, type polymorphism
Lecture Notes
Logic Programming
Lecture 21:
Tue 4/8
Logic Programming: Part I
Lecture Slides
Lecture 22:
Thu 4/10
Logic Programming: Part II
See the slides for Lecture 21 for notes.
Quiz 6: System F Type Inhabitation
Assignment 8 due 4/22
Lecture 23:
Tue 4/15
Logic Programming: Part III
See the slides for Lecture 21 for notes.
Formal Verification
Lecture 24:
Thu 4/17
Axiomatic Semantics: Hoare Logic
Lecture Slides
Lecture 25:
Tue 4/22
Axiomatic Semantics: Loop invariants
Lecture Notes
Quiz 7: Prolog
Assignment 9 due 5/1
(Hoare Logic)
Lecture 26:
Thu 4/24
Axiomatic Semantics: Weakest precondition, strongest postcondition
Lecture Slides
Lecture 27:
Tue 4/29
Final Review
Sample Final Exam with Solutions
Lecture 28:
Thu 5/1
Final Review
Quiz 8: Axiomatic Semantics
Thu 5/8
Final Exam in ECSS 2.312 (regular classroom)