CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 27948 / 003641
Times: TR 1:00–2:15
Location: CB3 1.302
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: Algorithm Analysis and Data Structures (CS 3345/5343 or equivalent), Automata Theory (CS 4384/5349 or equivalent). A solid background in each of these areas will be heavily assumed throughout the course!

To Prepare for the Course...

The first three classes are extremely important for succeeding in the remainder of the course; students are therefore urged to participate in the course from the start, ideally by attending the first three classes in person if possible, or by streaming the lectures remotely if necessary. These initial classes will cover functional programming in the OCaml programming language, which will introduce many concepts assumed throughout 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:

Grading

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 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. 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 10th. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.

Final (35%): A final exam for the course will be held on Thursday, May 12th from 2:00–4:45pm. 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.

Texts

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

Tentative Course Schedule

Date Topic Assignments
Functional Programming

Assignment prep: Follow the instructions above on preparing for the course.

Lecture 1: (online-only)
Tue 1/18
Course Introduction: Functional vs. Imperative programming, type-safe languages, intro to OCaml
Lecture Slides
Lecture Notes
Assignment 1 due 1/27
(OCaml Intro)
Lecture 2: (online-only)
Thu 1/20
OCaml: Parametric polymorphism
Lecture Notes
Lecture 3: (online-only)
Tue 1/25
OCaml: List folding, tail recursion, exception-handling
Lecture Notes
Lecture Slides
Operational Semantics
Lecture 4: (online-only)
Thu 1/27
Large-step Semantics: Intro
Lecture Slides
Assignment 2 due 2/8
(SIMPL Interpreter)
Lecture 5: (online-only)
Tue 2/1
Large-step Semantics: Proof techniques
Lecture Notes
Lecture Slides
Class Canceled
Thu 2/3
Weather emergency: University closure Assignment 3 due 2/15
(Operational Semantics)
Lectures 6: (in-person henceforth)
Tue 2/8
Small-step Operational Semantics
Lecture Notes
Lecture Slides
Denotational Semantics
Lecture 7:
Thu 2/10
Denotational Semantics: Semantic domains and valuation functions
Lecture Slides
Lecture Notes
Quiz 1: OCaml Programming
Lecture 8:
Tue 2/15
Fixed-point Induction
Lecture Slides
Lecture Notes
Sample Exercises & Solutions
Assignment 4 due 2/24
(Fixpoints)
Lecture 9:
Thu 2/17
Semantic Equivalence
Lecture Slides
Coq Demo: Assignment #3, Problem #3
Coq Demo: Semantic Equivalence
Quiz 2: Operational Semantics
Lecture 10:
Tue 2/22
Complete Partial Orders
Lecture Notes
Type Theory
Class Canceled
Thu 2/24
Weather emergency: University closure
Lecture 11:
Tue 3/1
Type Theory: Introduction
Lecture Slides
Quiz 3: Denotational Semantics
Assignment 5 due 3/22
(SIMPL Type-checker)
Lecture 12:
Thu 3/3
Type Theory: Soundness
Lecture Slides
Lecture Notes
Coq Demo: Type-safety
Lecture 13:
Tue 3/8
Midterm Review
Sample Midterm Exam & Solutions
Midterm:
Thu 3/10
Midterm Exam
No Class:
Tue 3/15
No class: Spring break
No Class:
Thu 3/17
No class: Spring break
Untyped Lambda Calculus
Lecture 14:
Tue 3/22
Untyped Lambda Calculus
Lecture Slides
Assignment 6 due 3/31
(Lambda calculus)
Lecture 15:
Thu 3/24
Untyped Lambda Calculus: Encodings and reductions
Lecture Slides
Quiz 4: Type Theory
Typed Lambda Calculus
Lecture 16:
Tue 3/29
Simply-typed Lambda Calculus
Lecture Slides
Lecture 17:
Thu 3/31
System F
Lecture Slides
Lecture Notes
Quiz 5: Lambda Calculus
Assignment 7 due 4/12
(Functional SIMPL)
Lecture 18:
Tue 4/5
System F: Curry-Howard isomorphism
Lecture Slides
Lecture Notes
Lecture 19:
Thu 4/7
Functions: Evaluation strategies
Lecture Slides
Logic Programming
Lecture 20:
Tue 4/12
Logic Programming: Part I Assignment 8 due 4/21
(Prolog)
Lecture 21:
Thu 4/14
Logic Programming: Part II
Lecture 22:
Tue 4/19
Logic Programming: Part III
Formal Verification
Lecture 23:
Thu 4/21
Axiomatic Semantics: Hoare Logic
Lecture Slides
C.A.R. Hoare's original 1969 paper on Axiomatic Semantics (optional reading)
Assignment 9 due 5/5
(Hoare Logic)
Lecture 24:
Tue 4/26
Loop Invariants
Lecture Slides
Quiz 6: Prolog
Lecture 25:
Thu 4/28
Weakest precondition, strongest postcondition
Lecture Slides
Lecture 26:
Tue 5/3
Final Review
Sample Final Exam
Lecture 27:
Thu 5/5
Course Summary
Lecture Slides
Quiz 7: Axiomatic Semantics
Final Exam:
Thu 5/12 2:00-4:45pm
Final Exam