Types for Imperative Programs
Adam Chlipala
MIT
Based on slides by Armando Solar-Lezama & George
Necula
6.820
October 2, 2013
1
Related Reading
On operational semantics for IMP:
Chapter 2 of Winksel,
Introduction to Operational Semantics
On lambda-calculu
Coq Crash Course, Continued
(and a bit about induction)
Adam Chlipala
MIT
6.820
September 18, 2013
Standard Mathematical Induction (i.e. over the natural numbers)
N := O | S N
Induction principle:
To prove n N. P(n):
Base case:
Show P(0).
Inductive case:
Coq Crash Course, Continued
(and a bit about induction)
Adam Chlipala
MIT
6.820
September 18, 2013
Standard Mathematical Induction (i.e. over the natural numbers)
N := O | S N
Induction principle:
To prove n N. P(n):
Base case:
Show P(0).
Inductive case:
Simple Types
Armando Solar-Lezama and Adam Chlipala
Computer Science and Artificial Intelligence Laboratory
M.I.T.
September 23, 2013
L06-1
Why Types
let
f x = if x then 5 else 2
in
f 5+1
let
f x = if x then 5 else 2
in
f6
let
f x = if x then 5 else 2
in
Subtyping
Adam Chlipala
MIT
6.820
September 30, 2013
Related Reading
Chapter 15 of Pierce, Subtyping
2
Subtyping in Java: Primitive Types
void foo(int n) cfw_
float f = n;
/ .and so on.
int float
3
Subtyping in Java: Interfaces
interface List cfw_
List a
Type Inference and the
Hindley-Milner Type System
Armando Solar-Lezama
Computer Science and Artificial Intelligence Laboratory
M.I.T.
With slides from Arvind
September 29, 2011
September 29, 2011
http:/stellar.mit.edu/S/course/6/fa11/6.820
L07-1
Type Infe
6.820 Lecture 4: Coq Crash Course
Adam Chlipala
September 16, 2013
Plan
1. Review of three styles of operational semantics
2. Brieng on Coq, installing & running it, etc.
3. Interactive examples working up to operational semantics
-Calculus Big-Step Seman
Public service announcement:
The ACM SIGPLAN
International Conference on
Functional Programming
(ICFP)
is in Boston September 22 to 28.
There are a variety of collocated events, aimed at
researchers, practitioners, and/or both.
http:/icfpconference.org/ic
Foundations of Program Analysis
Fall 2013
Instructors:
Adam Chlipala & Armando Solar-Lezama
Meeting Times:
Lecture: MW 1-2:30 Room: 66-156
Optional Recitation: F 1-2:30 Room: TBA
Grading:
Homework: There will be 6 homework assignments worth between 15 and
The -calculus
Adam Chlipala
MIT
6.820
Adapted from Arvind 2010 Solar-Lezama 2011
September 9, 2013
1
Functions
.
.
.
Domain
.
.
.
f:DR
Range
A function may be viewed as a set of
ordered pairs <d,r> where d D and r R.
But we need to specify a method of
c
Public service announcement:
The ACM SIGPLAN
International Conference on
Functional Programming
(ICFP)
is in Boston September 22 to 28.
There are a variety of collocated events, aimed at
researchers, practitioners, and/or both.
http:/icfpconference.org/ic