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