Designing a Theorem Prover

Total Page:16

File Type:pdf, Size:1020Kb

Designing a Theorem Prover Designing a Theorem Prover Lawrence C Paulson Computer Laboratory University of Cambridge May 1990 CONTENTS 2 Contents 1 Folderol: a simple theorem prover 3 1.1 Representation of rules :::::::::::::::::::::::::: 4 1.2 Propositional logic :::::::::::::::::::::::::::: 5 1.3 Quanti¯ers and uni¯cation :::::::::::::::::::::::: 7 1.4 Parameters in quanti¯er rules :::::::::::::::::::::: 7 2 Basic data structures and operations 10 2.1 Terms ::::::::::::::::::::::::::::::::::: 10 2.2 Formulae :::::::::::::::::::::::::::::::::: 11 2.3 Abstraction and substitution ::::::::::::::::::::::: 11 2.4 Parsing and printing ::::::::::::::::::::::::::: 13 3 Uni¯cation 14 3.1 Examples ::::::::::::::::::::::::::::::::: 15 3.2 Parameter dependencies in uni¯cation :::::::::::::::::: 16 3.3 The environment ::::::::::::::::::::::::::::: 17 3.4 The ML code for uni¯cation ::::::::::::::::::::::: 17 3.5 Extensions and omissions ::::::::::::::::::::::::: 18 3.6 Instantiation by the environment :::::::::::::::::::: 19 4 Inference in Folderol 20 4.1 Solving a goal ::::::::::::::::::::::::::::::: 21 4.2 Selecting a rule :::::::::::::::::::::::::::::: 22 4.3 Constructing the subgoals :::::::::::::::::::::::: 23 4.4 Goal selection ::::::::::::::::::::::::::::::: 25 5 Folderol in action 27 5.1 Propositional examples :::::::::::::::::::::::::: 27 5.2 Quanti¯er examples :::::::::::::::::::::::::::: 30 5.3 Beyond Folderol: advanced automatic methods ::::::::::::: 37 6 Interactive theorem proving 39 6.1 The Boyer/Moore theorem prover :::::::::::::::::::: 40 6.2 The Automath languages ::::::::::::::::::::::::: 41 6.3 LCF, a programmable theorem prover :::::::::::::::::: 42 6.4 Validation-based tactics ::::::::::::::::::::::::: 43 6.5 State-based tactics :::::::::::::::::::::::::::: 45 6.6 Technical aspects of Isabelle ::::::::::::::::::::::: 46 7 Conclusion 47 8 Program listing 48 1 FOLDEROL: A SIMPLE THEOREM PROVER 3 1 Folderol: a simple theorem prover Because many di®erent forms of logic are applicable to Computer Science, a common question is | How do I write a theorem prover? This question can be answered with general advice. For instance, ¯rst do enough paper proofs to show that automation of your logic is both necessary and feasible. The question can also be answered with a survey of existing provers, as will be done in this chapter. But automatic theorem-proving involves a combination of theoretical and coding skills that is best illustrated by a case study. So this chapter presents a toy theorem prover, called Folderol, highlighting the key design issues. Code fragments are discussed in the text; a full program listing appears at the end of the chapter. Folderol works in classical ¯rst-order logic. It follows an automatic strategy but is interactive. You can enter a conjecture, let Folderol work with it for a while, and ¯nally modify or abandon the conjecture if it cannot be proved. There is no practical automatic proof procedure, even for most complete theories. Even if there were, interaction with the machine would still be necessary for exploring mathematics. A theorem prover should o®er some evidence that its proofs are valid. The Boyer and Moore [1979] theorem-prover prints an English summary of its reasoning, while Folderol prints a trace of the rules. Most LCF-style systems o®er no evidence of correctness other than an obstinate insistence on playing by the rules [Paulson 1987]. If correctness is a matter of life and death, then a prover can be designed to output its proof for checking by a separate program. Absolute correctness can never be obtained, even with a computer-checked proof. There are fundamental reasons for this. Any program may contain errors, including the one that checks the proofs; we have no absolutely reliable means by which to verify the veri¯er. In addition, a proof of correctness of a program relies on assumptions about the real world; it assumes that the computer works correctly, and usually assumes that the program is used properly. Hardware correctness proofs depend upon similar assumptions [Cohn 1989b]. Even in pure mathematics, the premises of a theorem are subject to revision [Lakatos 1976]. Although Folderol performs well on certain examples, its proof strategy su®ers inherent limitations. The strategy would be even worse if we adopted modal or intuitionistic logic, and cannot easily be remedied. My hope is that, once you have studied this chapter, you will gain the con¯dence to implement more sophisticated strategies. Folderol exploits many of the concepts of functional programming, although it is not pure. It is written in Standard ML, which is increasingly popular for theorem proving. Several recent books teach this language. Remark on quanti¯ers. The usual notation for quanti¯ers, seen elsewhere in this volume, gives the quanti¯ed variable the smallest possible scope. To save on parentheses, quanti¯ers in this chapter employ a dot convention, extending the scope of quanti¯cation as far as possible. So 8x:P ! Q abbreviates 8x:(P ! Q), and 9y:P ^9z:Q _ R abbreviates 9y:(P ^ (9z:(Q _ R))) 1 FOLDEROL: A SIMPLE THEOREM PROVER 4 1.1 Representation of rules Given that Folderol will handle classical ¯rst-order logic, what formal system is best suited for automation? Gentzen's sequent calculus LK [Takeuti 1987] supports backwards proof in a natural way. A naijve process of working upwards from the desired conclusion yields many proofs. Most rules act on one formula, and they come in pairs: one operating on the left and one on the right. We must inspect the rules carefully before choosing data structures. The quanti¯er rules, especially, constrain the representation of terms. The classical sequent calculus deals with sequents of the form ¡ j¡ ¢. Here ¡ is the left part and ¢ is the right part, and ¡ j¡ ¢ means `if every formula in ¡ is true then some formula in ¢ is true.' The sequent A j¡ A (called a basic sequent) is trivially true. You may prefer to think in terms of refutation. Then ¡ j¡ ¢ is false if every formula in ¡ is true and every formula in ¢ is false. If these conditions are contradictory then the sequent is true. Structural rules, namely exchange, thinning, and contraction, make sequents behave like a consequence relation. The thinning rules, in backwards proof, delete a formula from the goal. Since a formula should not be deleted unless it is known to be redundant, let us postpone all deletions. A goal is trivially true if it has the form ¡ j¡ ¢ where there exists a common formula A 2 ¡ \ ¢. Accepting these as basic sequents makes thinning rules unnecessary; the other formulae are simply thrown away. The exchange rules swap two adjacent formulae, for traditionally ¡ and ¢ are lists, not sets. Lists are also convenient in programming. We can do without ex- change rules by ignoring the order of formulae in a sequent. In the rule ¡ j¡ ¢;A ¡ j¡ ¢;B ^:right ¡ j¡ ¢;A^ B there is no reason why A ^ B needs to be last. It can appear anywhere in the right part of the conclusion. For backwards proof: if the goal contains A ^ B anywhere in the right part then we can produce two subgoals, replacing A ^ B by A and B respectively. We can write the rule more concisely and clearly as follows, showing only formulae that change: j¡ A j¡ B ^:right j¡ A ^ B The contraction rules, in backwards proof, duplicate a formula. Duplicating the A ^ B, then applying the conjunction rule above, makes subgoals j¡ A; A ^ B and j¡ B;A ^ B. These are equivalent to j¡ A and j¡ B, so the A ^ B is redundant. A case-by-case inspection of the rules reveals that the only formulae worth du- plicating are 8x:A on the left and 9x:A on the right. Let us add contraction to the rules 8:left and 9:right. The rule 8:left takes a goal containing 8x:A on the left and makes one subgoal by adding the formula A[t=x] for some term t. The subgoal retains a copy of 8x:A so that the rule can be applied again for some other term. This example requires n repeated uses of the quanti¯ed formula on terms a, f(a), 1 FOLDEROL: A SIMPLE THEOREM PROVER 5 :::: 8 ! j¡ ! ¢¢¢ ¢¢¢ x:P(x) P (f(x)) P (a) P (|f(f{z( f}(a) ))) n times The rule 9:right similarly retains the quanti¯ed formula in its subgoal. Folderol uses these quanti¯ed formulae in rotation. It never throws them away. Thus even 8x:P (x) j¡ Q makes Folderol run forever. If not for the re-use of quanti¯ed formulae, the search space would be ¯nite. A theorem prover should only instantiate a quanti¯er when strictly necessary | but there is no e®ective test. First-order logic is undecidable. 1.2 Propositional logic Propositional logic concerns the connectives ^, _, !, $, and :. We take negation as primitive rather than de¯ning :A as A !?. Although A $ B means (A ! B) ^ (B ! A), performing this expansion could cause exponential blowup! The rules for $ permit natural reasoning. Figure 1 shows the rules for each connective. In backwards proof each rule breaks down a non-atomic formula in the conclusion. If more than one rule is applicable, as in A ^ B j¡ B ^ A, which should be chosen? Some choices give shorter proofs than others. This proof of A ^ B j¡ B ^ A uses ^:left before ^:right (working upwards): A; B j¡ BA;Bj¡ A ^:right A; B j¡ B ^ A ^:left A ^ B j¡ B ^ A If ^:right is used ¯rst then ^:left must be used twice. In larger examples the di®erence can be exponential. A; B j¡ B A; B j¡ A ^:left ^:left A ^ B j¡ B A ^ B j¡ A ^:right A ^ B j¡ B ^ A Rules can be chosen to minimize the proliferation of subgoals. If a goal is a basic sequent then trying other rules seems pointless.1 Let us say that the cost of a rule is the number of premises it has.
Recommended publications
  • Logic and Proof Computer Science Tripos Part IB
    Logic and Proof Computer Science Tripos Part IB Lawrence C Paulson Computer Laboratory University of Cambridge [email protected] Copyright c 2015 by Lawrence C. Paulson Contents 1 Introduction and Learning Guide 1 2 Propositional Logic 2 3 Proof Systems for Propositional Logic 5 4 First-order Logic 8 5 Formal Reasoning in First-Order Logic 11 6 Clause Methods for Propositional Logic 13 7 Skolem Functions, Herbrand’s Theorem and Unification 17 8 First-Order Resolution and Prolog 21 9 Decision Procedures and SMT Solvers 24 10 Binary Decision Diagrams 27 11 Modal Logics 28 12 Tableaux-Based Methods 30 i 1 INTRODUCTION AND LEARNING GUIDE 1 1 Introduction and Learning Guide 2008 Paper 3 Q6: BDDs, DPLL, sequent calculus • 2008 Paper 4 Q5: proving or disproving first-order formulas, This course gives a brief introduction to logic, including • resolution the resolution method of theorem-proving and its relation 2009 Paper 6 Q7: modal logic (Lect. 11) to the programming language Prolog. Formal logic is used • for specifying and verifying computer systems and (some- 2009 Paper 6 Q8: resolution, tableau calculi • times) for representing knowledge in Artificial Intelligence 2007 Paper 5 Q9: propositional methods, resolution, modal programs. • logic The course should help you to understand the Prolog 2007 Paper 6 Q9: proving or disproving first-order formulas language, and its treatment of logic should be helpful for • 2006 Paper 5 Q9: proof and disproof in FOL and modal logic understanding other theoretical courses. It also describes • 2006 Paper 6 Q9: BDDs, Herbrand models, resolution a variety of techniques and data structures used in auto- • mated theorem provers.
    [Show full text]
  • A Prolog Technology Theorem Prover: a New Exposition and Implementation in Prolog*
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Theoretical Computer Science 104 (1992) 109-128 109 Elsevier A Prolog technology theorem prover: a new exposition and implementation in Prolog* Mark E. Stickel Artificial Intelligence Center, SRI International, Menlo Park, CA 94025, USA Abstract Stickel, M.E., A Prolog technology theorem prover: a new exposition and implementation in Prolog, Theoretical Computer Science 104 (1992) 109-128. A Prolog technology theorem prover (P’ITP) is an extension of Prolog that is complete for the full first-order predicate calculus. It differs from Prolog in its use of unification with the occurs check for soundness, depth-first iterative-deepening search instead of unbounded depth-first search to make the search strategy complete, and the model elimination reduction rule that is added to Prolog inferences to make the inference system complete. This paper describes a new Prolog-based implementation of PTTP. It uses three compile-time transformations to translate formulas into Prolog clauses that directly execute, with the support of a few run-time predicates, the model elimination procedure with depth-first iterative-deepening search and unification with the occurs check. Its high performance exceeds that of Prolog-based PTTP interpreters, and it is more concise and readable than the earlier Lisp-based compiler, which makes it superior for expository purposes. Examples of inputs and outputs of the compile-time transformations provide an easy and precise way to explain how PTTP works. This Prolog-based version makes it easier to incorporate PTTP theorem-proving ideas into Prolog programs.
    [Show full text]
  • The Method of Proof Analysis: Background, Developments, New Directions
    The Method of Proof Analysis: Background, Developments, New Directions Sara Negri University of Helsinki JAIST Spring School 2012 Kanazawa, March 5–9, 2012 Motivations and background Overview Hilbert-style systems Gentzen systems Axioms-as-rules Developments Proof-theoretic semantics for non-classical logics Basic modal logic Intuitionistic and intermediate logics Intermediate logics and modal embeddings Gödel-Löb provability logic Displayable logics First-order modal logic Transitive closure Completeness, correspondence, decidability New directions Social and epistemic logics Knowability logic References What is proof theory? “The main concern of proof theory is to study and analyze structures of proofs. A typical question in it is ‘what kind of proofs will a given formula A have, if it is provable?’, or ‘is there any standard proof of A?’. In proof theory, we want to derive some logical properties from the analysis of structures of proofs, by anticipating that these properties must be reflected in the structures of proofs. In most cases, the analysis will be based on combinatorial and constructive arguments. In this way, we can get sometimes much more information on the logical properties than with semantical methods, which will use set-theoretic notions like models,interpretations and validity.” (H. Ono, Proof-theoretic methods in nonclassical logic–an introduction, 1998) Challenges in modal and non-classical logics Difficulties in establishing analyticity and normalization/cut-elimination even for basic modal systems. Extension of proof-theoretic semantics to non-classical logic. Generality of model theory vs. goal directed developments in proof theory for non-classical logics. Proliferation of calculi “beyond Gentzen systems”. Defeatist attitudes: “No proof procedure suffices for every normal modal logic determined by a class of frames.” (M.
    [Show full text]
  • Logic and Proof
    Logic and Proof Computer Science Tripos Part IB Michaelmas Term Lawrence C Paulson Computer Laboratory University of Cambridge [email protected] Copyright c 2007 by Lawrence C. Paulson Contents 1 Introduction and Learning Guide 1 2 Propositional Logic 3 3 Proof Systems for Propositional Logic 13 4 First-order Logic 20 5 Formal Reasoning in First-Order Logic 27 6 Clause Methods for Propositional Logic 33 7 Skolem Functions and Herbrand’s Theorem 41 8 Unification 50 9 Applications of Unification 58 10 BDDs, or Binary Decision Diagrams 65 11 Modal Logics 68 12 Tableaux-Based Methods 74 i ii 1 1 Introduction and Learning Guide This course gives a brief introduction to logic, with including the resolution method of theorem-proving and its relation to the programming language Prolog. Formal logic is used for specifying and verifying computer systems and (some- times) for representing knowledge in Artificial Intelligence programs. The course should help you with Prolog for AI and its treatment of logic should be helpful for understanding other theoretical courses. Try to avoid getting bogged down in the details of how the various proof methods work, since you must also acquire an intuitive feel for logical reasoning. The most suitable course text is this book: Michael Huth and Mark Ryan, Logic in Computer Science: Modelling and Reasoning about Systems, 2nd edition (CUP, 2004) It costs £35. It covers most aspects of this course with the exception of resolution theorem proving. It includes material (symbolic model checking) that should be useful for Specification and Verification II next year.
    [Show full text]
  • Logical Inference 3 Resolution
    Resolution Logical • Resolution is a sound and complete inference procedure for unrestricted FOL • Reminder: Resolution rule for propositional Inference 3 logic: – P1 ∨ P2 ∨ ... ∨ Pn – P Q ... Q resolution ¬ 1 ∨ 2 ∨ ∨ m – Resolvent: P2 ∨ ... ∨ Pn ∨ Q2 ∨ ... ∨ Qm • We’ll need to extend this to handle Chapter 9 quantifiers and variables Some material adopted from notes by Andreas Geyer-Schulz,, Chuck Dyer, and Mary Getoor Two Common Normal Forms for a KB Resolution covers many cases Implicative normal form Conjunctive normal form • Modes Ponens • Set of sentences where • Set of sentences where – from P and P Q derive Q each is expressed as an each is a disjunction of → implication atomic literals – from P and ¬ P ∨ Q derive Q • Chaining • Left hand side of • P, Q, ~P ∨ ~Q ∨ R implication is a – from P → Q and Q → R derive P → R conjunction of 0 or more – from (¬ P ∨ Q) and (¬ Q ∨ R) derive ¬ P ∨ R literals • Contradiction detection • P , Q, P ∧ Q => R – from P and ¬ P derive false – from P and ¬ P derive the empty clause (=false) 1 Resolution in first-order logic A resolution proof tree • Given sentences in conjunctive normal form: – P1 ∨ ... ∨ Pn and Q1 ∨ ... ∨ Qm – Pi and Qi are literals, i.e., positive or negated predicate symbol with its terms • if Pj and ¬Qk unify with substitution list θ, then derive the resolvent sentence: subst(θ, P1∨…∨Pj-1∨Pj+1…Pn∨ Q1∨…Qk-1∨Qk+1∨…∨Qm) • Example – from clause P(x, f(a)) ∨ P(x, f(y)) ∨ Q(y) – and clause ¬P(z, f(a)) ∨ ¬Q(z) – derive resolvent P(z, f(y)) ∨ Q(y) ∨ ¬Q(z) – Using θ = {x/z} A resolution
    [Show full text]
  • SATCHMO: a Theorem Prover Implemented in Prolog
    Lecture Notes in Computer Science Edited by G. Goos and J. Hartmanis 310 E. Lusk R. Overbeek (Eds.) 9th International Conference on Automated Deduction Argonne, Illinois, USA, May 23-26, 1988 Proceedings Springer-Verlag Berlin Heidelberg New York London Paris Tokyo I 9^. Ρ?6 3<7ö Editorial Board ( D. Barstow W. Brauer R Brinch Hansen D. Gries D. Luckham C. Moler A. Pnueli G. Seegmüller J. Stoer N. Wirth Editors Ewing Lusk Ross Overbeek Mathematics and Computer Science Division Argonne National Laboratory 9700 South Cass Avenue, Argonne, IL 60439, USA 8ayeridch£ I siaatsbtbllotti--^ CR Subject Classification (1987): 1.2.3 ISBN 3-540-19343-X Springer-Verlag Berlin Heidelberg New York ISBN 0-387-19343-X Springer-Verlag New York Berlin Heidelberg This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in other ways, and storage in data banks. Duplication of this publication or parts thereof is only permitted under the provisions of the German Copyright Law of September 9, 1965, in its version of June 24, 1985, and a copyright fee must always be paid. Violations fall under the prosecution act of the German Copyright Law. © Springer-Verlag Berlin Heidelberg 1988 Printed in Germany Printing and binding: Druckhaus Beltz, Hemsbach/Bergstr. 2145/3140-543210 Program Committee: • Peter Andrews, Carnegie Mellon University • W. W. Bledsoe, University of Texas • Alan Bundy, University of Edinburgh • Robert Constable, Cornell University • Seif Haridi, Swedish Institute of Computer Science • Lawrence Henschen, Northwestern University • Deepak Kapur, State University of New York at Albany • Dallas Lankford, Louisiana Technological University • Jean-Louis Lassez, T.
    [Show full text]
  • Automated Theorem Proving Resolution Vs
    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.
    [Show full text]
  • Propositional Logic
    Chapter 3 Propositional Logic 3.1 Introduction Every logic comprises a (formal) language for making statements about ob- jects and reasoning about properties of these objects. This view of logic is very general and actually we will restrict our attention to mathematical objects, programs, and data structures in particular. Statements in a logical language are constructed according to a prede¯ned set of formation rules (depending on the language) called syntax rules. One might ask why a special language is needed at all, and why English (or any other natural language) is not adequate for carrying out logical reason- ing. The ¯rst reason is that English (and any natural language in general) is such a rich language that it cannot be formally described. The second reason, which is even more serious, is that the meaning of an English sentence can be ambiguous, subject to di®erent interpretations depending on the context and implicit assumptions. If the object of our study is to carry out precise rigor- ous arguments about assertions and proofs, a precise language whose syntax can be completely described in a few simple rules and whose semantics can be de¯ned unambiguously is required. Another important factor is conciseness. Natural languages tend to be verbose, and even fairly simple mathematical statements become exceedingly long (and unclear) when expressed in them. The logical languages that we shall de¯ne contain special symbols used for abbreviating syntactical con- 28 3.1 Introduction 29 structs. A logical language can be used in di®erent ways. For instance, a language can be used as a deduction system (or proof system); that is, to construct proofs or refutations.
    [Show full text]
  • Proof Editor for Natural Deduction in First-Order Logic the Evaluation of an Educational Aiding Tool for Students Learning Logic
    Proof Editor for Natural Deduction in First-order Logic The Evaluation of an Educational Aiding Tool for Students Learning Logic Bachelor’s thesis in Computer Science ELIN BJÖRNSSON, FREDRIK JOHANSSON, JAN LIU, HENRY LY, JESPER OLSSON, ANDREAS WIDBOM Department of Computer Science and Engineering CHALMERS UNIVERSITY OF TECHNOLOGY UNIVERSITY OF GOTHENBURG Gothenburg, Sweden 2017 Proof Editor for Natural Deduction in First-order Logic The Evaluation of an Educational Aiding Tool for Students Learning Logic ELIN BJÖRNSSON, FREDRIK JOHANSSON, JAN LIU, HENRY LY, JESPER OLSSON, ANDREAS WIDBOM Department of Computer Science and Engineering Computer Science Chalmers University of Technology Göteborg, Sweden 2017 Proof Editor for Natural Deduction in First-order Logic The Evaluation of an Educational Aiding Tool for Students Learning Logic ELIN BJÖRNSSON, FREDRIK JOHANSSON, JAN LIU, HENRY LY, JESPER OLSSON, ANDREAS WIDBOM © ELIN BJÖRNSSON, FREDRIK JOHANSSON, JAN LIU, HENRY LY, JESPER OLSSON, ANDREAS WIDBOM, 2017. Supervisor: Fredrik Lindblad, Department of Computer Science and Engineering Examiner: Niklas Broberg, Department of Computer Science and Engineering Bachelor’s Thesis 2017 Department of Computer Science and Engineering Computer Science Chalmers University of Technology SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: Visualisation of the correct natural deduction steps for the first-order logic proof ∃xP (x), ∀x∀yP (x) → Q(y) ` ∀yQ(y), constructed in the developed proof editor. Typeset in LATEX Printed by [Name of printing company] Gothenburg, Sweden 2017 iv Proof Editor for Natural Deduction in First-order Logic The Evaluation of an Educational Aiding Tool for Students Learning Logic ELIN BJÖRNSSON, FREDRIK JOHANSSON, JAN LIU, HENRY LY, JESPER OLSSON, ANDREAS WIDBOM Department of Computer Science and Engineering Chalmers University of Technology Abstract The subject of this thesis is the presentation and evaluation of Conan, an editor for writing natural deduction proofs in first-order logic.
    [Show full text]
  • Logic in Computer Science
    LOGIC IN COMPUTER SCIENCE by Benji MO Some people are always critical of vague statements. I tend rather to be critical of precise statements. They are the only ones which can correctly be labeled wrong. { Raymond Smullyan August 2020 Supervisor: Professor Hantao Zhang TABLE OF CONTENTS Page LIST OF FIGURES . viii CHAPTER 1 Introduction to Logic . 1 1.1 Logic is Everywhere . 2 1.1.1 Statement or Proposition . 2 1.1.2 A Brief History of Logic . 4 1.2 Logical Fallacies in Arguments . 5 1.2.1 Formal Fallacies . 5 1.2.2 Informal Fallacies . 7 1.3 A Brief Review of Mathematical Logic . 13 1.3.1 Set Theory . 13 1.3.2 Model Theory . 21 1.3.3 Proof Theory . 22 1.3.4 Computability Theory . 25 1.4 Exercise Problems . 29 2 Propositional Logic . 32 2.1 Syntax . 32 2.1.1 Logical Operators . 32 2.1.2 Formulas . 34 2.2 Semantics . 36 2.2.1 Interpretations . 36 2.2.2 Models, Satisfiability, and Validity . 38 2.2.3 Equivalence . 40 2.2.4 Entailment . 43 2.2.5 Theorem Proving and the SAT Problem . 45 2.3 Normal Forms . 46 2.3.1 Negation Normal Form (NNF) . 48 2.3.2 Conjunctive Normal Form (CNF) . 49 2.3.3 Disjunctive Normal Form (DNF) . 51 2.3.4 Full DNF and Full CNF from Truth Table . 53 2.3.5 Binary Decision Diagram (BDD) . 54 2.4 Optimization Problems . 59 2.4.1 Minimum Set of Operators . 59 iii 2.4.2 Logic Minimization .
    [Show full text]
  • Handbook of Tableau Methods Introduction Melvin Fitting Mlfl[email protected] Contents 1 General Introduction
    1 Handbook of Tableau Methods Introduction Melvin Fitting mlfl[email protected] Contents 1 General Introduction . 1 1.1 What Is A Tableau? . 1 1.2 Classical Propositional Tableaus as an Example . 2 1.3 Abstract Data Types vs Implementations . 6 1.4 What Good Is a Tableau System? . 7 2 Classical History . 8 2.1 Gentzen . 9 2.2 Beth . 15 2.3 Hintikka . 18 2.4 Lis . 20 2.5 Smullyan . 21 2.6 The Complications Quantifiers Add . 24 3 Modern History . 26 3.1 Intuitionistic Logic . 26 3.2 Many-Valued Logic . 29 3.3 Modal Logic . 30 3.4 Relevance Logic . 34 4 Post-Modern History . 36 4.1 The Beginnings . 36 4.2 Dummy Variables and Unification . 38 4.3 Run-Time Skolemization . 39 4.4 Where Now . 40 5 Conclusions . 41 1 General Introduction 1.1 What Is A Tableau? This chapter is intended to be a prolog setting the stage for the acts that follow—a bit of background, a bit of history, a bit of general commentary. And the thing to begin with is the introduction of the main character. What is a tableau? It will make the introductions easier if we first deal with a minor nui- sance. Suppose we know what a tableau is—what do we call several of 2 them: “tableaus” or “tableaux?” History and the dictionary are on the side of “tableaux.” On the other hand, language evolves and tends to sim- plify; there is a clear drift toward “tableaus.” In this chapter we will use “tableaus,” with the non-judgemental understanding that either is accept- able.
    [Show full text]
  • Logic and Proof Computer Science Tripos Part IB
    Logic and Proof Computer Science Tripos Part IB Lawrence C Paulson Computer Laboratory University of Cambridge [email protected] Copyright c 2014 by Lawrence C. Paulson Contents 1 Introduction and Learning Guide 1 2 Propositional Logic 2 3 Proof Systems for Propositional Logic 5 4 First-order Logic 8 5 Formal Reasoning in First-Order Logic 11 6 Clause Methods for Propositional Logic 13 7 Skolem Functions, Herbrand’s Theorem and Unification 17 8 First-Order Resolution and Prolog 21 9 Decision Procedures and SMT Solvers 24 10 Binary Decision Diagrams 27 11 Modal Logics 28 12 Tableaux-Based Methods 30 i 1 INTRODUCTION AND LEARNING GUIDE 1 1 Introduction and Learning Guide 2008 Paper 3 Q6: BDDs, DPLL, sequent calculus • 2008 Paper 4 Q5: proving or disproving first-order formulas, This course gives a brief introduction to logic, including • resolution the resolution method of theorem-proving and its relation 2009 Paper 6 Q7: modal logic (Lect. 11) to the programming language Prolog. Formal logic is used • for specifying and verifying computer systems and (some- 2009 Paper 6 Q8: resolution, tableau calculi • times) for representing knowledge in Artificial Intelligence 2007 Paper 5 Q9: propositional methods, resolution, modal programs. • logic The course should help you to understand the Prolog 2007 Paper 6 Q9: proving or disproving first-order formulas language, and its treatment of logic should be helpful for • 2006 Paper 5 Q9: proof and disproof in FOL and modal logic understanding other theoretical courses. It also describes • 2006 Paper 6 Q9: BDDs, Herbrand models, resolution a variety of techniques and data structures used in auto- • mated theorem provers.
    [Show full text]