15-150: Principles of Functional Programming

Lecture 5: Datatypes, Recursion and Structural Induction on Trees

We showed how to create some user-defined tree datatypes.

We showed how to prove theorems about trees using structural induction.

Key Concepts

Sample Code

The notes from last lecture are also again relevant

Proof of totality of the depth function discussed in lecture