This lecture, we introduced the type of binary trees in SML, which make use of SML's powerful datatypes language feature.
We explored the different kind of traversals on trees, and found that trees admitted a new principle of structural induction due to having a different form than that of lists. We then did a structural induction proof on trees, where we discovered the necessity of totality citations due to stepping through theorem values.
To finish off the lecture, we discussed the power of having custom-built datatypes that fit a problem exactly. We talked about the importance of making illegal states unrepresentable and defining one's problem domain specifically.
-->
We introduced datatype declarations as a form of abstraction designed
to relieve a programmer from the burden of keeping track of low-level
hacking conventions.
We considered the predefined datatype
order with constant constructors LESS,
EQUAL, GREATER.
We made up some of our own
datatypes, including a datatype to model the extended integers, two
different tree datatypes, and a datatype for operator-operand trees.
We showed how to prove theorems about trees using structural induction.