CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 23509 / 003641
Times: TR 1:00–2:15 online instruction via eLearning
Location: CB3 1.304 online only
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: TR 2:15–3:15 in ECSS 3.704 email or eLearning discussion board


Final Grades

Last updated: 5/13/2020 12:00pm

Final exam grades and course letter grades are now posted to eLearning. If you believe anything is in error, please email the instructor. Thank you for an excellent class (despite the world chaos) and have a great summer!


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

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 functional programming in the OCaml 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 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 5. 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 7. 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:
Tue 1/14
Course Introduction: Functional vs. Imperative programming, type-safe languages, intro to OCaml
Lecture Slides
OCaml Transcript
Assignment 1 due 1/23
(OCaml Intro)
Lecture 2:
Thu 1/16
OCaml: Parametric polymorphism
OCaml Transcript
Lecture 3:
Tue 1/21
OCaml: List folding, tail recursion, exception-handling
OCaml Transcript
Operational Semantics
Lecture 4:
Thu 1/23
Large-step Operational Semantics
(See Assignment 2 reference section for class notes.)
Assignment 2 due 1/30
(SIMPL Interpreter)
Lecture 5:
Tue 1/28
Structural Induction
Lecture Notes
Lecture 6:
Thu 1/30
Small-step Operational Semantics
Lecture Notes
Quiz #1: OCaml programming
Assignment 3 due 2/11
(Operational Semantics)
Denotational Semantics
Lecture 7:
Tue 2/4
Denotational Semantics: Semantic domains and valuation functions
(See Assignment 3 reference section for class notes.)
Lecture 8:
Thu 2/6
Fixed points
Lecture Notes
Supplemental Notes on Complete Partial Orders
Lecture 9:
Tue 2/11
Fixed-point Induction
Lecture Notes
Quiz #2: Operational Semantics
Assignment 4 due 2/25
(Denotational Semantics)
Lecture 10:
Thu 2/13
Semantic Equivalence
Lecture Notes
Lecture 11:
Tue 2/18
Introduction to Formal Methods
Coq Proof of Semantic Equivalence
Type Theory
Lecture 12:
Thu 2/20
Type Theory: Introduction
(See Assignment 5 reference section for class notes.)
Lecture 13:
Tue 2/25
Type Theory: Type-soundness, Progress and Preservation
Lecture Notes
Quiz #3: Denotational Semantics
Assignment 5 due 3/21
(SIMPL Type-checker)
Lecture 14:
Thu 2/27
Program-proof Co-development
Lecture 15:
Tue 3/3
Midterm Review
Sample midterm exam questions w/solutions
Midterm:
Thu 3/5
Midterm Exam
Lambda Calculus
Lecture 16:
Tue 3/10
Untyped Lambda Calculus
(See reference section of Assignment 6 for class notes.)
Lecture 17:
Thu 3/12
System F
Lecture notes on System F
Lecture notes on the Curry-Howard Isomorphism
Quiz #4: Static semantics
Assignment 6 due 3/31
(Lambda calculus)
No Class:
Tue 3/17
No Class: Spring break
No Class:
Thu 3/19
No Class: Spring break
Lecture 18:
Tue 3/24
Canceled: Spring break (extended)
Lecture 19:
Thu 3/26
Canceled: Spring break (extended)
Logic Programming
Lecture 20:
Tue 3/31
pre-recorded Logic Programming: Part I
3-part PowerPoint Lecture on Logic Programming w/Audio Narrations
Quiz #5: Lambda calculus (on eLearning)
Assignment 7 due 4/9
(Prolog)
Lecture 21:
Thu 4/2
Logic Programming: Part II
(See Lecture 20 for link to lecture slides with audio.)
Lecture 22:
Tue 4/7
Logic Programming: Part III
(See Lecture 20 for link to lecture slides with audio.)
Lecture 23:
Thu 4/9
pre-recorded Language Features: weak vs. strong typing, function evaluation strategies
2-part PowerPoint Lecture on Language Features and Type Inference w/Audio Narrations
Quiz #6: Logic programming (on eLearning)
Assignment 8 due 4/21
(Functional SIMPL)
Lecture 24:
Tue 4/14
Language Features: Hindley-Milner type-inference
(See Lecture 23 link to lecture slides with audio.)
Supplemental Handout on Type-inference
Formal Verification
Lecture 25:
Thu 4/16
pre-recorded Axiomatic Semantics: Hoare Logic
4-part PowerPoint Lecture on Axiomatic Semantics w/Audio Narrations
C.A.R. Hoare's original 1969 paper on Axiomatic Semantics (optional reading)
Lecture 26:
Tue 4/21
Axiomatic Semantics: Loop invariants
(See Lecture 25 for link to lecture slides with audio.)
Supplemental Handout on Loop Invariants
Assignment 9 due 4/30
(Hoare Logic)
Lecture 27:
Thu 4/23
Axiomatic Semantics: Soundness, Completeness, Weakest precondition, strongest postcondition
(See Lecture 25 for link to lecture slides with audio.)
Lecture 28:
Tue 4/28
Final Review
Sample Final Exam with Solutions
Quiz #7:
Thu 4/30
Quiz #7: Axiomatic semantics (on eLearning)
Lecture 29:
Fri 5/1
Final Review
Final Exam:
Thu 5/7 2:00–4:45pm
Final Exam: Conducted as an online "assessment" on eLearning (like the quizzes). Assessment will consist of one "question" that is a pdf of the full exam. Students will submit answers by uploading photographs of their answer papers. The assessment will only be available within the exam time period (2:00–4:45pm), and student solutions must be uploaded within that window. Exams must be completed individually without the aid of internet resources, books, or notes, except for two pages (front and back) of whatever notes you wish.