15-150 Fall 2016
Lab 02
Thursday 1st September, 2016
The goal for this lab is to make you more comfortable writing induction proofs on inductively
defined objects such as lists and trees. You will also have the opportunity to practice your
SML skills by w
15-150 Fall 2015
Lecture 3
Specifications, proofs, and induction
Stephen Brookes
1
1
Overview
This chapter consists of two parts, the first dealing with integers and the
second dealing with lists. We focus first on functions from (tuples of) integers
to i
15-150 Fall 2015
Stephen Brookes
Lecture 7
Sorting an integer tree
1
1
Outline
Representing integer trees in ML.
Tree-based mergesort: a lesson in design and implementation.
Specifications, correctness and proofs
Work and span analysis
2
Background
As
15-150 Fall 2015
Lecture 5
Stephen Brookes
1
Introduction
These notes introduce techniques for analyzing the runtime of functional
programs. You should already be familiar with the basic concepts, but in
any case we give a brief recap of the main ideas. W
15-150 Fall 2015
Stephen Brookes
LECTURE 1
Tuesday, September 1
BAD PROGRAM OF THE DAY
fun foo (D, M, Y) =!
if M>2 then !
(13 * (M-2) - 1) div 5 + (Y mod 100) div 4 + (Y div 100) div 4) + (Y mod 100) + D - 2 * (Y div 100) mod 7!
else!
(13 * (M + 10) - 1)
15-150 Fall 2015
Stephen Brookes
Lecture 4
Using induction
Last time
Specifications of applicative behavior
Evaluational and equational
Type, REQUIRES and ENSURES
For all (properly typed) arguments
that satisfy the REQUIRES,
the function produces
15-150 Fall 2015
Lecture 3
Stephen Brookes
Evaluation and equations
Specifications and proofs
Your weekly plan
Come to class! Attend all labs!
After class, read lecture notes (posted online)
do self-test
Start homework early, finish on time
Go t
15-150 Fall 2015
Lecture 2
Stephen Brookes
1
Objectives
We remind you that the main objectives of the course are to learn:
To write functional programs
To write specifications and prove program correctness
To analyze the sequential and parallel running
15-150 Fall 2015
Lecture 5
Tuesday, 15 September
Announcements
coming soon, to an autolab near you!
HOMEWORK 1
MAX
MEAN
MEDIAN
ST DEV
50
45.4
47
8.6
Homework 2 due tonight
Homework 3 out tomorrow
NO CHEATING
Today
Work, (sequential) runtime
Recur
15-150 Fall 2015
Stephen Brookes
LECTURE 2
Thursday, September 3
Announcements
HOMEWORK 1 is out.
Due Tuesday 8 September 11:59pm
Must be your OWN work
Read course policy
and hand in signed commitment
Academic Integrity
No collaboration on homework
15-150 Fall 2015
Lecture 1
Stephen Brookes
1
Themes
functional programming
correctness, termination, and performance
types, specifications, and proofs
evaluation and equivalence
referential transparency and compositional reasoning
exploiting paralle