- Email: tolmach@pdx.edu
- Office Hours: please email for an appointment in person or on zoom.

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

- To check whether you have the necessary background for this course, trying taking this review quiz.
If these problems aren't reasonably straightforward for you (maybe after a bit of review from previous courses), don't despair, but
please
**do**consult the instructor about whether it makes sense to stay in the course. (Here are sample solutions if you get really stuck.)

- May 2 Midterm (postponed to May 9) midterm with sample solutions information sample midterm sample midterm solutions
- June 14 Final Due information

- Handout on Contextual Semantics [Revised 4/6/24 1:30pm to fix links in Notes; Revised 4/11/24 6:10pm to fix solution to exercise 2]

- Apr 2 Introduction (recording) (whiteboard left) (whiteboard right)
- Apr 4 Small-step semantics (recording)
- Apr 9&11 Untyped Lambda Calculus Lecture notes (Apr 9 recording) (sorry;no Apr 11 recording)
- Apr 16 Pure Lambda Calculus Encoding; Derivations (recording) (final board screen shot)
- Apr 18 Type Systems (recording)
- Apr 23 Preservation and Substitution Lemma (recording)
- Apr 25 Extensions (recording)
- Apr 30 References (recording)
- May 7 Review (recording)
- May 14 Normalization (Notes on Pierce's proof) (partial recording; first half is missing; sorry)
- May 16 Normalization, continued; Semantic type safety (Notes on Type Safety via Logical Relations) (recording)
- May 21 Recursive Types (recording)
- May 23 Type Inference Lecture slides [revised 5/23 4:30pm] (recording)
- May 28 Universal Types (recording)
- May 30 Let-polymorphism; Existential Types (recording)
- June 4 IMP Language and Denotational Semantics (Detailed lecture notes -- read sections 1-3 and do exercises therein) (recording)

- Homework 1 (due 4/9/24) problem 4 "only if" solution [revised 4/12/24 2:50pm to add alternative solution] Problem Homework 7 OCaml sample solutions
- Homework 2 (due 4/16/24) additional solutions [revised 4/16/24 8:50pm to clarify solution to 6.2 proof] Problem 9 OCaml sample solutions
- Homework 3 (due 4/23/24) additional solutions
- Homework 4 (due 4/30/24) additional solutions [typo fixed 5/7/24 4:20pm]
- Homework 5 (due 5/7/24)
- Homework 6 (due 5/21/24)
- Homework 7 (due 5/28/24) more sample solutions
- Homework 8 (due 6/4/24) more sample solutions

- OCAML code for the various typechecker implementations.
- An import list of errata for Types and Programming Languages. Check here first if you can't make sense of something in the text.

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