REVIEW. Logical Equivalences Table 6 from book. Logical Equivalences and Proofs With them. Some more proofs (and useful equivalences)

Similar documents
PHIL12A Section answers, 28 Feb 2011

Supplementary Logic Notes CSE 321 Winter 2009

The Logic of Compound Statements cont.

For a horseshoe statement, having the matching p (left side) gives you the q (right side) by itself. It does NOT work with matching q s.

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

Logic, Sets, and Proofs

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Propositional Logic. Spring Propositional Logic Spring / 32

Tautologies, Contradictions, and Contingencies

Manual of Logical Style

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

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

PHIL012. SYMBOLIC LOGIC PROPOSITIONAL LOGIC DERIVATIONS

Logic: Propositional Logic (Part I)

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

3 The Semantics of the Propositional Calculus

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

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

Section 1.2: Propositional Logic

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

Proof strategies, or, a manual of logical style

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Topic 1: Propositional logic

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Deductive Systems. Lecture - 3

4 Derivations in the Propositional Calculus

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

THE LOGIC OF COMPOUND STATEMENTS

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

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

FORMAL PROOFS DONU ARAPURA

1.1 Statements and Compound Statements

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

Supplementary exercises in propositional logic

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Manual of Logical Style (fresh version 2018)

Logic and Inferences

Advanced Topics in LP and FP

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Truth-Functional Logic

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Logic and Proofs. (A brief summary)

Section 1.1 Propositions

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

Math 3336: Discrete Mathematics Practice Problems for Exam I

MATH 22 INFERENCE & QUANTIFICATION. Lecture F: 9/18/2003

CSC Discrete Math I, Spring Propositional Logic

Rules Build Arguments Rules Building Arguments

1) Let h = John is healthy, w = John is wealthy and s = John is wise Write the following statement is symbolic form

Warm-Up Problem. Is the following true or false? 1/35

The statement calculus and logic

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

CITS2211 Discrete Structures Proofs

We last time we began introducing equivalency laws.

Solutions to Homework I (1.1)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

02 Propositional Logic

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

Propositional Equivalence

Language of Propositional Logic

Logic and Proofs. (A brief summary)

EECS 1028 M: Discrete Mathematics for Engineers

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Packet #1: Logic & Proofs. Applied Discrete Mathematics

(Refer Slide Time: 02:20)

Proof Tactics, Strategies and Derived Rules. CS 270 Math Foundations of CS Jeremy Johnson

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC)

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

A. Propositional Logic

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

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

Logical Form 5 Famous Valid Forms. Today s Lecture 1/26/10

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

1 The Foundation: Logic and Proofs

CS250: Discrete Math for Computer Science. L6: CNF and Natural Deduction for PropCalc

Lecture 4: Proposition, Connectives and Truth Tables

15414/614 Optional Lecture 1: Propositional Logic

PROPOSITIONAL CALCULUS

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Chapter 1 Elementary Logic

Recitation Week 3. Taylor Spangler. January 23, 2012

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Readings: Conjecture. Theorem. Rosen Section 1.5

SE 212: Logic and Computation. se212 Nancy Day

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Propositional Calculus

Compound Propositions

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

CSE 20 DISCRETE MATH WINTER

CS 2336 Discrete Mathematics

2.2: Logical Equivalence: The Laws of Logic

Section 1.1: Logical Form and Logical Equivalence

Transcription:

REVIEW Logical Equivalences Table 6 from book T F Identity ( B) C (B C) ( B) C (B C) ssociative T T F F Dominati (B C) ( B) ( C) (B C) ( B) ( C) Distributive Idempot ent ( B) B ( B) B De Morgan s ( ) Double negati ( B) ( B) bsorpti B B B B Commut ative T F Negati B B Def Implicati B ( B) (B ) Def of Bicditial Borgida/Rosen 2016 1 Borgida/Rosen 2016 2 2 Logical Equivalences and Proofs With them Start with the left formula you are trying to show equivalent Use the patterns in the previous table as you did in algebra So (i) pattern match the left or right side of an equivalence in the preceding table against any SUBformula S of a formulaw, and (ii) then replace in W the matched subformula S with the other side of the instantiated pattern S e.g., Inside q /\ (r\/~s) /\ T you can recognize ( /\ T) with being (r\/~s), and so show that q /\ (r\/~s) /\ T == q \/ (r\/~s) by Idempotent rule Some more proofs (and useful equivalences) p \/ q == ~~ p \/ q by double negati p == ~(~p) \/ q by associativity of ~ == ~p -> q by equivalence definiti of -> p \/ q == q \/ p by commutativity of \/ == ~~ q \/ p by double negati q == ~(~q) \/ p by associativity of ~ == ~q -> p by equivalence definiti of -> So, in general p \/ q == ~p -> q == ~q -> p ~q->~p is called the ctrapositive of p -> q, and the above shows they are logically equivalent (use ~p instead of p everywhere try out a direct proof) Borgida/Rosen 2016 3 Borgida/Rosen 2016 4

