Logic and Proof

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 2013 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 26 11 Modal Logics 27 12 Tableaux-Based Methods 30 i 1 INTRODUCTION AND LEARNING GUIDE 1 1 Introduction and Learning Guide 2009 Paper 6 Q8: resolution, tableau calculi • This course gives a brief introduction to logic, including 2007 Paper 5 Q9: propositional methods, resolution, modal • logic the resolution method of theorem-proving and its relation to the programming language Prolog. Formal logic is used 2007 Paper 6 Q9: proving or disproving first-order formulas • for specifying and verifying computer systems and (some- 2006 Paper 5 Q9: proof and disproof in FOL and modal logic times) for representing knowledge in Artificial Intelligence • 2006 Paper 6 Q9: BDDs, Herbrand models, resolution programs. • The course should help you to understand the Prolog lan- (Lect. 6–8) guage, and its treatment of logic should be helpful for un- 2005 Paper 5 Q9: resolution (Lect. 6, 8, 9) derstanding other theoretical courses. Try to avoid getting • 2005 Paper 6 Q9: DPLL, BDDs, tableaux (Lect. 6, 10, 12) bogged down in the details of how the various proof meth- • ods work, since you must also acquire an intuitive feel for 2004 Paper 5 Q9: semantics and proof in FOL (Lect. 4, 5) logical reasoning. • 2004 Paper 6 Q9: ten true or false questions The most suitable course text is this book: • 2003 Paper 5 Q9: BDDs; clause-based proof methods Michael Huth and Mark Ryan, Logic in • (Lect. 6, 10) Computer Science: Modelling and Reasoning 2003 Paper 6 Q9: sequent calculus (Lect. 5) about Systems, 2nd edition (CUP, 2004) • 2002 Paper 5 Q11: semantics of propositional and first-order It covers most aspects of this course with the exception of • logic (Lect. 2, 4) resolution theorem proving. It includes material (symbolic 2002 Paper 6 Q11: resolution; proof systems model checking) that could be useful later. • The following book may be a useful supplement to Huth 2001 Paper 5 Q11: satisfaction relation; logical equivalences and Ryan. It covers resolution, as well as much else relevant • 2001 Paper 6 Q11: clause-based proof methods; ordered to Logic and Proof. • ternary decision diagrams (Lect. 6, 10) Mordechai Ben-Ari, Mathematical Logic for 2000 Paper 5 Q11: tautology checking; propositional se- Computer Science, 2nd edition (Springer, 2001) • quent calculus (Lect. 2, 3, 10) The following book provides a different perspective on 2000 Paper 6 Q11: unification and resolution (Lect. 8, 9) • modal logic, and it develops propositional logic carefully. 1999 Paper 5 Q10: Prolog resolution versus general resolu- Finally available in paperback. • tion Sally Popkorn, First Steps in Modal Logic (CUP, 1999 Paper 6 Q10: Herbrand models and clause form • 2008) 1998 Paper 5 Q10: BDDs, sequent calculus, etc. (Lect. 3, • There are numerous exercises in these notes, and they are 10) suitable for supervision purposes. Most old examination 1998 Paper 6 Q10: modal logic (Lect. 11); resolution questions for Foundations of Logic Programming (the for- • 1997 Paper 5 Q10: first-order logic (Lect. 4) mer name of this course) are still relevant. As of 2013/14, • Herbrand’s theorem has been somewhat deprecated, still 1997 Paper 6 Q10: sequent rules for quantifiers (Lect. 5) • mentioned but no longer in detail. Some unification the- 1996 Paper 5 Q10: sequent calculus (Lect. 3, 5, 10) ory has also been removed. These changes created space • for a new lecture on Decision Procedures and SMT Solvers. 1996 Paper 6 Q10: DPLL versus Resolution (Lect. 9) • 1995 Paper 5 Q9: BDDs (Lect. 10) 2013 Paper 5 Q5: DPLL, sequent or tableau calculus • • 2013 Paper 6 Q6: resolution problems 1995 Paper 6 Q9: outline logics; sequent calculus (Lect. 3, • • 5, 11) 2012 Paper 5 Q5: (Herbrand: deprecated) • 1994 Paper 5 Q9: resolution versus Prolog (Lect. 8) 2012 Paper 6 Q6: sequent or tableau calculus, modal logic, • • BDDs 1994 Paper 6 Q9: Herbrand models (Lect. 7) • 2011 Paper 5 Q5: resolution, linear resolution, BDDs 1994 Paper 6 Q9: most general unifiers and resolution • • 2011 Paper 6 Q6: unification, modal logic (Lect. 9) • 2010 Paper 5 Q5: BDDs and models 1993 Paper 3 Q3: resolution and Prolog (Lect. 8) • • 2010 Paper 6 Q6: sequent or tableau calculus, DPLL. Note: • the formula in the first part of this question should be . x P.x/ Q/ x .P.x/ Q/. Acknowledgements. Chloë Brown, Jonathan Davies and 9 ! ! 8 ! Reuben Thomas pointed out numerous errors in these notes. 2008 Paper 3 Q6: BDDs, DPLL, sequent calculus • David Richerby and Ross Younger made detailed sugges- 2008 Paper 4 Q5: proving or disproving first-order formulas, • tions. Thanks also to Thomas Forster, Simon Frankau, resolution Adam Hall, Ximin Luo, Steve Payne, Tom Puverle, Max 2009 Paper 6 Q7: modal logic (Lect. 11) Spencer, Ben Thorner, Tjark Weber and John Wickerson. • 2 PROPOSITIONAL LOGIC 2 2 Propositional Logic the meaning of the propositional symbols it contains. The meaning can be calculated using the standard truth tables. Propositional logic deals with truth values and the logical connectives and, or, not, etc. Most of the concepts in propo- AB AA BA BA BA B : ^ _ ! $ sitional logic have counterparts in first-order logic. Here are 1 1 0 1 1 1 1 the most fundamental concepts. 1 0 0 0 1 0 0 0 1 1 0 1 1 0 Syntax refers to the formal notation for writing assertions. 0 0 1 0 0 1 1 It also refers to the data structures that represent asser- tions in a computer. At the level of syntax, 1 2 is a By inspecting the table, we can see that A B is equiv- ! string of three symbols, or a tree with a nodeC labelled alent to A B and that A B is equivalent to .A : _ $ ! + and having two children labelled 1 and 2. B/ .B A/. (The latter is also equivalent to .A B/, where^ !is exclusive-or.) : ⊕ Semantics expresses the meaning of a formula in terms of Note⊕ that we are using t and f in the language as symbols mathematical or real-world entities. While 1 2 and to denote the truth values 1 and 0. The former belongs to C 2 1 are syntactically distinct, they have the same se- syntax, the latter to semantics. When it comes to first-order C mantics, namely 3. The semantics of a logical state- logic, we shall spend some time on the distinction between ment will typically be true or false. symbols and their meanings. We now make some definitions that will be needed Proof theory concerns ways of proving statements, at least throughout the course. the true ones. Typically we begin with axioms and arrive at other true statements using inference rules. Definition 1 An interpretation, or truth assignment, for a Formal proofs are typically finite and mechanical: set of formulæ is a function from its set of propositional their correctness can be checked without understand- symbols to 1; 0 . ing anything about the subject matter. An interpretationf g satisfies a formula if the formula eval- uates to 1 under the interpretation. Syntax can be represented in a computer. Proof methods A set S of formulæ is valid (or a tautology) if every in- are syntactic, so they can be performed by computer. On terpretation for S satisfies every formula in S. the other hand, as semantics is concerned with meaning, it A set S of formulæ is satisfiable (or consistent) if there is exists only inside people’s heads. This is analogous to the some interpretation for S that satisfies every formula in S. way computers handle digital photos: the computer has no A set S of formulæ is unsatisfiable (or inconsistent) if it conception of what your photos mean to you, and internally is not satisfiable. they are nothing but bits. A set S of formulæ entails A if every interpretation that satisfies all elements of S, also satisfies A. Write S A. 2.1 Syntax of propositional logic Formulæ A and B are equivalent, A B, providedjH A B and B A. ' jH Take a set of propositional symbols P, Q, R, :::. A formula jH consisting of a propositional symbol is called atomic. We It is usual to write A B instead of A B. We may use t and f to denote true and false. similarly identify a one-elementjH set withf ag jHformula in the Formulæ are constructed from atomic formulæ using the other definitions. logical connectives1 Note that and are not logical connectives but rela- tions betweenjH formulæ.' They belong not to the logic but to (not) the metalanguage: they are symbols we use to discuss the : (and) ^ logic. They therefore have lower precedence than the logi- (or) cal connectives. No parentheses are needed in A A A _ (implies) ^ ' ! because the only possible reading is .A A/ A. We may (if and only if) not write A .A A/ because A A^is not' a formula. $ ^ ' ' These are listed in order of precedence; is highest. We In propositional logic, a valid formula is also called a shall suppress needless parentheses, writing,: for example, tautology. Here are some examples of these definitions. The formulæ A A and .A A/ are valid for ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    34 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us