Where are we
System F gave us type abstraction
code reuse
strong abstractions
dierent from real languages (like ML), but the right
foundation
CS-XXX: Graduate Programming Languages
Lecture 17 Recursive Types
This lecture: Recursive Types (dierent use of t
Name:
CSE505, Winter 2012, Final Examination
March 12, 2012
Rules:
The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 2:20.
You can rip apart the pages.
There are 100 points total, distri
Name:
CSE505, Fall 2012, Final Examination
December 10, 2012
Rules:
The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 12:20.
You can rip apart the pages.
There are 100 points total, dist
Name:
CSE 505, Fall 2009, Final Examination
14 December 2009
Please do not turn the page until everyone is ready.
Rules:
The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 12:20.
You can ri
Name:
CSE505, Winter 2012, Final Examination
March 12, 2012
Rules:
The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 2:20.
You can rip apart the pages.
There are 100 points total, distri
Name:
CSE505, Fall 2012, Final Examination
December 10, 2012
Rules:
The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 12:20.
You can rip apart the pages.
There are 100 points total, dist
Name:
CSE 505, Fall 2008, Final Examination 11 December 2008
Please do not turn the page until everyone is ready.
Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper. Please stop promptly at 10:20. You can rip a
Name:
CSE 505, Fall 2008, Final Examination 11 December 2008
Please do not turn the page until everyone is ready.
Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper. Please stop promptly at 10:20. You can rip a
Name:
CSE 505, Fall 2009, Final Examination
14 December 2009
Please do not turn the page until everyone is ready.
Rules:
The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.
Please stop promptly at 12:20.
You can ri
Name:
CSE 505, Fall 2008, Midterm Examination 29 October 2008
Please do not turn the page until everyone is ready.
Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper. Please stop promptly at 1:20. You can rip a
Name:
CSE 505, Fall 2008, Midterm Examination 29 October 2008
Please do not turn the page until everyone is ready.
Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper. Please stop promptly at 1:20. You can rip a
Review
-calculus syntax:
CS-XXX: Graduate Programming Languages
e := x. e | x | e e
v := x. e
Call-By-Value Left-To-Right Small-Step Operational Semantics:
ee
Lecture 8 Reduction Strategies; Substitution
e1 e1
(x. e) v e[v/x]
Dan Grossman
2012
e2 e2
e1 e2
A dierent approach
Operational semantics denes an interpreter, from abstract syntax
to abstract syntax. Metalanguage is inference rules (slides) or
OCaml (interp.ml)
CS-XXX: Graduate Programming Languages
Denotational semantics denes a compiler (translate
Where we are
Done: Syntax, semantics, and equivalence
For a language with little more than loops and global variables
CS-XXX: Graduate Programming Languages
Now: Didnt IMP leave some things out?
In particular: scope, functions, and data structures
(Not to
Dan Grossman; Graduate Programming Languages; Lecture 4 Proofs
Note: It is instructive to write out proofs "live" in class.
=
Theorem: while 1 skip always deverges, i.e.,
Restated: For all H and n, there exists H' and s' such that
H; while 1 skip ->n H';
Dan Grossman; Graduate Programming Languages; Lecture 2 Proofs
Note: It is instructive to write out proofs "live" in class.
=
Theorem: There exist expressions with three constants.
Reasonable proof: Consider (1+2)+3 and the definition of expressions.
More
Where we are
Done: OCaml tutorial, IMP syntax, structural induction
Now: Operational semantics for our little IMP language
CS-XXX: Graduate Programming Languages
Most of what you need for Homework 1
Lecture 3 Operational Semantics
(But Problem 4 requires
Graduate Programming Languages, Write a Technical Perspective
Due: Three Deadlines As Described Below
Introduction: In recent years, the magazine Communications of the ACM (http:/cacm.acm.org/magazines/)
has republished two computer-science research artic
Dan Grossman; Graduate Programming Languages; Lecture 6 Supplement
In class we sketched several proofs, but proof sketches invariably skip steps and have small errors. Here are
the proofs more carefully laid out, as one might do on a homework assignment.
Looking back, looking forward
This is the last lecture using IMP (hooray!). Done:
Abstract syntax
Operational semantics (large-step and small-step)
CS-XXX: Graduate Programming Languages
Semantic properties of (sets of) programs
Pseudo-denotational semant
Graduate Programming Languages:
Type Safety for STLC with Constants
Most of this is available in the slides. However, it can help to see it all in one place.
Syntax
e
v
:=
:=
:=
:=
c | x. e | x | e e
c | x. e
int |
| , x:
Evaluation Rules (a.k.a. Dynami
This lecture
Carefully consider two proofs using our IMP operational semantics
First emphasizes need to strengthen an induction hypothesis
CS-XXX: Graduate Programming Languages
An art: We will purposely take several wrong turns
Second shows a property is
2012
OCaml tutorial, Dan Grossman
Later: multiple files
ocamlprof,
ocamldebug,
ocaml
ocamlc i file.ml
ocamlopt file.ml
ocamlc file.ml
compile to bytecodes (put
in executable)
compile to native (1-5x
faster, no need in class)
print types of all top-level
Graduate Programming Languages: Reference Sheet for Lecture 3
s := skip | x := e | s; s | if e s s | while e s
e := c | x | e + e | e e
(c cfw_. . . , 2, 1, 0, 1, 2, . . .)
(x cfw_x1 , x2 , . . . , y1 , y2 , . . . , z1 , z2 , . . . , . . .)
Semantics for
Name:
CSE505, Fall 2012, Midterm Examination
October 30, 2012
Rules:
The exam is closed-book, closed-notes, except for one side of one 8.5x11in piece of paper.
Please stop promptly at Noon.
You can rip apart the pages if you like.
There are 100 points
Finally, some formal PL content
For our rst formal language, lets leave out functions, objects,
records, threads, exceptions, .
CS-XXX: Graduate Programming Languages
Whats left: integers, mutable variables, control-ow
(Abstract) syntax using a common met
CSE 505: Programming Languages
Lecture 17 Subtyping
Zach Tatlock
Fall 2013
Tradeos
Desirable type system properties (desiderata):
soundness - exclude all programs that get stuck
completeness - include all programs that dont get stuck
decidability - eectiv
CSE 505: Programming Languages
Lecture 13
Evaluation Contexts
First-Class Continuations
Continuation-Passing Style
Zach Tatlock
Fall 2013
GOTO the past / programs choose their own adventure.
Zach Tatlock
CSE 505 Fall 2013, Lecture 13
2
But rst, some clea
CSE 505: Programming Languages
Lecture 13 Safely Extending STLC: Sums,
Products, Bools
Zach Tatlock
Fall 2013
Review
e := x. e | x | e e | c
v := x. e | c
:= int |
:= | , x :
e1 e1
e1 e2 e1 e2
(x. e) v e[v/x]
e2 e2
v e 2 v e2
e[e /x]: capture-avoiding