Truth functial completeness- able to express all formulas {all cnectives} /* T =def= p \/ ~p */ {/\, \/, ~} : eliminate <->, -> using their expansi rules {/\, ~} : replace \/ B by ~(~/\~B) by using DeMorgan; so every formula written with {\/,/\,~} can be written with just {/\,~} Define new logical cnective NND (no special math symbol for it) as follows p NND q is ~(p ND q), ~(p /\ q). Note then that p p NND p T F F T Why is {NND} truth functially complete? Bec. it can simulate {~,/\}: How to simulate negati: ~ == NND (see truth tble above) How to simulate cjuncti: /\ B == == ~~(/\B) by double negati equivalence == ~ ( NND B) by defn of NND as ~(_ ND _) == ( NND B) NND ( NND B) by truth table above showing how negati of a formula can be expressed using NND Cjunctive Normal Form propositial formula is in cjunctive normal form if it csists of a cjuncti of (1,,n) disjuncts where each cjunct csists of a cjuncti of (1,, m) literals (literal = atomic formula or the negati of an atomic formula). (p \/ q \/ ~r) /\ (~p \/ r) (p) /\ (~p \/ q) because a single literal enough in a disjunct (m=1) p \/ q because a single cjunti is enough (n=1) p this is the truly degenerate case (m=1,n=1) p \/ (~p /\ q) NO (((p \/ q) /\ ~r) \/ ~p) NO Borgida/Rosen 2016 6 Borgida/Rosen 2016 7 Cjunctive Normal Form THEOREM: Every propositi can be put in an equivalent CNF. Proof: Cjunctive Normal Form (CNF) can be obtained by eliminating implicatis, moving negati inwards, using the distributive and associative laws, as well repeated applicati of logical equivalences Uses: Important in theorem proving and satisfiability testing, used in artificial Intelligence (I), system verificati. Cjunctive Normal Form e.g. Example: Put the following into CNF: Soluti: 1. Eliminate implicati signs: 3. Move negati inwards; eliminate double negati: 5. Cvert to CNF using associative/distributive laws 6. Simplify using equivalences ( identity here) (p \/ ~r) /\ (~q \/ ~r \/ p) Borgida/Rosen 2016 8 Borgida/Rosen 2016 9

Disjunctive Normal Form propositial formula is in disjunctive normal form if it csists of a disjuncti of (1,,n) cjuncts where each cjunct csists of a cjuncti of (1,, m) literals (literal = atomic formula or the negati of an atomic formula). (p /\ q /\~r) \/ (~p /\ r) (p) \/ (~p \/ q) because a single literal enough in a cjunct (m=1) p \/ q because a single cjunti is enough (n=1) p this is the truly denegenerate case (m=1,n=1) p /\ (~p \/ q) NO Disjunctive Normal Form is important for the circuit design methods discussed in Chapter 12. Disjunctive Normal Form Theorem: every compound propositi S can be put in disjunctive normal form. SOLUTION 1: Cstruct the truth table for the propositi S. For each row where S is true, cjoin an entry for every propositial variables p j as follows: if the value for p j is T, then just cjoin p j ; if the value for p j is F, then cjoin ~ p j. The DNF correspding to S is the OR (disjuncti) of all the above cjunctis But this may be the largest DNF of a formula. For example, for p->q, ~p \/ q is an equivalent DNF; now try the above algorithm using a truth table, for p->q SOLUTION 2: Put S in CNF Use distributive law repeatedly to get DNF (a+b)(c+d) = ac+ad+bc+bd pply logical equivalences to simplify the cjuncts Borgida/Rosen 2016 10 Borgida/Rosen 2016 11 Disjunctive Normal Form e.g. PROBLEM: Put the following in DNF SOLUTION 2: Put in CNF (p \/ ~r) /\ (~q \/ ~r \/ p) /* see 2 pages back */ Use distributive law repeatedly to get DNF (p \/ ~r) /\ (~q \/ ~r \/ p) == p/\~q \/ p/\~r \/ p/\p \/ ~r/\~q \/ ~r/\~r \/ ~r/\p pply logical equivalences to simplify the cjuncts == p/\~q \/ p/\~r \/ p \/ ~r/\~q \/ ~r \/ ~r/\p (idemp. law) Rules of inferences and Proofs with them (corrected and augmented slides from K. Rosen) Borgida/Rosen 2016 12 Borgida/Rosen 2016 14

