In this final lecture we have looked at type-safe elaboration of untyped concrete syntax into intrinsically-typed terms for expressions, statements, and programs. Dependent types are cool and ensures that we can describe our type checking algorithms and ensure they themselves do not go wrong.
Realising Ola
We now have all the moving pieces so that you can recreate Ola.
The steps required, will be to ensure all the previous steps, for describing terms and their evaluation, is now paired with steps for elaboration.
Using your knowledge of working with intrinsically-typed heaps construct an evaluation function for the language defined in lecture 1.
Realising Olaf
By following the exercises you will have the final pieces for realising Ola/Olaf in the project stub provided with this course.
Namely you will be working in the module and module heirachy Olaf.Elab.
Many of the extra data structures,
Exists
in the module hierarchy Extra.
We have also provided a main function in Olaf.Main that provides a verified pipeline for completing the implementation.
Where Next with Evaluating Intrinsically-Typed Terms
We have only looked at checking our term language. Olaf does not support type inference.
The next step will be to rethink how to make Olaf support type inference and what that requires. Although PLFA does have a good set of notes on Inference, Jana Dunfield has an excellent survey paper on Bi-Directional Typing that investigates bi-directional typing and its impact on developing meta-theory.