CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 3012
Times: TR 4:00-5:15
Location: ECSS 2.312
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: Thursdays 2:00-4:00, ECSS 3.704
Teaching Assistant: Vishwath Mohan
TA's Office Hours: Wednesdays 3:00-5:00, ECSS 4.610


Final Grades

Final exam grades and final course grades are now posted to eLearning. The "Final Exam" and the "Final Exam Letter" rows record the results of your final exam. The "Final" row at the top is your final course average including both homeworks and exams, and "Final Letter" is your final letter grade for the course.

Letter grade divisions were chosen at fairly wide gaps in the grade distribution, and no students were near the divisions. Thus, it is unlikely that any regrades will affect your final letter grade. However, if you believe there may be a significant grading error, please email me before Wednesday and I will recheck your scores.


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 plan to spend some serious time learning the material on your own.

Although the early course lectures will include a brief survey of the OCaml programming language, students will be expected to learn most of OCaml on their own. Therefore, if you want to get a head start, I recommend downloading and installing OCaml, and walking yourself through some of the many online tutorial examples:

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:

OCaml is available on each of the following CS servers: cslinux2.utdallas.edu, cscomp.utdallas.edu, cscomp1.utdallas.edu, cscomp2.utdallas.edu, cscomp3.utdallas.edu. When connecting from off-campus, ssh to cs1.utdallas.edu or cs2.utdallas.edu first, and then ssh to one of the other machines from there.

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:

Grading

Homework (40%): 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 4:05pm) on the due date. No late homeworks will be accepted.

Midterm (25%): There will be an in-class midterm exam in class on Tuesday, March 2nd. 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 6th 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 collaborate with students who are not currently enrolled in the class. In particular, it is a violation of the class homework policy to collaborate with a student who took the class in a previous semester or to consult their old homework solutions. These sources are off-limits because such "collaborations" tend to involve simply copying or paraphrasing someone else's answer to a similar homework problem, which does not show that you have learned the material yourself and does not prepare you for the 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 with OCaml Pre-assignment: Download and install OCaml. Compile and execute the Fibonacci example
Lecture 1:
Tue 1/12
Course Introduction: Functional vs. Imperative programming, Type-safe languages, intro to OCaml
Lecture Slides
Lecture 1 Notes (OCaml Tutorial)
Lecture 2:
Thu 1/14
OCaml: Parametric Polymorphism
Lecture 2 Notes (OCaml Tutorial)
Assignment 1 due
(OCaml intro)
Lecture 3:
Tue 1/19
OCaml: List folding, tail recursion, standard libraries, exception-handling
Lecture 3 Notes (OCaml Tutorial)
Thu 1/21 No Class
Operational Semantics
Lecture 4:
Tue 1/26
Large-step Semantics: Intro
Lecture 4 slides
See assignment 2 reference section for notes.
Assignment 2 due
(IMP Interpreter)
Lecture 5:
Thu 1/28
Large-step Semantics: Proof techniques
Lecture 5 Notes
Lecture 6:
Tue 2/2
Small-step Semantics
Lecture 6 Notes
Denotational Semantics
Lecture 7:
Thu 2/4
Denotational Semantics: Semantic Domains and Valuation Functions
Lecture 7 Notes
Assignment 3 due
(Operational Semantics)
Lecture 8:
Tue 2/9
Denotational Semantics: Fixed Points
See notes for Lectures 7 and 9.
NO CLASS:
Thu 2/11
Class canceled due to weather (university closed)
Lecture 9:
Tue 2/16
Fixed-point Induction
Lecture 9 Notes
Assignment 4 due
(Fixpoints)
Lecture 10:
Thu 2/18
Complete Partial Orders
Lecture 10 Notes
Type Theory
Lecture 11:
Tue 2/23
Type Theory: Introduction
See assignment 5 reference section for notes.
Lecture 12:
Thu 2/25
Midterm Review
Sample Midterm Exam
Midterm:
Tue 3/2
Midterm Exam
Lecture 13:
Thu 3/4
Type Theory: Type Soundness
Lecture 13 Notes
Assignment 5 due
(IMP Type-checker)
Lambda Calculus
Lecture 14:
Tue 3/9
Untyped Lambda Calculus
See assignment 6 reference section for notes.
Lecture 15:
Thu 3/11
Untyped Lambda Calculus: Encodings and Reductions
See assignment 6 reference section for notes.
Tue 3/16 No Class (Spring Break)
Thu 3/18 No Class (Spring Break)
Lecture 16:
Tue 3/23
Simply-typed Lambda Calculus
Lecture 16 Notes
Assignment 6 due
(Lambda calculus)
Lecture 17:
Thu 3/25
System F: Curry-Howard Isomorphism
Lecture 18:
Tue 3/30
System F: Hindley-Milner Type-inference
Lecture 18 Notes
Lecture 19:
Thu 4/1
Functions: Evaluation Strategies Assignment 7 due
(Functional IMP)
Lecture 20:
Tue 4/6
Summary/Comparison of Modern Language Features
Formal Verification of Programs
Lecture 21:
Thu 4/8
Axiomatic Semantics: Hoare Logic
C.A.R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10:576-580 and 583, October 1969.
Lecture 22:
Tue 4/13
Axiomatic Semantics: Loop Invariants, Weakest Precondition, Strongest Postcondition
Lecture 22 Notes
Assignment 8 due
(Hoare Logic)
Logic Programming in Prolog
Lecture 23:
Thu 4/15
Logic Programming: Part I
Lecture 23-25 Slides
Lecture 24:
Tue 4/20
Logic Programming: Part II
Course Evaluations
Lecture 23-25 Slides
Assignment 9 due
(Prolog)
Lecture 25:
Thu 4/22
Logic Programming: Part III
Lecture 23-25 Slides
Lecture 26:
Tue 4/27
Final Review
Sample Final Exam
Lecture 27:
Thu 4/29
Final Review
Thu 5/6
2:00-4:45pm
Final Exam