Proofs by inference rules Proofs and Rules of inference proof is a sequence of propositi, some of which are given ( givens/ premises/ hypotheses ) and the last e is the cclusi valid proof = if all premises are True then cclusi must be True e.g. p= it rains, q= grass is wet 1. p given 2. p -> q given 3. q deduced Borgida/Rosen 2016 15 Valid proofs are cstructed by taking previous lines of the proof and adding a new propositi using a valid rule of inference -- a mini-proof pattern The above proof requires a rule of inference that allows B to be added as a new line if and ->B appear as earlier lines in the proof. (Called Modus Pens rule of inference) Borgida/Rosen 2016 16 Modus Pens rule Proof of correctness of the inference rule ( sound rule of inference ): show ( /\ ( ->B)) -> B is a tautology (use p and q instead of and B in the truth table below) B B So, an inference rule is to be interpreted as if the formulas above the solid line are already proven/true, then the formula below the line will also be deduced/true Borgida/Rosen 2016 17 True False True True False False ( ) B B B B B B (Equivalence rules repeated) Identity Dominati Idempot ent Double negati Commut ative Def Implicati ( B) C (B C) ( B) C (B C) (B C) ( B) ( C) (B C) ( B) ( C) ( B) B ( B) B ( B) ( B) True False B ( B) (B ) ssociative Distributive De Morgan s bsorpti Negati Def of Bicditial Borgida/Rosen 2016 2 20 0

Summary of Textbook Rules of Inference Modus pens Hypothetical syllogism OR dditi ND Cjuncti B B B B C C R B B Modus tollens Disjunctive syllogism ND Simplificati (Resoluti) B B B B B B C B C What a proof is according to the textbook The turnstile symbol -, used in 1, 2,... - B is read from {givens / premises / hypotheses} 1, 2,... derive B We want to derive a truth from truths. How can we be sure? What can you do when you derive?: (i) line is derived from e or more previous lines using e rule of inference (ii) line is obtained from e previous line using applicati of rules of equivalence (iii) The cstant True can be put any line of a proof Borgida/Rosen 2016 21 Borgida/Rosen 2016 22 BEWRE! Equivalence rules can be used to replace SUBformulas by equivalent es: p \/ q == p \/ ~~q by the double negati equivalence q==~q Inference rule can ly be applied to entire lines: eg inference rules ly apply top to bottom (above line Suppose r stands for It is raining, w for Grass is to below line), not bottom up wet, and suppose you are given r -> w and ~r. The following are incorrect proosf lead to a cclusi not justified by what is given: 1. r -> w given 2. ~ r given? w Modus pens 1, PRT of 2 (inside ~) Surely not correct cclusi? ~ w Modus pens 1, PRT of 2 (inside ~) but this time keep the ~ in frt. Incorrect cclusi (grass could be wet for other reass) Borgida/Rosen 2016 24 Borgida/Rosen 2016 23 More difference between inference rules and equivalence rules Remember, equivalences go both right to left and left to right;

