CS 582 Programming Languages II (Winter 2019)

Course Description

The course CS 582 "Programming Languages II" is a continuation of CS 581 and introduces advanced concepts found in programming languages through the definition of a series of small toy languages. For each example language different language aspects (e.g. abstract syntax, semantics, and type systems) will be defined mathematically as well as through the implementation in metalanguages.

The focus of this class is thus on the following three areas.

Quick Links

Slides and Code

I will try to make the slides available online before each lecture, but be aware that there might be some last-minute changes. [Rationale for laptop policy]

0.Basic Info [pdf] (Version 01/07/19)
1.Introduction [pdf] (Version 12/07/18) [Prolog Slides] [Solution to Prolog Exercises]
2.Idris [pdf] (Version 01/09/19) [Solutions] [Idris.idr]
3.Inference Rules [pdf] (Version 01/28/19) [Solutions] [Bool_Syntax.idr Imp_Syntax.idr InfRules.idr]
4.Operational Semantics [pdf] (Version 02/04/19) [Solutions] [Bool_SmallStep.idr Bool_BigStep.idr Imp_State.idr Imp_BigStep.idr Bool_BigStep.pl Bool_SmallStep.pl draw.pl rule.pl ]
5.Language Properties, Proofs, and Induction [pdf] (Version 02/21/19) [Solutions] [Properties.idr Bool_Prop.idr ]
6.Typing [pdf] (Version 02/27/19) [Solutions]
7.Type Inference [pdf] (Version 03/07/19) [Solutions]

Back to the table of contents

Background Reading

Here is some background reading material that provides additional information on some of the topics discussed in class. The following book explains operational semantics and type systems. In particular, chapters 4, 6, 8, and 9 are relevant for this course.

Types and Programming Languages
By Benjamin C. Pierce. MIT Press, 2002
A thorough introduction to Idris can be found in the following book. In particular, chapters 4, 6, 8, and 9 are relevant for this course.

Type-Driven Development with Idris
By Edwin Brady. Manning, 2017

Further documentation (including a tutorial and a reference manual), information about downloading and installing Idris, and other information about Idris is collected on the

Idris Language Home Page.

Another tutorial can be found here. A very good introduction to the use of dependent types for expressing and proving program properties is provided in the following free online book.

Software Foundations
By Benjamin C. Pierce et al. 2015
A detailed introduction into type theory, which is the basis for Idris and other dependently typed programming languages, is given in the following book, which is also freely available online.ยก

Type Theory and Functional Programming
By Simon Thompson, Addison-Wesley, 1991 online version
A gentle introduction to the Curry-Howard isomorphism is the following paper. It is an easy read that should make particular sense after the first several weeks of class.

Propositions as Types
By Philip Wadler, Communications of the ACM 58(12), 2015, pp. 75-84

Back to the table of contents


In this class we will be using the Piazza platform for: You should sign up for Piazza and join the class page ASAP so that you don't miss any important announcements!

CS 582 on Piazza

The Piazza Q&A platform is geared toward students helping other students. Anybody can post or answer a question, and you can even do so anonymously if you're shy. The instructor can then revise (if needed) and endorse student answers so you can be confident in the quality of the response. Students are strongly encouraged to post questions (about lectures, quizzes, or anything class-related) to Piazza first, rather than email the instructor. Students should also frequently check in to answer other students' questions. Not only will this enable everyone to get help quickly, but teaching someone else is the best way to learn something, so you'll be improving your understanding of the material as well.

The concept of peer instruction is based on the idea that students discuss class material with each other during class after having answered a particular question differently. These individual discussions help clarify specific misunderstandings and contribute to a solid understanding of the class material.

Back to the table of contents

Grading Policy

Grades will be roughly computed as follows. (I might decide later to adjust the weights in cases in which that would lead to a better overall total grade.) For 90% or more, you will receive an A; for less than 30% you will receive an F. The remaining grades in between are assigned linearly. I might lift individual grades if clustering of points achieved by students suggests so (but I won't assign grades worse than indicated by the above linear schema). If you are too lazy to calculate, you can look up grades in this table.

Grading Results

I will hand out corrected quizzes and exams in class. Should you miss that lecture, please contact me during the office hours.

Quiz/ExamGrade Distribution
    A       B or better     Median  
Quiz 150%83%93
Quiz 250%83%87.5
Quiz 333%83%77
Quiz 450%83%86

Back to the table of contents

IMPORTANT NOTE! This class is a continuation of the class CS 581, which is a prerequisite for CS 582. To successfully participate in CS 582 it is imperative that you have a solid understanding of the following concepts.