15-212: Principles of Programming

Lecture 3: Recursion and Induction

We review the methods of mathematical and complete induction and show how they can be applied to prove the correctness of ML functions. Key is an understanding of the operational semantics of ML.

Induction can be a difficult proof technique to apply, since we often need to generalize the theorem we want to prove, before the proof by induction goes through. Sometimes, this requires considerable ingenuity.

We also introduce clausal function definitions based on pattern matching.

We also briefly introduce type inference. Please see the on-line notes below for more details.

Key Concepts

Sample Code


On-line Notes by Robert Harper

Suggested Reading in Programming in Standard ML:

[ CS 15-212 Home page | schedule | language | assignments | handouts ]

Michael Erdmann