n example proof (and thinking about it): SHOW that Modus Tolens rule is not necessary by proving p! q, ~ q - ~p without using it. (In fact, Modus Pens is enough) To use ~q in MP, we need a rule of the form ~q -> [...] Can we transform p -> q into the form ~q -> [...]? ha! We remember the earlier proof showing that p -> q is logically equivalent to its ctrapositive ~q -> ~p So the proof will look like 1. p -> q given... (logical equivalences) 7. ~q -> ~p 8. ~q given 9. ~p MP 8,7 Borgida/Rosen 2016 25 nother example proof SHOW p! q, q! r - p! r using ly other rules of inference, and equivalences re there any rules that cclude implicatis? No What rule ccludes a formula? MP. Could that help is there a given of the form...! (p! r)? No So let s eliminate! using equivalences ~p \/ q, ~q \/ r - ~p \/ r Does the left hand side ring a bell as far as premises of a rule of inference? What about resoluti? [Sort of, but we need to reorder the formulas]: q \/ ~p, ~q \/ r Then by resoluti we get ~ p \/ r Which is equivalent to p! r Yeay! Now rewrite the proof from top to bottom. Borgida/Rosen 2016 26 1. p! q given 2. ~p \/ q def of -> in 1 3. q! r given 4. ~q \/ r def of -> in 3 5. q \/ ~p by commutativity from 2 6. ~p \/ r by resoluti rule 5,4 7. p! r def of -> in 6 Proof of p! q, q! r - p! r completed Borgida/Rosen 2016 27 [Not de in lecture: Sherlock Holmes reasing (and English) nd now we come to the great questi as to the reas why. Robbery has not been the object of the murder for nothing was taken. Was it politics _then_, or was it a woman? For that is the questi that cfrted me. I was inclined from the first to the latter suppositi Political assassins are ly too glad to do their work and fly. This murder had, the ctrary, been de most deliberately, and the perpetrator had left his tracks all over the room, showing he had been there all the time. " study in scarlet".c.doyle R - it was robbery Tk - something was taken P - it was politics W - it was a woman L - assasin left immediately M - assassin made marks all over the room Claims W follows from this i R -> Tk ii ~Tk iii ~R -> P \/ W iv P -> L v M -> ~L vi M Borgida/Rosen 2016 28

Sherlock Holmes reasing in formal logic proof 1. R -> Tk : (i) 2. ~Tk : (ii) 3. ~R : ModusTolens 1,2 4. ~R -> P \/ W : (iii) 5. P \/ W : ModusPens,3,4 6. P -> L : (iv) 7. M -> L : (v) 8. M : (vi) GIVEN: 9. ~L : ModusPens 7,8 i R -> Tk 10. ~P : ModusTolens 9,6 ii ~Tk 11. W : DisjSyl 10,5 iii ~R -> P \/ W iv P -> L v M -> ~L vi M Borgida/Rosen 2016 29 The proof (( p q) (r p) ( r s) (s t)) t??? 1. p q 1 st premise 2. p Simplificati using step 1 3. r p 2 nd premise 4. r Modus tollens using steps 2 & 3 5. r s 3 rd premise 6. s Modus pens using steps 4 & 5 7. s t 4 th premise 8. t Modus pens using steps 6 & 7 But notice that we haven t proven the implicati!! In standard logical notati all we have shown is that ( p q), (r p), ( r s), (s t) - t Borgida/Rosen 2016 31 Proofs with assumptis The book leaves to an exercise e of the most important rules of inference: ->Intro: IF assuming B you can derive C THEN cclude B -> C, and discharge the assumptis We will indent subproofs, putting [ ] around assumptis. nd when we obtain the THEN part of the rule we back out of the indentati; the assumptis will be said to be discharged. In a subproof/subderivati we can use any lines appearing in a derivati above it that ctains it. (If it makes things more clear, you can repeat that line.) proof is not complete until all assumptis inside it have been discharged. Borgida/Rosen 2016 32 different proof of Hypothetical Syllogism [Remember ->Intro rule: IF assuming B you can (sub)derive C THEN cclude B -> C and discharge the assumpti and subproofs ] Prove p->q, q->r - p->r line justificati -------------------------------- 1. p->q premise 2. q->r premise 3. [p] assume (for -> intro) 4. q MP 3,1 5. r MP 4,2 6. p ->r ->Intro 3,5 (discharges assume 3, & can now forget lines 3-5 ) Borgida/Rosen 2016 33