PhD thesis Formalization of Logic in the Isabelle Proof Assistant Anders Schlichtkrull Technical University of Denmark September 14, 2018 PHD-2018-493 Abstract Isabelle is a proof assistant, i.e. a computer program that helps its user to define concepts in mathematics and computer science as well as to prove properties about them. This process is called formalization. Proof assistants aid their users by ensuring that proofs are constructed correctly and by conducting parts of the proofs automatically. A logical calculus is a set of rules and axioms that can be applied to construct theorems of the calculus. Logical calculi are employed in e.g. tools for formal verification of computer programs. Two important properties of logical calculi are soundness and completeness, since they state, respectively, that all theorems of a given calculus are valid, and that all valid statements are theorems of the calculus. Validity is defined by a semantics, which gives meaning to formulas. This thesis describes formalizations in Isabelle of several logics as well as tools built upon these. Specifically this thesis explains and discusses the following contributions of my PhD project: A formalization of the resolution calculus for first-order logic, Herbrand’s theorem and the • soundness and completeness of the calculus. A formalization of the ordered resolution calculus for first-order logic, an abstract prover • based on it and the prover’s soundness and completeness. A verified automatic theorem prover for first-order logic. The prover is a refinement of the • above formalization of an abstract prover. This explicitly shows that the abstract notion of a prover can describe concrete computer programs. The Natural Deduction Assistant (NaDeA), which is a tool for teaching first-order logic • that allows users to build proofs in natural deduction. The tool is based on a formalization of natural deduction and its soundness and completeness. A verified proof assistant for first-order logic with equality. It is based on an axiomatic • system and constitutes a tool for teaching logic and proof assistants. A formalization of the propositional fragment of a paraconsistent infinite-valued higher- • order logic. Theorems about the necessity of having infinitely many truth values are proved and formalized. Proof assistants are built to reject proofs that contain gaps or mistakes. Therefore, the for- malized results are highly trustworthy. The tools based on formalized calculi consequently have an increased trustworthiness. The above formalizations revealed flaws and mistakes in the lit- erature. In addition to the formalizations and tools themselves, my PhD project contributes solutions that repair these flaws and mistakes. 2 Resumé Titel: Formalisering af logik i Isabelle-bevisassistenten Isabelle er en bevisassistent, dvs. et computerprogram, som kan hjælpe sin bruger med at definere koncepter fra matematik og computer science så vel som med at bevise deres egenskaber. Denne proces kaldes formalisering. Bevisassistenter hjælper deres brugere ved at sikre at beviser bliver konstrueret korrekt og ved at lave dele af beviserne automatisk. En logisk kalkule er en mængde regler og aksiomer, som kan anvendes til at konstruere kal- kulens sætninger. Logiske kalkuler bruges f.eks. i værktøjer til formel verifikation af computer- programmer. To af kalkulers vigtige egenskaber er korrekthed og fuldstændighed, da de formulerer henholdsvis, at alle sætninger i en given kalkule er gyldige, og at alle gyldige udsagn er sætninger i kalkulen. Gyldighed er defineret af en semantik, som tilskriver formler mening. Denne afhandling beskriver formaliseringer i Isabelle af adskillige logikker så vel som værktøjer der bygger på dem. Specifikt forklarer og diskuterer denne afhandling de følgende bidrag fra mit ph.d.-projekt: En formalisering af resolutionskalkulen for førsteordenslogik, Herbrands sætning og kalku- • lens korrekthed og fuldstændighed. En formalisering af den ordnede resolutionskalkule for førsteordenslogik, en abstrakt bevis- • fører baseret på den og bevisførerens korrekthed og fuldstændighed. En verificeret automatisk bevisfører for førsteordenslogik. Bevisføreren er en forfinelse af • den ovenstående formalisering af en abstrakt bevisfører. Dette viser eksplicit, at den ab- strakte forståelse af en bevisfører rigtignok kan beskrive et konkret computerprogram. Natural Deduction Assistant (NaDeA), som er et værktøj til at undervise i førsteordenslogik, • der gør det muligt for sine brugere at bygge beviser i naturlig deduktion. Værktøjet er baseret på en formalisering af naturlig deduktion og dens korrekthed og fuldstændighed. En verificeret bevisassistent for førsteordenslogik med lighed. Den er baseret på et aksioma- • tisk system og udgør et værktøj til at undervise i logik og bevisassistenter. En formalisering af det udsagnslogiske fragment af en parakonsistent højereordenslogik • med uendeligt mange sandhedsværdier. Sætninger om nødvendigheden af at have uendeligt mange sandhedsværdier bevises og formaliseres. Bevisassistenter bygges til at afvise beviser, som indeholder huller eller fejl. Derfor er de for- maliserede resultater meget pålidelige. Værktøjerne baseret på formaliserede kalkuler har derfor øget pålidelighed. De ovenstående formaliseringer viste mangler og fejl i litteraturen. Ud over for- maliseringerne og værktøjerne i sig selv bidrager mit ph.d.-projekt med løsninger, som reparerer disse mangler og fejl. 3 Preface The 3 years of PhD studies started 15.09.2015 and ended 14.09.2018. My PhD studies took place at the Department of Applied Mathematics and Computer Science (DTU Compute) of the Technical University of Denmark (DTU) under DTU Compute’s PhD school, and were funded by DTU Compute. My main supervisor was Jørgen Villadsen (DTU Compute), and my co- supervisors were Jasmin Christian Blanchette (VU Amsterdam) and Thomas Bolander (DTU Compute). Acknowledgements First of all, I would like to thank my three supervisors Jørgen Villadsen, Jasmin Christian Blanchette and Thomas Bolander. Thank you for all the collaboration, help and inspiration, and for teaching me how to be a researcher. I could not have wished for better supervisors. I would also like to thank Christoph Weidenbach for generously hosting me at the Max Planck Institute for Informatics in Saarbrücken. The four months I spent in his group were a fun experience and I thank all the friends I made at the Max Planck Institute and the rest of the Saarland University Campus Saarbrücken. I would like to thank Christian Sternagel for inviting me to Innsbruck University and hosting me there. Working with you and René (Thiemann) on the interfaces between our projects IsaFoL and IsaFoR was a lot of fun. I was very honored to receive the Springer Travel Award at the International Conference on Interactive Theorem Proving (ITP 2016) and the Woody Bledsoe Student Travel Award at the International Joint Conference on Automated Reasoning (IJCAR 2018). I would like to thank Otto Mønsteds Fond for supporting my participation in the Federated Logic Conference (FLoC 2018). I would like to thank my co- authors Jasmin Christian Blanchette, Kasper Fabæch Brandt, Andreas Halkjær From, Alexander Birch Jensen, John Bruntse Larsen, Dmitriy Traytel, Jørgen Villadsen and Uwe Waldman for all our respective collaborations. I would like to thank all my colleagues at the Section for Algorithms, Logic and Graphs as well as my colleagues at the rest of DTU Compute. I would like to thank my friends and family of course! 4 Contents Introduction 6 1 Formalization of the Resolution Calculus for First-Order Logic 16 2 Formalizing Bachmair and Ganzinger’s Ordered Resolution Prover 48 3 A Verified Automatic Prover Based on Ordered Resolution 73 4 NaDeA: A Natural Deduction Assistant with a Formalization in Isabelle 103 5 Programming and Verifying a Declarative First-Order Prover in Isabelle/HOL 124 6 Formalized Meta-Theory of a Paraconsistent Logic 153 Thesis Appendix: Changes to Published Papers 167 5 Introduction This introduction first motivates formalizing logic in the Isabelle proof assistant. It then gives a quick summary of the following chapters and their relations. Thereafter follow more thorough accounts of the chapters. Hereafter is an account of some new developments that build on the chapters, but which are not included in this thesis. Lastly the introduction gives discussions and perspectives on the results of the thesis. Preliminaries and Motivation Computer programs are central to many of the technological advances of modern day society. However, enormous amounts of resources are spent fighting problems caused by defects and bugs in computer programs. A way to solve this problem is to apply tools that prove correctness of software and thus avoid defects and bugs in the first place. Such tools can be built on a base of logic. In order to ensure that this base is solid, it should be studied thoroughly. Logic is the study of reasoning. Of particular interest is the reasoning performed every day by mathematicians and computer scientists. Mathematicians prove properties about mathematical objects such as numbers, vectors, permutations and groups. Computer scientists prove properties about objects such as programs, algorithms, protocols and compilers. To prove something means to argue rigorously that it is true. A proved property is called a theorem. Examples of famous theorems are the Pythagorean theorem and the correctness of the quicksort sorting algorithm. The reasoning of mathematicians and computer scientists can be captured
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages168 Page
-
File Size-