Adventures in Formalisation: Financial Contracts, Modules, and TwoLevel Type Theory
Abstract
We present three projects concerned with applications of proof assistants in the area of programming language theory and mathematics. The first project is about a certified compilation technique for a domainspecific programming language for financial contracts (the CL language). The code in CL is translated into a simple expression language wellsuited for integration with software components implementing Monte Carlo simulation techniques (pricing engines). The compilation procedure is accompanied with formal proofs of correctness carried out in Coq. The second project presents techniques that allow for formal reasoning with nested and mutually inductive structures built up from finite maps and sets. The techniques, which build on the theory of nominal sets combined with the ability to work with isomorphic representations of finite maps, make it possible to give a formal treatment, in Coq, of a higherorder module system, including the ability to eliminate at compile time abstraction barriers introduced by the module system. The development is based on earlier work on static interpretation of modules and provides the foundation for a higherorder module language for Futhark, an optimising compiler targeting dataparallel architectures. The third project presents an implementation of twolevel type theory, a version of MartinLof type theory with two equality types: the first acts as the usual equality of homotopy type theory, while the second allows us to reason about strict equality. In this system, we can formalise results of partially metatheoretic nature. We develop and explore in details how twolevel type theory can be implemented in a proof assistant, providing a prototype implementation in the proof assistant Lean. We demonstrate an application of twolevel type theory by developing some results on the theory of inverse diagrams using our Lean implementation.
 Publication:

arXiv eprints
 Pub Date:
 November 2018
 arXiv:
 arXiv:1811.11317
 Bibcode:
 2018arXiv181111317A
 Keywords:

 Computer Science  Programming Languages
 EPrint:
 PhD thesis defended in January 2018 at University of Copenhagen, Department of Computer Science