Mathematical Structures for Computer Science Chapter 1.2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Mathematical Reasoning Methods of Proof.
Introduction to Theorem Proving
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Logic Concepts Lecture Module 11.
CS128 – Discrete Mathematics for Computer Science
Logic 3 Tautological Implications and Tautological Equivalences
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
From Chapter 4 Formal Specification using Z David Lightfoot
TR1413: Discrete Mathematics For Computer Science Lecture 4: System L.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Discrete Mathematics and its Applications
Adapted from Discrete Math
Formal Logic.
Chapter 3 Section 4 – Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Copyright © Curt Hill Rules of Inference What is a valid argument?
Propositional Proofs 2.
Deduction, Proofs, and Inference Rules. Let’s Review What we Know Take a look at your handout and see if you have any questions You should know how to.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Discrete Structures (DS)
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Chapter Four Proofs. 1. Argument Forms An argument form is a group of sentence forms such that all of its substitution instances are arguments.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Ch 1.4: Basic Proof Methods I A theorem is a proposition, often of special interest. A proof is a logically valid deduction of a theorem, using axioms,
CS6133 Software Specification and Verification
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
What is Reasoning  Logical reasoning is the process of drawing conclusions from premises using rules of inference.  These inference rules are results.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
CS104:Discrete Structures Chapter 2: Proof Techniques.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Outline Logic Propositional Logic Well formed formula Truth table
1 Introduction to Abstract Mathematics Proof Methods , , ~, ,  Instructor: Hayk Melikya Purpose of Section:Most theorems in mathematics.
Today’s Topics Argument forms and rules (review)
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
1 Propositional Proofs 1. Problem 2 Deduction In deduction, the conclusion is true whenever the premises are true.  Premise: p Conclusion: (p ∨ q) 
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
Chapter 1 Logic and proofs
L = # of lines n = # of different simple propositions L = 2 n EXAMPLE: consider the statement, (A ⋅ B) ⊃ C A, B, C are three simple statements 2 3 L =
Lecture 1-2: Propositional Logic. Propositional Logic Deriving a logical conclusion by combining many propositions and using formal logic: hence, determining.
March 23 rd. Four Additional Rules of Inference  Constructive Dilemma (CD): (p  q) (r  s) p v r q v s.
2. The Logic of Compound Statements Summary
Lecture 1 – Formal Logic.
Discrete Mathematics Logic.
Formal Logic CSC 333.
COMP 1380 Discrete Structures I Thompson Rivers University
August 31, 2005.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Information Technology Department
7.1 Rules of Implication I Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.
CS201: Data Structures and Discrete Mathematics I
Mathematical Structures for Computer Science Chapter 1
CS 220: Discrete Structures and their Applications
Back to “Serious” Topics…
The Method of Deduction
Discrete Mathematics Logic.
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
Logical and Rule-Based Reasoning Part I
CS201: Data Structures and Discrete Mathematics I
Chapter 8 Natural Deduction
Presentation transcript:

Mathematical Structures for Computer Science Chapter 1.2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic

 Propositions or statements are sentences that are either true or false.  In logic, propositions are represented by the letters A, B, C, …  Propositions can be combined into more complicated expressions known as well- formed formulas, or wffs. ◦ The connectives: and (  ), or (  ), implies (  ), and negation ()  Wffs are represented by the letters P, Q, R, … Section 1.2 Propositional Logic1

o A system for determining whether or not a particular logical argument is valid, using rules of inference (also known as propositional calculus.) o Definition of Argument: o A sequence of statements in which the conjunction of the initial statements (called the premises, or hypotheses) is said to imply the final statement (called the conclusion). o Presented symbolically as (P 1 Λ P 2 Λ... Λ P n )  Q where P 1, P 2,..., P n represent the hypotheses and Q represents the conclusion. Section 1.2 Propositional Logic2

 What is a valid argument? When does Q logically follow from P 1, P 2,..., P n ?  Informal answer: When the truth of the hypotheses guarantees the truth of the conclusion.  Note: We need to be sure the hypotheses are related to the conclusion; not just any knowledge we might have about the conclusion Q.  Example: ◦ P 1 : Neil Armstrong was the first human to step on the moon. ◦ P 2 : Mars is a red planet And the conclusion ◦ Q: No human has ever been to Mars. ◦ P 1, P 2, and Q are all true, but Q isn’t a logical consequence Section 1.2 Propositional Logic3

