(p == train arrives late) (q == there are taxis) (r == If p and not q, then r. Not r. p. Therefore, q. Propositional Logic

Similar documents
1 Propositional logic

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Lecture 1: Propositional Logic (I)

15414/614 Optional Lecture 1: Propositional Logic

LOGIC IN COMPUTER SCIENCE

03 Propositional Logic II

Propositional Logic. Fall () Propositional Logic Fall / 30

Propositional Logic: Deductive Proof & Natural Deduction Part 1

Natural Deduction for Propositional Logic

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Introducing Proof 1. hsn.uk.net. Contents

Logic. Propositional Logic: Syntax

Chapter 1: The Logic of Compound Statements. January 7, 2008

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

FORMAL PROOFS DONU ARAPURA

Logic for Computer Science - Week 5 Natural Deduction

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Logic for Computer Science - Week 4 Natural Deduction

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Logic. Propositional Logic: Syntax. Wffs

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS 512, Spring 2016, Handout 02 Natural Deduction, and Examples of Natural Deduction, in Propositional Logic

Propositional Logic. Spring Propositional Logic Spring / 32

Propositional logic. Programming and Modal Logic

A Quick Lesson on Negation

In this chapter, we specify a deductive apparatus for PL.

Introduction to Metalogic

Advanced Topics in LP and FP

Introduction to Theoretical Computer Science

cis32-ai lecture # 18 mon-3-apr-2006

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

3 The Semantics of the Propositional Calculus

The statement calculus and logic

PROPOSITIONAL CALCULUS

4 Derivations in the Propositional Calculus

Deductive and Inductive Logic

A Little Deductive Logic

DISCRETE MATHEMATICS BA202

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54

Logic and Proofs. (A brief summary)

A Little Deductive Logic

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Propositional Logic: Syntax

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Topic 1: Propositional logic

Discrete Mathematics and Its Applications

AI Programming CS S-09 Knowledge Representation

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

Natural deduction for truth-functional logic

Propositional logic. Programming and Modal Logic

Propositional natural deduction

Mat 243 Exam 1 Review

Manual of Logical Style

Intermediate Logic. Natural Deduction for TFL

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

CITS2211 Discrete Structures Proofs

THE LOGIC OF COMPOUND STATEMENTS

Valid Reasoning. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February, Outline Truth and Validity Valid Reasoning

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

EECS 1028 M: Discrete Mathematics for Engineers

Learning Goals of CS245 Logic and Computation

Formal Logic. Critical Thinking

THE LOGIC OF COMPOUND STATEMENTS

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

HANDOUT AND SET THEORY. Ariyadi Wijaya

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

02 Propositional Logic

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

The semantics of propositional logic

A statement is a sentence that is definitely either true or false but not both.

CHAPTER 6 - THINKING ABOUT AND PRACTICING PROPOSITIONAL LOGIC

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Math.3336: Discrete Mathematics. Propositional Equivalences

Supplementary Logic Notes CSE 321 Winter 2009

Introduction to Metalogic

The predicate calculus is complete

Logic and Proofs. (A brief summary)

We have seen that the symbols,,, and can guide the logical

The Logic of Compound Statements cont.

Logic: Propositional Logic (Part I)

Logic for Computer Science Handout Week 8 DERIVED RULE MODUS TOLLENS DERIVED RULE RAA DERIVED RULE TND

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Propositions. Frequently, we will use the word statement instead of proposition.

CSCI Homework Set 1 Due: September 11, 2018 at the beginning of class

Propositional Logic: Review

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

Propositional Logic Arguments (5A) Young W. Lim 2/23/17

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

Discrete Structures for Computer Science

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

Arguments and Proofs. 1. A set of sentences (the premises) 2. A sentence (the conclusion)

Transcription:

Propositional Logic The aim of logic in computer science is to develop languages to model the situations we encounter as computer science professionals Want to do that in such a way that we can reason about them formally. Reasoning about situations means constructing arguments about them; we want to do this formally, so that the arguments are valid and can be defended rigorously, or executed on a machine. Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. Example 1.2 If it is raining and Jane does not have her umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her. (p == train arrives late) (q == there are taxis) (r == If p and not q, then r. Not r. p. Therefore, q.

Declarative Sentences We need language in which we can express sentences in such a way that brings out their logical structure. The language we begin with is the language of propositional logic. It is based on propositions, or declarative sentences Phrases which one can, in principle, argue as being true or false. Examples: The sum of the numbers 3 and 5 equals 8. Jane reacted violently to Jack s accusations. Every even natural number >2 is the sum of two prime numbers. All Martians like pepperoni on their pizza. Kol 6alaba in CS5371 6alabet 3olom 7assob Non Examples: Could you please pass me the salt? Ready, steady, go! May fortune come your way. The logics we intend to design are symbolic in nature. We translate a certain sufficiently large subset of all English declarative sentences into strings of symbols. Gives us a compressed but still complete encoding of declarative sentences and allows us to concentrate on the mere mechanics of our argumentation Sentences are atomic (indecomposable). E.g., the number 5 is even We assign certain distinct symbols p, q, r,..., or sometimes p1, p2, p3,... to each of these atomic sentences and we can then code up more complex sentences in a compositional way. For example, given the atomic sentences p: I won the lottery last week. q: I purchased a lottery ticket. r: I won last week s sweepstakes.

we can form more complex sentences according to the rules below: : The negation of p is denoted by p and expresses I did not win the lottery last week, or equivalently It is not true that I won the lottery last week. : Given p and r we may wish to state that at least one of them is true: I won the lottery last week, or I won last week s sweepstakes; we denote this declarative sentence by p r and call it the disjunction of p and r2. : Dually, the formula p r denotes the rather fortunate conjunction of p and r: Last week I won the lottery and the sweepstakes. : Last, but definitely not least, the sentence If I won the lottery last week, then I purchased a lottery ticket. expresses an implication between p and q, suggesting that q is a logical consequence of p. We write p q for that3. We call p the assumption of p q and q its conclusion Binding: p q r q Does it mean that if p and q then not r or q. Or p is the case and if q then (p q) (( r) q) binds more tightly than and, and, bind more tightly than. Implication is right-associative: expressions of the form p q r denote p (q r).

Exercises 1 Exercises 2 Exercises 3 Natural deduction How do we go about constructing a calculus for reasoning about propositions, so that we can establish the validity of Examples 1.1 and 1.2? We need to have a set of rules each of which allows us to draw a conclusion given a certain arrangement of premises. In natural deduction, we have such a collection of proof rules. They allow us to infer formulas from other formulas. By applying these rules in succession, we may infer a conclusion from a set of premises. Suppose we have a set of formulas4 φ1, φ2, φ3,..., φn, which we will call premises, and another formula, ψ, which we will call a conclusion. By applying proof rules to the premises, we hope to get some more formulas, and by applying more proof rules to those, to eventually obtain the conclusion. This intention we denote by φ1, φ2,..., φn -- ψ. (we call this a sequent) It is not necessarily obvious which rules to apply, and in what order, to obtain the desired conclusion. Additionally, our proof rules should be carefully chosen; otherwise, we might be able to prove invalid patterns of argumentation. (p, q -- p q) Exercise 4 Can you write the examples 1 and 2 as a sequent?

Rules for natural deduction 1) The rules for conjunction (^, or and-introduction): It allows us to conclude φ ψ, given that we have already concluded φ and ψ separately. We write this rule as o Above the line are the two premises of the rule. o Below the line goes the conclusion. (It might not yet be the final conclusion of our argument; we might have to apply more rules to get there.) o To the right of the line, we write the name of the rule; i is read andintroduction o Notice that we have introduced a (in the conclusion) where there was none before (in the premises). o For each of the connectives, there is one or more rules to introduce it and one or more rules to eliminate it. The rules for and-elimination are these two: Example Can we prove p q, r q r? We start by writing down the premises; then we leave a gap and write the conclusion Exercise 5 (p q) r, s t q s

2) The rules of double negation It is not true that it does not rain. Example Can we prove p, (q r) p r 3) The rule for eliminating implication p : It rained. p q : If it rained, then the street is wet. OR p: The value of the program s input is an integer. p q : If the program s input is an integer, then the program outputs a boolean.

