CS 6371: Advanced Programming Languages

Course Information

Title: CS 6371: Advanced Programming Languages
Course Registration Number: 12219
Times: MW 4:00-5:15
Location: ECSS 2.203
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: ECSS 3.704, Fri 3:00-5:00
Teaching Assistant: Meera Sridhar (mxs072100 AT utdallas)
TA's Office Hours: EC Open Access Lab (ECSS 2.103 & 2.104), Th 5:00-7:00pm


Announcement

Final exam and final course grades are released and are available via WebCT. (Final exam scores are out of 70 and are in the column labeled "Final Exam" and final course letter grades are in the column labeled "Final". If you would like to see your final exam, please email me for an appointment.


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. Small-step and large-step operational semantics
  3. Denotational semantics
  4. Fixpoints, fixpoint induction
  5. Axiomatic semantics
  6. Type theory
  7. Untyped and simply typed lambda calculus
  8. Partial evaluation, non-determinism
  9. Logic programming

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

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

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 on Wednesday, March 4. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.

Final (35%): The final exam for the course is scheduled for 2:00pm Friday, May 8. The exam will be cumulative, covering all material in the course. Students will have 2 hours and 45 minutes to complete it.

Homework Policy

All homework assignments in this course are to be completed INDIVIDUALLY. Submitting someone else's work as your own, whether it be a classmate's work, something you found in a book, or something you found in someone else's notes, is PLAGARISM and may result in an immediate failing grade for the course and/or expulsion from the computer science program. Therefore, please do not cheat! It is far better to get the problem wrong or not to turn in the assignment at all than to risk these severe penalties!

Students are encouraged to study together. This can include asking one another general questions about the course material (e.g., "How do you catch an exception in OCaml?") but NOT specific questions that reveal answers to homework problems (e.g., "How did you solve question 3?"). In general, if you are looking at or hearing someone else's answers to a homework you have not yet submitted, you are cheating.

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:
Mon 1/12
Course Introduction: Functional vs. Imperative programming, Type-safe languages, intro to OCaml
Lecture 1 OCaml Transcript
Lecture 1 Slides
Lecture 2:
Wed 1/14
OCaml: Parametric Polymorphism
Lecture 2 OCaml Transcript
Assignment 1 due
(Ocaml intro)
Mon 1/19 No Class (Martin Luther King Day)
Lecture 3:
Wed 1/21
OCaml: List folding, tail recursion, standard libraries, exception-handling
Lecture 3 OCaml Transcript
Operational Semantics
Lecture 4:
Mon 1/26
Large-step Semantics: Intro
(See assignment 2 for lecture notes.)
Assignment 2 due
(IMP Interpreter)
Wed 1/28 Class Canceled due to University Closing
Lecture 5:
Mon 2/2
Large-step Semantics: Proof techniques
Lecture Notes
Assignment 3 due
(Operational Semantics)
Lecture 6:
Wed 2/4
Small-step Semantics
(See assignment 3, section 3.3 for notes)
Denotational Semantics
Lecture 7:
Mon 2/9
Denotational Semantics: Semantic Domains and Valuation Functions
Lecture Notes
Lecture 8:
Wed 2/11
Denotational Semantics: Fixed Points
Lecture 9:
Mon 2/16
Fixed-point Induction
Lecture Notes
Assignment 4 due
(Fixpoints)
Lecture 10:
Wed 2/18
Fixpoints and CPO's
Lecture Notes
Lecture 11:
Mon 2/23
Class Canceled
Lecture 12:
Wed 2/25
Equivalence of Operational and Denotational Semantics
Lecture 13:
Mon 3/2
Midterm Review
Sample Midterm Exam
Midterm:
Wed 3/4
Midterm Exam
Lecture 14:
Mon 3/9
Midterm Post-review
Type Theory
Lecture 15:
Wed 3/11
Type Theory: Introduction
(See Assignment 5 for lecture notes.)
Assignment 5 due
(IMP Type-checker)
Mon 3/16 No Class (Spring break)
Wed 3/18 No Class (Spring break)
Lecture 16:
Mon 3/23
Type theory: Progress & Subject Reduction
Lecture Notes
Lambda Calculus
Lecture 17:
Wed 3/25
Untyped Lambda Calculus
(See Assignment 6 for lecture notes.)
Assignment 6 due
(Lambda calculus)
Lecture 18:
Mon 3/30
Simply Typed Lambda Calculus
Lecture Notes
Lecture 19:
Wed 4/1
Polymorphic Lambda Calculus: Polymorphic abstraction and polymorphic application
Lecture 20:
Mon 4/6
Polymorphic Lambda Calculus: Hindley-Milner Type-inference, Type-unification Assignment 7 due
(Functional IMP)
Lecture 21:
Wed 4/8
Functions: Call-by-Value, Call-by-Reference, Call-by-Name, Call-by-Need
Formal Verification of Programs
Lecture 22:
Mon 4/13
Axiomatic Semantics: Hoare Logic
Lecture Slides
Lecture 23:
Wed 4/15
Axiomatic Semantics: Loop Invariants, Weakest Precondition, Strongest Postcondition
Lecture Notes
Assignment 8 due
(Hoare Logic)
Logic Programming in Prolog
Lecture 24:
Mon 4/20
Logic Programming: Part I
Lecture Slides
Lecture 25:
Wed 4/22
Logic Programming: Part II
(see lecture slides from 4/20)
Assignment 9 due
(Prolog)
Lecture 26:
Mon 4/27
Logic Programming: Part III
(see lecture slides from 4/20)
Lecture 27:
Wed 4/29
Course Evaluations
Final Review
Lecture 28:
Mon 5/4
Final Review (cont.)
Fri 5/8
2:00-4:45pm
Final Exam