Definition of valid argument:  In a formal logical system an argument is valid if, whenever the hypotheses are all true, the conclusion must also be true. i.e. (P 1 Λ P 2 Λ... Λ P n )  Q is a tautology. ◦ You must be able to logically deduce Q from the hypotheses  How to arrive at a valid argument? ◦ Using a proof sequence Section 1.2 Propositional Logic4

Definition of Proof Sequence:  A proof sequence is a sequence of wffs in which each wff is either a hypothesis or the result of applying one of the formal system’s derivation rules to earlier wffs in the sequence.  Derivation rules allow you to rewrite a hypothesis in a more useful form, based on the equivalence relations from section one, or to derive new wffs from the old ones. Section 1.2 Propositional Logic5

 Derivation rules for propositional logic Section 1.2 Propositional Logic6 Equivalence RulesInference Rules Allows individual wffs to be rewritten Allows new wffs to be derived Truth preserving rulesWork only in one direction

 Certain pairs of wffs are equivalent, hence one can be substituted for the other with no change to truth values.  The set of equivalence rules are summarized here: Let R and S be statement variables Section 1.2 Propositional Logic7 ExpressionEquivalent toAbbreviation for rule P V Q P Λ Q Q V P Q Λ P Commutative (comm) (P V Q) V R (P Λ Q) Λ R P V (Q V R) P Λ (Q Λ R) Associative (assoc) (P V Q) (P Λ Q) P Λ Q P V Q De Morgan’s Laws P  QP V Q Implication (imp) P (P) Double Negation (dn) PQPQ(P  Q) Λ (Q  P) Equivalence (equ)

 Inference rules allow us to add a new wffs to aproof sequence. If one or more wffs match an existing part of the proof sequence (this is the “from” part) you can deduce the second part and add to the proof.  Note: Inference rules do not work in both directions, unlike equivalence rules. ◦ E.g., if you know R V S you can’t deduce R (or S). Section 1.2 Propositional Logic8 FromCan DeriveAbbreviation for rule R, R  S SModus Ponens- mp R  S, SR Modus Tollens- mt R, SR Λ SConjunction-con R Λ SR, SSimplification- sim RR V SAddition- add

 Example for using Equivalence rule in a proof sequence: ◦ Simplify (A V B) V C 1. (A V B) V C 2. (A Λ B) V C1, De Morgan 3. (A Λ B)  C2, imp  Example of using Inference Rule ◦ If it is bright and sunny today, then I will wear my sunglasses. Modus Ponens ( given P, P  S, conclude S) It is bright and sunny today. Therefore, I will wear my sunglasses. Modus Tollens(given P  S, S, conclude P) I will not wear my sunglasses. Therefore, it is not bright and sunny today. Section 1.2 Propositional Logic9

 Prove the argument A Λ (B  C) Λ [(A Λ B)  (D V C)] Λ B  D ◦ First, write down all the hypotheses. 1. A 2. B  C 3. (A Λ B)  (D V C) 4. B Use the inference and equivalence rules to get at the conclusion D. 5. C2,4, mp 6. A Λ B1,4, con 7. D V C 3,6, mp 8. C V D7, comm 9. C  D8, imp and finally 10. D5,9 imp The idea is to keep focused on the result and sometimes it is very easy to go down a longer path than necessary. Section 1.2 Propositional Logic10

 Used to prove an argument of the form P 1 Λ P 2 Λ... Λ P n  R  Q  Deduction method allows for the use of R as an additional hypothesis and thus prove P 1 Λ P 2 Λ... Λ P n Λ R  Q  Suppose you want to prove [(A  B) Λ (B  C)]  (A  C) Section 1.2 Propositional Logic11

 Prove [(A  B) Λ (B  C)]  (A  C) Using deduction method, prove (A  B) Λ (B  C) Λ A  C 1. A  Bhyp 2. B  Chyp 3. Ahyp 4. B1,3 mp 5. C2,4 mp  The above is called the rule of Hypothetical Syllogism or hs for short.  Many such other rules can be derived from existing rules which thus provide easier and faster proofs. Section 1.2 Propositional Logic12

 These rules can be derived using the previous rules. They provide a faster way of proving arguments. Section 1.2 Propositional Logic13 FromCan DeriveName / Abbreviation P  Q, Q  RP  R Hypothetical syllogism- hs P V Q, PQDisjunctive syllogism- ds P  QQ  P Contraposition- cont Q  PP  Q Contraposition- cont

 Additional inference rules yield shorter proofs, but more rules to remember. Section 1.2 Propositional Logic14 FromCan DeriveName / Abbreviation PP Λ PSelf-reference – self P V PPSelf-reference – self (P Λ Q)  RP  (Q  R) Exportation – exp P, PQInconsistency – inc P Λ (Q V R)(P Λ Q) V (P Λ R)Distributive - dist P V (Q Λ R)(P V Q) Λ (P V R)Distributive - dist

 Prove that (P  Q)  (Q  P) is a valid argument (called Contraposition – con). ◦ Hence prove, (P  Q) Λ Q  P (using deduction method). ◦ The above is true using the modus tollens inference rule.  Prove P Λ P  Q (called Inconsistency) 1. P hyp 2. P hyp 3. P V Q1, add 4. Q V P3, comm 5. (Q) V P4, dn 6. Q  P5, imp: (A V B)  (A  B) 7. (Q)2, 6, mt: from ( P  S, S ) get P 8. Q7, dn Section 1.2 Propositional Logic15

 (A Λ B) Λ (C Λ A) Λ (C Λ B)  A is an argument 1. (A Λ B)hyp 2. (C Λ A)hyp 3. (C Λ B)hyp 4. A V B1, De Morgan 5. B V A4, comm 6. B  A5, imp 7. (C) V A2, De Morgan 8. C  A7, imp 9. C V (B)3, De Morgan 10. (B) V C 9, comm 11. B  C10, imp 12. B  A8, 11, hs 13. (B  A) Λ (B  A)6, 12, con Section 1.2 Propositional Logic16

 At this point, we have now to prove that (B  A) Λ (B  A)  A  Proof sequence 1. B  Ahyp 2. B  Ahyp 3. A  B1, cont 4. A  A3, 2, hs 5. A V A4, imp 6. A6, self Section 1.2 Propositional Logic17

 To convert a verbal argument to a symbolic form so it can be tested for validity:  “Symbolize” the argument using propositional wff’s  Use the derivation rules for propositional logic to prove the argument is valid  Example: “If interest rates drop, the housing market will improve. Either the federal discount rate will drop or the housing market will not improve. Interest rates will drop. Therefore the federal discount rate will drop.”  Let I representInterest rates drop HrepresentThe housing market will improve F representThe federal discount rate will drop Then (I  H)  (F  H)  I  F Section 1.2 Propositional Logic18

 A proof sequence for (I  H)  (F  H)  I  F 1. I  Hhyp 2. F  Hhyp 3. Ihyp 4. H  F2, comm 5. H  F4, imp 6. I  F1, 5, hs 7. F5, 3, mp Section 1.2 Propositional Logic19

 Russia was a superior power, and either France was not strong or Napoleon made an error. Napoleon did not make an error, but if the army did not fail, then France was strong. Hence the army failed and Russia was a superior power.  Converting it to a propositional form using letters A, B, C and D A: Russia was a superior power B: France was strong B: France was not strong C: Napoleon made an errorC: Napoleon did not make an error D: The army failedD: The army did not fail  Combining, the statements using logic (A Λ (B V C)) hypothesis C hypothesis (D  B) hypothesis (D Λ A)conclusion  Combining them, the propositional form is (A Λ (B V C)) Λ C Λ (D  B)  (D Λ A) Section 1.2 Propositional Logic20

 Prove (A Λ (B V C)) Λ C Λ (D  B)  (D Λ A)  Proof sequence 1. A Λ (B V C)hyp 2. Chyp 3. D  Bhyp 4. A1, sim 5. B V C1, sim 6. C V B 5, comm 7. B2, 6, ds 8. B  (D) 3, cont 9. (D) 7, 8, mp 10. D9, dn 11. D Λ A4, 10, con Section 1.2 Propositional Logic21

 Prove the following arguments ◦ (A´  B´) Λ (A  C)  (B  C) ◦ (Y  Z´) Λ (X´  Y) Λ [Y  (X  W)] Λ (Y  Z)  (Y  W)  If the program is efficient, it executes quickly. Either the program is efficient, or it has a bug. However, the program does not execute quickly. Therefore it has a bug. (use letters E, Q, B)  The crop is good, but there is not enough water. If there is a lot of rain or not a lot of sun, then there is enough water. Therefore the crop is good and there is a lot of sun. (use letters C, W, R, S) Section 1.2 Propositional Logic22

 Write down the propositional form of the following argument:  If my client is guilty, then the knife was in the drawer. Either the knife was not in the drawer or Jason Pritchard saw the knife. If the knife was not there on October 10, it follows that Jason Pritchard didn’t see the knife. Furthermore, if the knife was there on October 10, then the knife was in the drawer and also the hammer was in the barn. But we all know that the hammer was not in the barn. Therefore, ladies and gentlemen of the jury, my client is innocent. Section 1.2 Propositional Logic23