We can use these rules as often as want to: p, p q and p (q r), we may infer r: Rule for Modus Tollens If Abraham Lincoln was Ethiopian, then he was African. Abraham Lincoln was not African; therefore he was not Ethiopian. Exercise 6 p (q r), p, r -- q

The rule implies introduction p q -- q p The box in this proof serves to demarcate the scope of the temporary assumption q. What we are saying is: let s make the assumption of q. To do this, we open a box and put q at the top. Then we continue applying other rules as normal, for example to obtain p. But this still depends on the assumption of q, so it goes inside the box. Finally, we are ready to apply i. It allows us to conclude q p, o but that conclusion no longer depends on the assumption q. o Compare this with saying that If you are French, then you are European. o The truth of this sentence does not depend on whether anybody is French or not. o Therefore, we write the conclusion q p outside the box. It says: in order to prove φ ψ, o make a temporary assumption of φ and then prove ψ. o In your proof of ψ, you can use φ and any of the other formulas such as premises and provisional conclusions that you have made so far. o Proofs may nest boxes or open new boxes after old ones have been closed. o There are rules about which formulas can be used at which points in the proof.

Example: o Generally, we can only use a formula φ in a proof at a given point if that formula occurs prior to that point and if no box which encloses that occurrence of φ has been closed already. q p -- p q.

Example of Proving a theorem: remember, a theorem is always correct and needs no premises: First step: Construct a truth table to this (q r) (( q p) (p r)) (q r) (( q p) (p r))

Exercise (Team 1): p q r -- p (q r): Exercise (Team 2): p (q r) -- p q r Exercise (Team 3): p q -- p r q r:

The rules for disjunction Introduction is fairly simple: So if p stands for Agassi won a gold medal in 1996. and q denotes the sentence Agassi won Wimbledon in 1996. then p q is the case because p is true, regardless of the fact that q is false Or-Elimination: Any idea what this means? Example: p q -- q p

Some points to keep in mind about the Ve rule For it to be a sound argument we have to make sure that the conclusions in each of the two cases (the χ in the rule) are actually the same formula. o The work done by the rule e is the combining of the arguments of the two cases into one. o In each case you may not use the temporary assumption of the other case, unless it is something that has already been shown before those case boxes began. o The invocation of rule e in line 6 lists three things: o the line in which the disjunction appears (1), o and the location of the two boxes for the two cases (2 3 and 4 5). Example (Salamah): q r -- p q p r

Exercises: Everybody (p q) r -- p (q r) p (q r) -- (p q) (p r)

Fun Example: -- p (q p) 1) Do a truth table 2) Construct a proof The rules for negation We have seen the rules i and e, We haven t seen any rules that introduce or eliminate single negations. These rules involve the notion of contradiction Definition 1.19 Contradictions are expressions of the form φ φ or φ φ, where φ is any formula. Examples of such contradictions are r r, (p q) (p q) (r s q) (r s q).

Example (Salamah) p q, p q -- p To be convinced this true, construct a truth table for this Exercise (Class) p p -- p, Same idea with truth table

Exercise (Class) p (q r), p, r q (Without MT) Exercise (Class) p q r, r, p q

Quiz: Prove the following 1) MT