15819 Advanced Topics in Programming Languages: Resource Analysis
Course Information
Time:  Monday and Wednesday, 1:30pm2:50pm  
Room:  4101 GHC  
Instructor:  Jan Hoffmann  
Discussion Bboard:  Piazza Page  
Office Hours  
Jan Hoffmann:  Tuesday 14:0015:00  9105 GHC 
Synopsis
Resource usagethe amount of time, memory, and energy a program requires for its executionis one of the central subjects of computer science. Nevertheless, resource usage often does not play a central role in classical programminglanguage concepts such as operational semantics, type systems, and program logics. This course will revisit these concepts to model and analyze resource usage of programs in a formal and compositional way. An emphasis will be on practical, typebased techniques that automatically inform programmers about the resource usage of their code.
Topics
 Recurrence relations
 Amortized analysis and the potential method
 Type systems and type inference
 Operational semantics
 Cost semantics for parallel and sequential evaluation
 Linear type systems
 Linear automatic amortized resource analysis
 Automatic amortized resource analysis for higherorder programs
 Polynomial amortized resource analysis
 Linear programming and the simplex algorithm
 Type inference for automatic amortized resource analysis
 Costfree types and resourcepolymorphic recursion
 Imperative programming and quantitative Hoare logics
 Implementation issues and Resource Aware ML
Text
There will be no text, but course notes and papers will be distributed. We will use the programming language Resource Aware ML (RAML) and the static analysis tool C4B.
References
Robert Harper, Practical Foundations for Programming Languages (Second Edition), Cambridge University Press, 2015 (to appear). 
[Online Preview] 
Benjamin Pierce, Types and Programming Languages, MIT Press, 2005. 
[Website] 
Jan Hoffmann, Types with Potential: Polynomial Resource Bounds via Automatic Amortized Analysis, PhD Disseration, LMU Munich, 2011. 
[PDF] 
Homework
You are required to achieve a grade of B on each homework assignment, and to complete a course project. If you receive a C or D on an ontime submission, you will be given three days in which to revise to achieve a B grade on that assignment.
All homeworks are due at the beginning of lecture on the stated due date. No late homeworks will be accepted, unless prior permission is obtained from the instructor, which will be granted only under exceptional circumstances.
Homeworks are to be submitted by sending the PDF via email to the instructor with "15814 Homework" as the subject line. No late homeworks will be accepted. Any redo's must be finished within three days of their being returned to you. Only one redo is permitted per assignment.
Course Project
Every student has to compelte a course project to pass the class. Projects can be a presentation in class, a short paper, or an implementation.
Academic Integrity
Unless explicitly instructed otherwise, all homework and the course project (unless agreed upon otherwise) is to be solely your own, and may not be shared with or borrowed from any other person in the course. You are not permitted to draw upon assignments or solutions from previous instances of the course, nor to use course materials (such as assignments or programs) obtained from any web site or other external source in preparing your work.
You may discuss homework assignments with other students in the class, but you must adhere to the whiteboard policy. At the end of discussion the whiteboard must be erased, and you must not transcribe or take with you anything that has been written on the board during your discussion. You must be able to reproduce the results solely on your own after any such discussion.
Also see Acadmic Integrity at Carnegie Mellon.
Grading
CS PhD students are assigned a pass/fail grade in the University grading system, but are given an internal letter grade for Black Friday purposes. A final letter grade of B is required to pass this course. To achieve this, you must have (1) completed all homework assignments ontime with a grade of B; and (2) earned a grade of B or better on the course project.
Undergraduate students and students in other programs will be assigned letter grades according to the same policies used to assign internal letter grades for CS PhD students.
Schedule of Lectures
This is a preliminary schedule that will be adapted during the course.
Date  Topic  Reading  Homework  

Jan  11  Resoure analysis  Types with Potential: 1  
Jan  13  Recurrence relations  Intro to Algorithms: 4 
HW1 out
Problem Set 1 

Jan  18  Martin Luther King Day; No Classes  
Jan  20  POPL'16; No Class  
Jan  25  Amortized Analysis with the Potential Method  Intro to Algorithms: 4 
HW1 due  HW2 out
Problem Set 2  TeX file  Preamble TeX file 

Jan  27  Functional programming and simple type systems  PFPL: 4  
Feb  1  Polymorphism and type inference  TAPL: 22  HW2 due  HW3 out
Problem Set 3  TeX file  unify.ml 

Feb  3  Polymorphism and type inference  TAPL: 22  
Feb  08  Operational semantics  PFPL: 7  HW3 due  HW4 out Problem Set 4  TeX file  definitions.tex 

Feb  10  Operational cost semantics 
Types with Potential: 4 PFPL: 7.4 

Feb  15  No class  
Feb  17  No class  
Feb  22  Operational cost semantics 
Types with Potential: 4 PFPL: 7.4 
HW4 due  HW5 out Problem Set 5  TeX file 

Feb  24  Operational cost semantics  
Feb  29  Substructural type systems  Pierce, Advanced Topics in Types and Programming Languages: 1  HW5 due  HW6 out Problem Set 6  TeX file 

Mar  2  Linear automatic amortized resource analysis (AARA).  Types with Potential: 4  
Mar  7  Spring break; No class  
Mar  9  Spring break; No class  
Mar  14  Linear automatic amortized resource analysis (AARA).  Types with Potential: 4  HW6 due  HW7 out Problem Set 7  TeX file  linear_types.tex  rtyps.sty 

Mar  16  Linear automatic amortized resource analysis (AARA).  Types with Potential: 4  
Mar  21  Soundness of linear AARA.  Types with Potential: 4  
Mar  23  Type inference for linear AARA.  Types with Potential: 4  
Mar  28  Univariate Polynomial AARA  Types with Potential: 5  HW7 due  HW8 out Problem Set 8  TeX file  search.raml 

Mar  30  Univariate Polynomial AARA  Types with Potential: 5  
Apr  4  Costfree types and resourcepolymorphic recursion  Types with Potential: 5  
Apr  6  Multivarite resource polynomials  Types with Potential: 6  
Apr  11  Multivariate AARA  Types with Potential: 6  HW8 due  HW9 out Problem Set 9  TeX file  uni_types.tex 

Apr  13  Multivariate AARA and userdefined types  
Apr  18  Higherorder AARA  
Apr  20  Project Presentation  
Apr  25  Project Presentation  HW9 due  
Apr  27  Project Presentation 
Thanks to Bob Harper for creating and sharing this website template.