* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Rules of inference
Mathematical proof wikipedia , lookup
History of the function concept wikipedia , lookup
Foundations of mathematics wikipedia , lookup
History of logic wikipedia , lookup
Laws of Form wikipedia , lookup
Quantum logic wikipedia , lookup
Modal logic wikipedia , lookup
Analytic–synthetic distinction wikipedia , lookup
Bayesian inference wikipedia , lookup
Intuitionistic logic wikipedia , lookup
Boolean satisfiability problem wikipedia , lookup
Interpretation (logic) wikipedia , lookup
Propositional formula wikipedia , lookup
Statistical hypothesis testing wikipedia , lookup
Abductive reasoning wikipedia , lookup
Sequent calculus wikipedia , lookup
Law of thought wikipedia , lookup
Truth-bearer wikipedia , lookup
Statistical inference wikipedia , lookup
Propositional calculus wikipedia , lookup
Fall 2008/2009 The Foundations: Logic and Proofs Rules of inference I. Arwa Linjawi & I. Asma’a Ashenkity 1 Fall 2008/2009 Introduction Proofs in mathematics are valid arguments that establish the truth of mathematical statement An argument in Propositional logic is a sequence of propositions. An argument form in Propositional logic is a sequence of compound propositions involving propositional variables. All but the final proposition in the argument are called premises and the final proposition is called the conclusion. I. Arwa Linjawi & I. Asma’a Ashenkity 2 Fall 2008/2009 Introduction Example: “If you have a current password, then you can log onto the network” p q “You have a current password” premises premises Therefore, “You can log onto the network” I. Arwa Linjawi & I. Asma’a Ashenkity conclusion 3 Fall 2008/2009 Valid argument in Propositional Logic pq p ______ q An argument is valid if the truth of all its premises implies that the conclusion is true. The hypotheses are written in a rows, followed by horizontal bar, followed by the and the conclusion. means “therefore” I. Arwa Linjawi & I. Asma’a Ashenkity 4 Fall 2008/2009 Valid argument in Propositional Logic If we have an argument with premises p1, p2, p3, …,pn and conclusion q This argument is valid when (p1 p2 p3 ………… pn) q is a tautology (p ( p q)) q p q p q p(p q) pq p F F T F T _________ F T T F T q T F F F T T T T T T The tautology (p ( p q)) q is the basis of the rule of inference called Modus Ponens (or law of detachmentmode that affirms) 5 I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Rules of Inference for propositional logic We can use a truth table to show that an argument form is valid. By showing that whenever the premises are true, the conclusion must also be true. If an argument form involves 10 different propositional variables, to use truth table, 210=1024 rows are needed. This is a tedious (long and boring) approach. Instead of using a truth table to show that an argument form is valid, we cant use Rules of inference.. I. Arwa Linjawi & I. Asma’a Ashenkity 6 Fall 2008/2009 Rules of Inference for propositional logic Modus Ponens Modus Ponens tell us that if a conditional statement and its hypothesis are both true, then the conclusion must also be true. Example: Conditional statement “If you have a current password, then you can log onto the network” Hypothesis “You have a current password” if conditional statement and hypothesis are true Then the conclusion is true “You can log onto the network” I. Arwa Linjawi & I. Asma’a Ashenkity 7 Fall 2008/2009 Rules of Inference for propositional logic Examples: “if 2 3 , then 2 2 2 3 2 2 “ Determine whether the argument is valid, and determine whether its conclusion must be true because of the validity of the argument. 3 Let p be the proposition 2 2 and q be the proposition 2 2 3 2 2 The premises of the argument are p q , p and its conclusion is q. This argument is valid (it is constructed by using Modus ponens), a valid argument form. 3 The premise 2 2 is false, therefore we can not conclude that the conclusion is true. Conclusion 2 2 3 2 2 is false. 2< 9/4 I. Arwa Linjawi & I. Asma’a Ashenkity 8 Fall 2008/2009 Inference Rule – general form Pattern establishing that if we know that a set of hypotheses all are true, then a certain related conclusion statement is true. Hypothesis 1 Hypothesis 2 ……. Hypothesis n Conclusion Each logical inference rule corresponds to an implication that is a tautology. [(Hypothesis 1) (Hypothesis 2) … (Hypothesis n)] conclusion I. Arwa Linjawi & I. Asma’a Ashenkity 9 Fall 2008/2009 Some Inference Rules Rule of inference pq p Tautology Name [ p ( p q )] q Modus ponens q q pq [q ( p q )] p Modus tollen p pq qr [( p q ) (q r )] ( p r ) Hypothetic al syllogism pr pq p (( p q ) p ) q Disjunctiv e syllogism p ( p q) Addition ( p q) p Simplifica tion (( p ) (q )) ( p q ) Conjunctio n [( p q ) (p r )] ( p r ) Resolution q p pq pq p p q pq pq p r q r I. Arwa Linjawi & I. Asma’a Ashenkity 10 Fall 2008/2009 Some Inference Rules Examples: “It is below freezing now (p). Therefore, it is either below freezing or raining now (q).” “It is below freezing (p). It is raining now (q). Therefore, it is below freezing and it is raining now. “if it rains today (p), then we will not have a barbecue today (q). if we do not have a barbecue today, then we will have a barbecue tomorrow (r) . Therefore, it is rains today, then we will have a barbecue tomorrow. “If it is snows today (p), then we will go skiing (q)”. “It is snowing today”. Therefore (or imply that) “We will go skiing” “It is below freezing (p) and raining now (q). Therefore, it is below freezing now.” 11 I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Using Rules of Inference to Build Arguments A formal proof of a conclusion C, given premises p1, p2,…,pn consists of a sequence of steps, each of which applies some inference rule to premises or to previously-proven statements (as hypotheses) to yield a new true statement (the conclusion). A proof demonstrates that if the premises are true, then the conclusion is true (i.e., valid argument). I. Arwa Linjawi & I. Asma’a Ashenkity 12 Fall 2008/2009 Using Rules of Inference to Build Arguments Example: 1. 2. 3. 4. 5. It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip then we will be home by sunset. We will be home by sunset p q r s t It is sunny this afternoon It is colder tha n yesterday We go swimming We will take a canoe trip We will be home by sunset (the conclusion ) 1. p q 2. r p 3. r s 4. s t 5. t propositions I. Arwa Linjawi & I. Asma’a Ashenkity hypotheses Fall 2008/2009 Using Rules of Inference to Build Arguments Step Step Reason Reason Reason 1. pp qq Hypothesis Hypothesis Hypothesis 2. p Simplifica Simplifica tion tion using using (1) (1) 3. r p 4. r Hypothesis Hypothesis Modus Modustollens tollens using using (2) (2)and and(3) (3) 5. r s Hypothesis 6. s Modus ponens using (4) and (5) 7. s t 8. t Hypothesis Modus ponens using (6) and (7) I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Resolution Computer programs have been developed to automate the task of reasoning and proving theorem. Many of these programs make use of rule of inference as resolution ((p q) ( p r)) (q r) and it is tautology Even if we let q=r then ((p q) ( p r)) q Or when r=F then (p q) ( p) q because q FΞq I. Arwa Linjawi & I. Asma’a Ashenkity 15 Fall 2008/2009 Resolution Example 1. Anna is skiing or it is not snowing. 2. It is snowing or Bart is playing hockey. 3. Consequently Anna is skiing or Bart is playing hockey. propositions hypotheses 1. p r 2. r q 3. p q p r rq p Anna is skiing q Bart is playing hockey r it is snowing Resolution rule pq Consequently Anna is skiing or Bart is playing hockey I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Fallacies Fallacy of affirming the conclusion Is this argument is valid? “If you do every problem in this book, then you will learn discrete mathematics (q).” “You learned discrete mathematics.” “Therefore, you did every problem in this book (p).” This argument is of the form p q and q then p. This is an example of an incorrect argument using the Fallacy of affirming the conclusion. pq and q does not imply p. The proposition [(pq) q) p] is not a tautology (its false if p is F and q is T) check the truth table You can learn discrete mathematics in some way other than doing every problem in this book (by reading- listening to lectures-doing some (but not all) the problems in this book) I. Arwa Linjawi & I. Asma’a Ashenkity 17 Fall 2008/2009 Fallacies Fallacy of denying the hypothesis Is this argument is valid? “If you do every problem in this book (p), then you will learn discrete mathematics (q)”. “You did not do every problem in this book. Therefore, You did not learn discrete mathematics.” this argument is of the form pq and p imply q . This is an example of an incorrect argument using the Fallacy of denying the hypothesis. pq and p does not imply q. The proposition [(pq) p) q] is not a tautology (its false if p is F and q is T). It is possible that you learned discrete even you did not do every problem in this book I. Arwa Linjawi & I. Asma’a Ashenkity 18 Fall 2008/2009 Fallacies A fallacy is an inference rule or other proof method that is not logically valid. It may yield a false conclusion! Fallacy of affirming the conclusion: “pq is true, and q is true, so p must be true.” (No, because FT is true.) Fallacy of denying the hypothesis: “pq is true, and p is false, so q must be false.” (No, again because FT is true.) I. Arwa Linjawi & I. Asma’a Ashenkity 19 Fall 2008/2009 Inference Rules for Quantifiers Universal instantiation x P(x) P(c) (Substitute any object c) We can conclude that P(c) is true, where c is a particular member of the domain, if we know that x P(x) is true. Example “all students have internet account” “Ahmed has internet account” Where, Ahmed is a member of the domain of all students. Universal generalization P(c) (for an arbitrary c) x P(x) I. Arwa Linjawi & I. Asma’a Ashenkity 20 Fall 2008/2009 Inference Rules for Quantifiers Existential instantiation x P(x) P(c) (Substitute for some element c ) We can conclude that there is an element c in the domain for which P(c) is true, if we know that x P(x) is true. Existential generalization P(c) (for some element c ) x P(x) I. Arwa Linjawi & I. Asma’a Ashenkity 21 Fall 2008/2009 Inference Rules for Quantifiers Example: Show that the premises “Everyone in this discrete math class has taken a course in computer science” and “Ali is a student in this class” Imply the conclusion “Ali has taken a course in computer science” D(x): “x is in discrete math class” C(x): “x has taken a course in computer science” x (D(x) C(x)) Premise #1 D(Ali) Premise #2 C(Ali) Step Reason 1 x (D(x) C(x)) Premise #1 2 D(Ali) C(Ali) Univ. instantiation 3 D(Ali) Premise #2 4 C(Ali) Modus ponens on 2,3 I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Inference Rules for Quantifiers Example: Show that the premises “A student in this class has not read the book” and “Everyone in this class passed the first exam “ Imply the conclusion “someone who passed the exam has not read the book” C(x) = “x is in this class” B(x) = “ x has read the book” P(x)= “ x passed the first exam “ I. Arwa Linjawi & I. Asma’a Ashenkity Fall 2008/2009 Inference Rules for Quantifiers x(C(x) B(x)) x(C(x) P(x)) x(P(x) B(x)) Step 1. x(C(x) B(x)) 2. C(a) B(a) 3. C(a) 4. x(C(x) P(x)) 5. C(a) P(a) 6. P(a) 7. B(a) 8. P(a) B(a) 9. x(P(x) B(x)) Premise #1 Premise #2 Reason premise 1 Existential instantiation from (1) Simplification from 2 premise 2 Universal instantiation from (4) Modus ponens from (3) and (5) Simplification from 2 conjunction from 6 and 7 Existential generalization from 8 I. Arwa Linjawi & I. Asma’a Ashenkity