Automatic generation of proof terms in dependently typed programming languages
MetadataShow full item record
Dependent type theories are a kind of mathematical foundations investigated both for the formalisation of mathematics and for reasoning about programs. They are implemented as the kernel of many proof assistants and programming languages with proofs (Coq, Agda, Idris, Dedukti, Matita, etc). Dependent types allow to encode elegantly and constructively the universal and existential quantifications of higher-order logics and are therefore adapted for writing logical propositions and proofs. However, their usage is not limited to the area of pure logic. Indeed, some recent work has shown that they can also be powerful for driving the construction of programs. Using more precise types not only helps to gain confidence about the program built, but it can also help its construction, giving rise to a new style of programming called Type-Driven Development. However, one difficulty with reasoning and programming with dependent types is that proof obligations arise naturally once programs become even moderately sized. For example, implementing an adder for binary numbers indexed over their natural number equivalents naturally leads to proof obligations for equalities of expressions over natural numbers. The need for these equality proofs comes, in intensional type theories (like CIC and ML) from the fact that in a non-empty context, the propositional equality allows us to prove as equal (with the induction principles) terms that are not judgementally equal, which implies that the typechecker can't always obtain equality proofs by reduction. As far as possible, we would like to solve such proof obligations automatically, and we absolutely need it if we want dependent types to be used more broadly, and perhaps one day to become the standard in functional programming. In this thesis, we show one way to automate these proofs by reflection in the dependently typed programming language Idris. However, the method that we follow is independent from the language being used, and this work could be reproduced in any dependently-typed language. We present an original type-safe reflection mechanism, where reflected terms are indexed by the original Idris expression that they represent, and show how it allows us to easily construct and manipulate proofs. We build a hierarchy of correct-by-construction tactics for proving equivalences in semi-groups, monoids, commutative monoids, groups, commutative groups, semi-rings and rings. We also show how each tactic reuses those from simpler structures, thus avoiding duplication of code and proofs. Finally, and as a conclusion, we discuss the trust we can have in such machine-checked proofs.
Thesis, PhD Doctor of Philosophy
Attribution-NonCommercial-NoDerivatives 4.0 Internationalhttp://creativecommons.org/licenses/by-nc-nd/4.0/
Except where otherwise noted within the work, this item's license for re-use is described as Attribution-NonCommercial-NoDerivatives 4.0 International
Items in the St Andrews Research Repository are protected by copyright, with all rights reserved, unless otherwise indicated.
Showing items related by title, author, creator and subject.
Lin, Yuhui; Bundy, Alan; Grov, Gudmund; Maclean, Ewen (2019-02) - Journal articleThe use of formal method techniques can contribute to the production of more reliable and dependable systems. However, a common bottleneck for industrial adoption of such techniques is the needs for interactive proofs. We ...
"I wasnae on anyone's list for haeing a heart attack. I thought I wis bullet proof!" : understanding men's and women's experiences of and their responses to heart attack and recovery in post-industrial Fife, Scotland McGarrol, Sarah (University of St Andrews, 2014) - ThesisCoronary heart disease (including heart attacks) is a major cause of mortality and morbidity and within the UK the highest rates of CHD are observed in Scotland. Geographical health inequalities are observed for CHD and ...
Gene knock-in as a tool to phenotype clinically relevant varient alleles for studies on malaria pathobiology: proof of concept using the plasmodium knowlesi normocyte binding protein Xa gene Millar, Scott B. (University of St Andrews, 2017-11-01) - ThesisThe zoonotic parasite, Plasmodium knowlesi, is one of five human malaria species. P. knowlesi is geographically restricted to locations of the long-tailed and pig-tailed macaque, indigenous across South-East Asia (SEA). ...