Transcription

3 Visualisation: Venn Diagrams the boxes are the space of all situations where x and y are true or false labelled circles describe those situations where x and y are true red area describes those situations where the formula is true. 2 / 41

5 Back to Boolean Functions Definition. Given a set of V of variables, boolean formulae are constructed as follows: T (true) and F (false) and all variables x V are boolean formulae if φ and ψ are boolean formulae, then so are φ ψ and φ ψ. if φ is a boolean formula, then so is φ. Examples. T (x ( y)) x x (T (F x) Precedence. binds more strongly than binds more strongly than : x y z reads as (( x) y) z Crucial Aspect. Boolean formulae can be evaluated given (boolean) values for all variables. 4 / 41

10 Two faces of boolean Equations Truth of boolean equations: A boolean equation φ = ψ (where φ, ψ are boolean formulae) is true if φ and ψ evaluate to the same truth values, for all possible truth values of the variables that occur in φ and ψ. Equational Provability of boolean equations: A boolean equation is provable if it can be derived from associativity, commutativity, absorption, identity, distributivity and complements using the laws of equational reasoning. Q. How do these two notions hang together? 9 / 41

11 Soundness and Completeness Slightly Philosophical. Truth of an equation relates to the meaning (think: truth tables) of the connectives, and. Equational provability relates to a method that allows us to establish truth of an equation. They are orthogonal and independent ways to think about equations. Soundness. If a boolean equation φ = ψ is provable using equations, then it is true. all basic equations (associativity, distributivity,... ) are true the rules of equational reasoning preserve truth. Completeness. If a boolean equation is true, then it is provable using equations. more complex proof (not given here), using the so-called Lindenbaum Construction. 10 / 41

12 Challenge Problem: The De Morgan Laws De Morgan s Laws (x y) = x y (x y) = x y In English if it is false that either x or y is true, they must both be false if it is false that both x and y are true, then one of them must be false. Truth of De Morgan s Laws: Easy to establish via truth tables. Provability of De Morgan s Laws if the completeness theorem (that we didn t prove!) is true, then an equational proof must exist however, it is quite difficult to actually find it! 11 / 41

14 Towards Propositional Formulae and Natural Deduction New Connective. Implication, written In English. x y means if x is true, then so is y. Truth Table. Informally, think of x y as a promise. the promise is that y is true if x is true x y evaluates to F if the promise is broken x y x y F F 13 / 41

15 Towards Propositional Formulae and Natural Deduction New Connective. Implication, written In English. x y means if x is true, then so is y. Truth Table. Informally, think of x y as a promise. the promise is that y is true if x is true x y evaluates to F if the promise is broken x y x y F F T F T 13 / 41

16 Towards Propositional Formulae and Natural Deduction New Connective. Implication, written In English. x y means if x is true, then so is y. Truth Table. Informally, think of x y as a promise. the promise is that y is true if x is true x y evaluates to F if the promise is broken x y x y F F T F T T T F 13 / 41

17 Towards Propositional Formulae and Natural Deduction New Connective. Implication, written In English. x y means if x is true, then so is y. Truth Table. Informally, think of x y as a promise. the promise is that y is true if x is true x y evaluates to F if the promise is broken x y x y F F T F T T T F F T T 13 / 41

19 Interlude: Logic to English Exercise. Use the predicates I I m going surfing, Y you re going surfing, and W there ll be a big wave that kills us all, to translate the following statements to English: 1. I Y W 2. (I W ) (Y W ) Possible Answer. 14 / 41

20 Interlude: Logic to English Exercise. Use the predicates I I m going surfing, Y you re going surfing, and W there ll be a big wave that kills us all, to translate the following statements to English: 1. I Y W 2. (I W ) (Y W ) Possible Answer. 1. If both of us are goign surfing, then there ll be a big wave that kills us all. 14 / 41

21 Interlude: Logic to English Exercise. Use the predicates I I m going surfing, Y you re going surfing, and W there ll be a big wave that kills us all, to translate the following statements to English: 1. I Y W 2. (I W ) (Y W ) Possible Answer. 1. If both of us are goign surfing, then there ll be a big wave that kills us all. 2. If both of us are goign surfing, then there ll be a big wave that kills us all. (Both formulae have the same truth table!) 14 / 41

22 Propositional Formulae Definition. Given a set of V of variables, propositional formulae are constructed as follows: T (true) and F (false) and all variables x V are boolean formulae if φ and ψ are boolean formulae, then so are φ ψ and φ ψ and φ ψ if φ is a boolean formula, then so is φ. Precedence. binds more strongly than binds more strongly than binds more strongly than : x y z reads as ( x) (y z) Boolean Formulae vs Propositional Formulae propositional formulae are boolean formulae with addition of is expressible using boolean formulae: x y = x y but is included as implication is used very frequently 15 / 41

23 Contradictions and Contingencies Types of Propositional Formulae. A propositional formula is valid, if it evaluates to true under all truth value assignments. a contradiction if it evaluates to F under all truth value assignments, and a contingency if there are (necessarily different) truth value assigments for whic it evaluates to T and to F. Example. John had toast for breakfast is a contingency. John had toast for breakfast John had toast for breakfast is a contradiction. p ( q p) (p q) r can be complicated 16 / 41

25 Natural Deduction Truth Tables. Can be exponential Equational Proofs. Can be very unintuitive Natural Deduction formal system that imitates human reasoning explains one connective at a time: intro and elim rules used to prove validity of formulae. also used in all formal theorem provers 18 / 41

27 Conjunction rules And Introduction ( -I) p q p q as p is true, and q is true, we have that p q is true. And Elimination ( -E) p q p p q q as p q is true, we have that p is true. as p q is true, we have that q is true. 20 / 41

33 Useless assumptions You can assume anything, but it might not be useful. 1 p q 2 q -E, 1 3 (p q) q -I, p You are a giraffe 2 You are a giraffe -E, 1 3 p You are a giraffe You are a giraffe -I, / 41

34 Disjunction rules Or Introduction ( -I) p p p q q p if p (holds), then so do p q and q p Or Elimination ( -E) [p] [q].. p q r r r assuming that we have a proof of p q and for the case that p holds, we have a proof of r for the case that q holds we have a proof of r then we have a proof of r just from p q. 27 / 41

43 Which rule to use next? Guided by the form of your goal, and what you already have proved form ie, look at the connective:,,, always can consider using PC (proof by contradiction) to prove p q, -I (or introduction) may not work p p q q p q p may not be necessarily true, q may not be necessarily true 36 / 41

44 To prove p q, sometimes you need to do this: 1. Using PC, assume (p q) (hoping to prove some contradiction) 2. When is (p q) true? When both p and q false! 3. From (p q) how to prove p? (next slide) 4. Having proved both p and q, prove some further contradiction Tutorial Exercise. p q p q 37 / 41

48 Summary: Major Proof Techniques Three major styles of proof in logic and mathematics Model based computation: truth tables for propositional logic Algebraic proof: equational reasoning Deductive reasoning: rules of inference (e.g. Natural Deduction) Q. Why bother? Why not write a program that does truth tables? propositional logic is decidable: can write a program other logics are not: first order logic (next week) 41 / 41

Topic 1: Propositional logic Guy McCusker 1 1 University of Bath Logic! This lecture is about the simplest kind of mathematical logic: propositional calculus. We discuss propositions, which are statements

Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about

Propositional Equivalence Tautologies and contradictions A compound proposition that is always true, regardless of the truth values of the individual propositions involved, is called a tautology. Example:

Computation and Logic Definitions True and False Also called Boolean truth values, True and False represent the two values or states an atom can assume. We can use any two distinct objects to represent

Proposition/Statement Boolean Logic CS 231 Dianna Xu A proposition is either true or false but not both he sky is blue Lisa is a Math major x == y Not propositions: Are you Bob? x := 7 1 2 Boolean variables

Section 1.1: Logical Form and Logical Equivalence An argument is a sequence of statements aimed at demonstrating the truth of an assertion. The assertion at the end of an argument is called the conclusion,

5 Logic In this part of the course we consider logic. Logic is used in many places in computer science including digital circuit design, relational databases, automata theory and computability, and artificial

Mathematical Logic Part One Question: How do we formalize the defnitions and reasoning we use in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical

Section 1.4 Propositional Logic Not Enough If we have: All men are mortal. Socrates is a man. Does it follow that Socrates is mortal? Can t be represented in propositional logic. Need a language that talks

Natural deduction for truth-functional logic Phil 160 - Boston University Why natural deduction? After all, we just found this nice method of truth-tables, which can be used to determine the validity or

Symbolic Logic 3 Testing deductive validity with truth tables For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true. So, given that truth tables

Section 1.2 Propositional Equivalences A tautology is a proposition which is always true. Classic Example: P P A contradiction is a proposition which is always false. Classic Example: P P A contingency

Mathematics for linguists WS 2009/2010 University of Tübingen January 7, 2010 Gerhard Jäger Mathematics for linguists p. 1 Inferences and truth trees Inferences (with a finite set of premises; from now

irst Order Logic: Syntax and Semantics COMP30412 Sean Bechhofer sean.bechhofer@manchester.ac.uk Logic Recap You should already know the basics of irst Order Logic (OL) It s a prerequisite of this course!

CHAPTER 10 Gentzen Style Proof Systems for Classical Logic Hilbert style systems are easy to define and admit a simple proof of the Completeness Theorem but they are difficult to use. By humans, not mentioning

Propositions and Proofs Gert Smolka, Saarland University April 25, 2018 Proposition are logical statements whose truth or falsity can be established with proofs. Coq s type theory provides us with a language

COMP4418, 2017 Assignment 1 Due: 14:59:59pm Wednesday 30 August (Week 6) Late penalty: 10 marks per day) Worth: 15%. This assignment consists of three questions. The first two questions require written

Logic: Truth Tables CS160 Rosen Chapter 1 Logic? 1 What is logic? Logic is a truth-preserving system of inference Truth-preserving: If the initial statements are true, the inferred statements will be true

ormal Logic Critical hinking Recap: ormal Logic If I win the lottery, then I am poor. I win the lottery. Hence, I am poor. his argument has the following abstract structure or form: If P then Q. P. Hence,

3 The Semantics of the Propositional Calculus 1. Interpretations Formulas of the propositional calculus express statement forms. In chapter two, we gave informal descriptions of the meanings of the logical

The Language of A Henkin-style Proof for Natural Deduction January 16, 2013 The Language of A Henkin-style Proof for Natural Deduction Logic Logic is the science of inference. Given a body of information,

Propositional Logic Reading: Chapter 7.1, 7.3 7.5 [ased on slides from Jerry Zhu, Louis Oliphant and ndrew Moore] Logic If the rules of the world are presented formally, then a decision maker can use logical

AI Programming CS662-2013S-09 Knowledge Representation David Galles Department of Computer Science University of San Francisco 09-0: Overview So far, we ve talked about search, which is a means of considering

Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite

You are a mathematician if 1.1 Overview you say to a car dealer, I ll take the red car or the blue one, but then you feel the need to add, but not both. --- 1. Logic and Mathematical Notation (not in the

Introduction INTRODUCTION TO LOGIC 2 Syntax and Semantics of Propositional Logic Volker Halbach In what follows I look at some formal languages that are much simpler than English and define validity of

A Little Deductive Logic In propositional or sentential deductive logic, we begin by specifying that we will use capital letters (like A, B, C, D, and so on) to stand in for sentences, and we assume that

Math 304 Spring 2007 Glossary of Logical Terms The following glossary briefly describes some of the major technical logical terms used in this course. The glossary should be read through at the beginning

Chapter 2: Introduction to Propositional Logic PART ONE: History and Motivation Origins: Stoic school of philosophy (3rd century B.C.), with the most eminent representative was Chryssipus. Modern Origins:

MA103 STATEMENTS, PROOF, LOGIC Abstract Mathematics is about making precise mathematical statements and establishing, by proof or disproof, whether these statements are true or false. We start by looking

Propositional Logic Review UC Berkeley, Philosophy 142, Spring 2016 John MacFarlane The task of describing a logical system comes in three parts: Grammar Describing what counts as a formula Semantics Defining

Mathematical Logic Part One Question: How do we formalize the definitions and reasoning we use in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical

The Laws of Boolean Boolean algebra As well as the logic symbols 0 and 1 being used to represent a digital input or output, we can also use them as constants for a permanently Open or Closed circuit or

Notes on Inference and Deduction Consider the following argument 1 Assumptions: If the races are fixed or the gambling houses are crooked, then the tourist trade will decline. If the tourist trade declines

1 CHAPTER 6 - THINKING ABOUT AND PRACTICING PROPOSITIONAL LOGIC Here, you ll learn: what it means for a logic system to be finished some strategies for constructing proofs Congratulations! Our system of

Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

Chapter 9 Linear Temporal Logic (LTL) This chapter introduces the Linear Temporal Logic (LTL) to reason about state properties of Labelled Transition Systems defined in the previous chapter. We will first

Kecerdasan Buatan M. Ali Fauzi Artificial Intelligence M. Ali Fauzi Logical Agents M. Ali Fauzi In which we design agents that can form representations of the would, use a process of inference to derive

Eric Schechter Equivalents of Mingle and Positive Paradox Abstract. Relevant logic is a proper subset of classical logic. It does not include among itstheoremsanyof positive paradox A (B A) mingle A (A

Artificial Intelligence Propositional Logic Marc Toussaint University of Stuttgart Winter 2016/17 (slides based on Stuart Russell s AI course) Motivation: Most students will have learnt about propositional

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS 1 Language There are several propositional languages that are routinely called classical propositional logic languages. It is due to the functional dependency

Supplementary exercises in propositional logic The purpose of these exercises is to train your ability to manipulate and analyze logical formulas. Familiarize yourself with chapter 7.3-7.5 in the course

Deductive Systems Lecture - 3 Axiomatic System Axiomatic System (AS) for PL AS is based on the set of only three axioms and one rule of deduction. It is minimal in structure but as powerful as the truth

CHAPTER 15 Boolean Algebra 15.1 INTRODUCTION Both sets and propositions satisfy similar laws, which are listed in Tables 1-1 and 4-1 (in Chapters 1 and 4, respectively). These laws are used to define an