CPSC509: Programming Language Principles

When/Where

Instructor

Course Description

Programming languages are a fundamental part of computer science. This course introduces the formal tools needed to describe precisely what a program means. These tools help us answer many useful questions about program analyses and transformations, such as:

Topics include:

Prerequisites

This course is intended for graduate students in computer science. There are no formal course prerequisites, but you are expected to have the kind of mathematical maturity typical of one who has taken an undergraduate discrete math or theory of computation course. We will explicitly study logical specification and proof techniques in this course, so don't worry if you are rusty or not very familiar. Here are some resources I find helpful for refreshing or improving your skill at writing proofs:

Familiarity with a functional programming language (e.g., Scheme, Racket, ML, Haskell) is useful but is not required. We will use the Racket programming language at times in the course to help reinforce the connection between the mathematics and programs/programming. I will introduce any needed programming concepts in class.

Materials

To facilitate discussion among students in the class and myself, we are using the Piazza Q&A platform. The system allows you to ask questions, refine answers as a group, carry on followup discussions, and disseminate relevant information. Rather than emailing questions to me, I ask that you post your questions to Piazza. If you have any problems or feedback for the developers, email team@piazza.com.
Find our class page here .

This course has no required textbook. Material will be primarily be provided in a set of notes and/or covered in class, as well as through some supplementary readings. The material we cover will draw from a variety of sources.

The following books are recommended as alternative sources of information about topics from this course:

Some other useful texts that provide a different perspective or more depth in some areas are:

Exams

There will be one comprehensive exam (date TBD).

Homeworks

There will be approximately 6 homework assignments during the course of the semester. I recommend that homeworks be typeset using the LaTeX document preparation system, but will not require it: you have the option to prepare your homework by hand, so long as you make sure that it is clearly legible by me. I plan to provide LaTeX templates for you, so this is a good chance to learn one of the more common tools for writing academic computer science papers, though the learning curve may be steep at first. I'm happy to give guidance on how to work with LaTeX (though I probably don't know all the latest tricks). You can turn in assignments electronically as PDF's either scanned or generated by LaTeX to Gradescope

Assignments must be your individual work. You may discuss the homeworks with others, but you must write up and hand in your own solutions. In particular, follow the whiteboard policy: at the end of the discussion the "whiteboard" must be erased and you must not transcribe or take with you anything that has been written on the board (or elsewhere) during your discussion. You must be able to reproduce the results solely on your own after any such discussion.

Do not draw upon solutions to assignments (or in notes) from similar courses, nor use other such materials (e.g., programs) from any web site or other external source in preparing your work.

Grading Policy

The final grade will be comprised of the following components, with the following plan for distribution of marks (subject to revision):

Resources

The following resources are to help you with your class work.

Course Schedule (UNDER CONSTRUCTION!)

The following is a draft course schedule, based on a prior offering of the course. The exact details (including some topics) will vary depending on the content covered in class and the interests and needs of the students (and myself).

I often update the notes as the term goes along. They are timestamped, so that you can tell when the most recent version was uploaded (note that the timestamp is distinct from the original date of creation).

Lec # Date Topics Notes Supplementary Readings
1 Jan 11 Course Introduction
2 13 Modeling Programming Languages Modeling Languages
3 18 Why Set Theory as a Foundation?
The Language of Logic and Set Theory
Set Theory
4 20 The Language of Logic and Set Theory (Continued)
5 25 How to Prove It (Propositional Fragment)
Lamport Proofs:
How to Write a Proof
How to Write a 21st-Century Proof
HLF Lecture
6 27 How to Prove It, Cont'd.
7 Feb 1 How to Prove It (First-Order Fragment).
Our Set Theory, Concisely
8 3 B: Language with many programs, few results
Inductive Definitions
Derivations as Data Structures
Inductive Definitions
Proof by Induction
9 8 HW1 Discussion
What is an Equational Function Definition?
Forward and Backward Reasoning From Inductive Definitions
10 10 Forward and Backward Reasoning (cont'd)
Principles of Proof By Induction
Principles of Function Definition By Recursion
11 15 Principles of Function Definition By Recursion, (cont'd)
Principles of Proof By Induction, (cont'd)
12 17 Natural (Big-Step) Semantics
IMP: An Imperative Programming Language
IMP Notes
Big-Step Notes
22 Reading Week: No Class
24 Reading Week: No Class
13 Mar 1 IMP, continued
A Taste of Divergence (As Non-convergence)
14 3 Another Take On Inductive Definitions and Induction Principles
Coinductive Definition: A Counterpoint to Inductive Definition
Modeling Divergence Explicitly
Coinduction Notes
15 8 Coinduction (cont'd.)
Is IMP's evaluator a total function or not?!?
Small-Step Semantics:
1) Structural Operational Semantics (S.O.S)
2) Reduction Semantics
S.O.S Notes
RS Notes
16 10 Small-Step Semantics 2:
1) Reduction Semantics (cont'd)
2) Abstract Machine Semantics
AM Notes
17 15 Small-Step Safety
Lexical Variables 1
Variable Notes
18 17 Lexical Variables 2
Introduction to Procedures
Procedures
19 22 Alpha-Equivalence and Barendregt's Variable Convention
Refining Rule Induction via Redefinition
Alpha Equivalence
20 24 Abstracting Abstract Syntax (Gödel Numbering)
Choose Your Own Induction Principle
Induction Unchained!
21 29 Proper Tail Calls
Store-Passing Semantics and Mutable References
Tail Calls
Mutable References
22 31 Exceptions
Exceptions
23 Apr 5 Type Systems
24 7 Type Systems 2