Automated Theorem Proving Resolution Vs
Total Page:16
File Type:pdf, Size:1020Kb
Master Thesis Software Engineering Thesis no: MSE-2002:4 March 2002 Automated Theorem Proving Resolution vs. Tableaux Andreas L. E. Folkler (ℵ) Department of Software Engineering and Computer Science Blekinge Institute of Technology Box 520 SE-372 25 Ronneby This page is intentionally left blank. ii Automated Theorem Proving: Resolution vs. Tableaux This thesis is submitted to the Department of Software Engineering and Computer Science at Blekinge Institute of Technology in partial fulfillment of the requirements for the degree of Master of Science in Software Engineering. The thesis is equivalent to ten weeks of full time studies. Contact Information: Author: Andreas Folkler Address: Myntgatan 13A SE-417 02 Göteborg E-mail: [email protected] University advisor: Dr. Bertil Ekdahl Department of Software Engineering and Computer Science Department of Internet : www.bth.se/ipd Software Engineering and Computer Science Phone : +46 457 38 50 00 Blekinge Institute of Technology Fax : +46 457 271 25 Box 520 SE-372 25 Ronneby Automated Theorem Proving: Resolution vs. Tableaux iii This page is intentionally left blank. iv Automated Theorem Proving: Resolution vs. Tableaux Abstract The purpose of this master thesis was to investigate which of the two methods, resolution and tableaux, that is the most appropriate for automated theorem proving. This was done by implementing an automated theorem prover, comparing and documenting implementation problems, and measuring proving efficiency. In this thesis, I conclude that the resolution method might be more suitable for an automated theorem prover than tableaux, in the aspect of ease of implementation. Regarding the efficiency, the test results indicate that resolution is the better choice. Keywords: First-order logic, tableaux, resolution, efficiency, ease of implementation Automated Theorem Proving: Resolution vs. Tableaux v This page is intentionally left blank. vi Automated Theorem Proving: Resolution vs. Tableaux Contents 1 INTRODUCTION ........................................................................................................................................1 1.1 THE METHOD...........................................................................................................................................1 1.2 READING INSTRUCTIONS ..........................................................................................................................1 2 FIRST-ORDER LOGIC................................................................................................................................2 2.1 WHAT IS LOGIC?.......................................................................................................................................2 2.2 SYNTAX ....................................................................................................................................................2 2.3 PROOF SYSTEMS ........................................................................................................................................3 2.4 INFERENCE ...............................................................................................................................................6 2.5 SEMANTICS...............................................................................................................................................6 2.6 REFUTATION ............................................................................................................................................8 3 FURTHER FIRST-ORDER FEATURES....................................................................................................9 3.1 UNIFICATION ...........................................................................................................................................9 3.2 PRENEX FORM ........................................................................................................................................11 3.3 SKOLEMIZATION ....................................................................................................................................12 3.4 CLAUSES.................................................................................................................................................13 4 FIRST-ORDER PROOF PROCEDURES ................................................................................................14 4.1 RESOLUTION ..........................................................................................................................................14 4.2 TABLEAUX ..............................................................................................................................................15 4.3 DIFFERENCES AND SIMILARITIES ............................................................................................................17 4.4 MORE EFFICIENT VERSIONS ....................................................................................................................18 4.5 SOUNDNESS AND COMPLETENESS..........................................................................................................19 4.6 THE HISTORY OF PROLOG ......................................................................................................................19 5 EVALUATION ............................................................................................................................................20 5.1 EFFICIENCY ............................................................................................................................................20 5.2 EASE OF IMPLEMENTATION....................................................................................................................21 5.3 IMPLEMENTATION – SIZE AND EFFORT ..................................................................................................23 6 CONCLUSION............................................................................................................................................24 7 FUTURE WORK..........................................................................................................................................24 APPENDIX A. GLOSSARY AND DEFINITIONS ................................................................................25 APPENDIX B. TESTED THEOREMS......................................................................................................27 APPENDIX C. ALGORITHMS.................................................................................................................28 APPENDIX D. DESIGN .............................................................................................................................31 REFERENCES.......................................................................................................................................................32 Automated Theorem Proving: Resolution vs. Tableaux vii This page is intentionally left blank. viii Automated Theorem Proving: Resolution vs. Tableaux 1 Introduction Resolution and tableaux are two proof procedures of first order logic. Both methods are complete, which means that they can prove every valid argument. In automatic theorem proving, resolution is the predominant method. For example, resolution is the deductive method used in the programming language Prolog. However, the tableaux method has recently received more attention. The aim of this master’s thesis was to investigate, if possible, which of the two methods is the most efficient and viable for implementing an automated theorem prover (ATP hereafter) for First Order Logic (FOL). The two methods are quite similar in that they have many inference rules in common, and what I would like to know, is why one of them (the resolution method) is predominant in automated theorem proving. Is resolution more efficient and easy to use in an ATP? To achieve this, a program for proving theorems was to be implemented, with the ability to change method easily. During the development process, thorough notes were taken about the problems and pitfalls encountered for each proving method. The methods were then measured in aspects of performance. 1.1 The Method Most of the literature used in this master thesis was provided by my supervisor, Dr. Bertil Ekdahl. Some of the books were found at the library or borrowed from other teachers at Blekinge Tekniska Högskola. A small part of the literature has been found on the World Wide Web. Because of this, not much of the work has been spent searching for information. The work was to be carried out in a way similar to the iterative system development process since an application also had to be implemented. The first things to do were pre- study of the domain and the problems, and a project plan with estimated time for each activity in the work breakdown structure. The reason to implement a full application and not just write down the algorithms and calculate the performance was that many problems arise during analysis, design, and implementation. Besides that, I wanted to measure the efficiency based on real examples run through a real application. 1.2 Reading instructions Since the literature on formal logic often uses somewhat different notation, it is recommend reading Appendix A, Glossary and Definitions, before anything else. Automated Theorem Proving: Resolution vs. Tableaux 1 2 First-Order Logic 2.1 What is logic? “Formal logic is the science of deduction. It aims to provide systematic means for telling whether or not given conclusions