- Email: tolmach@pdx.edu
- Office Hours: please email for an appointment.

- Syllabus
- Slack channel Note: the first time you use this link, it may take you to the general page for the pdx-cs workspace; you need to sign in to access the cs578-specific channel.

Date | HW Due | Reading | Lecture Topics |
---|---|---|---|

May 12 | HW 5 | Pierce Ch. 12 | Normalization for STLC |

May 17 | Pierce Ch. 20 (but not Ch. 21) | Recursive Types | |

May 19 | HW 6 | Pierce Ch. 22 | Type Reconstruction |

May 24 | Pierce Ch. 23 and 25 | Universal Types | |

May 26 | HW 7 | Pierce Ch. 24 and 25 | Existential Types |

May 31 | NO LIVE CLASS (recorded lectures on Logical Relations; see below) | ||

June 2 | HW 8 | NO LIVE CLASS (recorded lectures on Logical Relations; see below) | |

June 7 | FINAL EXAM (10:15-12:05) |

- May 3 Midterm information
- June 7 Final information

- Mar 29 Introduction (audio recording) whiteboard 1 whiteboard 2
- Mar 31 Small-step semantics (audio recording)
- Notes on contextual semantics.

- Apr 5&7 Untyped Lambda Calculus Lecture slides (Apr 5 recording) (April 7 recording)
- Warm-up exercise on lambda calculus definitions (not to hand in) and solutions.

- Apr 12&14 Type Systems (Apr 12 audio recording) whiteboard 1 whiteboard 2 (Apr 14 audio recording)
- Apr 19&21 Extensions (Apr 19 audio recording) (Apr 21 recording)
- Apr 26 References (audio recording mp4)
- Apr 28 and May 5 IMP and Denotational Semantics (preliminary notes [revised May 19 11:35am]) (Apr 28 audio recording) (May 5 recording)
- May 10 Fixed Point Semantics (Notes Section 4 [revised May 19 11:35am]) (no recording; sorry)
- May 12 Normalization (Notes on Pierce's proof [revised May 13 10:20am]) (no recording; sorry)
- May 17 Recursive Types (recording)
- May 19 Type Inference Lecture slides [revised May 24 5:20pm] (no recording; sorry)
- May 24/26 Universal Types (May 26 recording)
- May 31/June 2 Logical Relations.
- Watch selections from Amal Ahmed's Lectures on Logical Relations given at the 2015 Oregon Programming Languages Summer School.
- Scroll down to find her lectures, near the bottom of the page.
- Each lecture is divided into multiple videos, each about 22 minutes long. A guide to their contents is below.
- You are recommended to watch the videos in
**bold**below. The other videos may also be useful as review of topics we have already covered in class. - You will find these notes on the lectures to be useful!
Lecture Video Topic 1 1 **General introduction to Logical Predicates and Relations**2-5 Normalization for the Simply-Typed Lambda Calculus (like Pierce Ch. 12) 2 1-3 **Type safety for STLC using Logical Predicates**4-5 Adding iso-recursive types to STLC (like Pierce Ch. 20) 3 1-2,3 (first 10 mins.) Type safety for STLC+recursive types using step-indexing 3 (last 10 mins.) System F Polymorphism (like Pierce Ch. 23) 4 **Parametricity and Contextual Equivalence**4 1-3 **Proof of Parametricity for System F using Logical relations**4 **Proof of a Free Theorem using Parametricity**5 1-3 Logical relation for System F + Existential and recursive types 4-5 Overall Survey of Logical Relations (based on these slides)

- Homework 1 (due 4/7/22) problem 4 "only if" solution Homework 1 OCaml sample solutions
- Homework 2 (due 4/14/22) problem 1 sample solution problem 9 OCaml sample solution
- Homework 3 (due 4/21/22) problem 4 sample solution
- Homework 4 (due 4/28/22) problem 1 sample solution [updated May3 11:55am]
- Homework 5 (due 5/12/22)
- IMP handout [revised May 19 11:35am; includes sample solutions to exercises 1 and 2]
- Mystery proof
- sample solution to problem 6

- Homework 6 (due 5/19/22)
- IMP handout [revised May 19 11:35am; includes sample solution to exercise 3]
- improvement to sample solution to Pierce 12.1.5

- Homework 7 (due 5/26/22) more sample solutions (updated May 30 5:40pm)
- Homework 8 (due 6/2/22) more sample solutions

- OCAML code for the various typechecker implementations.
- The author maintains a list of errata
for Types and Programming Languages. Check here first if you can't make sense of something in the text.
Be sure to look at
*all*the different errata list! Contrary to the comment at the top of the errata page, its contents are augmented,*not*superceded, by the Sumii list.

- The OCaml home page.
- Official OCaml Language and Library Reference.
- Alternative OCaml Library API Documentation.
- Michael Clarkson's excellent Functional Programming in OCaml textbook.
- Additional OCaml learning resources.
- You can download the latest version for your own machine.

- Download information for latex.
- The Overleaf online system.
- Pierce's style file for typesetting the definitions of inference rules. (You need to download this and put into the directory where you run latex.)
- Documentation for Tatsuta's proof style file which I often use for typesetting derivations. (This is already in standard latex distributions.)
- Here is an example (with the corresponding output) of how I do typesetting in the style of Pierce's book
- The detexify tool is handy for finding symbol names.
- A page discussing recommendations for where to start learning latex.

- Glynn Winskel,
*The Formal Semantics of Programming Languages*, MIT Press, 1993. - Robert Harper,
*Practical Foundations for Programming Languages*, 2nd ed., Cambridge Univ. Press, 2016. - David A. Schmidt,
*Denotational Semantics*, 1997.

- Coq: Pierce, et al., Software Foundations, esp. Vol 2.
- Coq: Chlipala, Formal Reasoning About Programs.
- Agda: Wadler, Kokke, and Siek, Programming Language Foundations in Agda.
- Isabelle/HOL: Nipkow and Klein, Concrete Semantics.