CS243: Discrete Structures First Order Logic, Rules of Inference 1/41 I¸Sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 2/41

CS243: Discrete Structures First Order Logic, Rules of Inference 1/41 I¸Sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 2/41

Announcements CS243: Discrete Structures First Order Logic, I Homework 1 is due now Rules of Inference I Homework 2 is handed out today I¸sıl Dillig I Homework 2 is due next Tuesday I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 1/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 2/41 Review of Last Lecture Translating English into First-Order Logic I Building blocks in FOL: constants, variables, predicates Given predicates student(x), atWM (x), and friends(x, y), how do I Formulas formed using predicates, connectives, and quantifiers we express the following in first-order logic? I Truth value of FOL formulas depend on universe of discourse I ”Every William&Mary student has a friend” and interpretation of predicates and variables I ”At least one W&M student has no friends” I Universal quantification x.P(x) is true if P is true for all ∀ objects in universe of discourse I ”All W&M students are friends with each other” I Existential quantification x.P(x) is true if there exists an ∃ object for which P is true I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 3/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 4/41 Satisfiability, Validity in FOL Equivalence I The concepts of satisfiability, validity also important in FOL I Two formulas F and F are equivalent if F F is valid 1 2 1 ↔ 2 I An FOL formula F is satisfiable if there exists some domain I In PL, we could prove equivalence using truth tables, but not and some interpretation such that F evaluates to true possible in FOL I Example: Prove that x.P(x) Q(x) is satisfiable. ∀ → I However, we can still use known equivalences to rewrite one formula as the other I An FOL formula F is valid if, for all domains and all interpretations, F evaluates to true I Example: Prove that ( x. (P(x) Q(x))) and ¬ ∀ → x. (P(x) Q(x)) are equivalent. I Prove that x.P(x) Q(x) is not valid. ∃ ∧ ¬ ∀ → I Example: Prove that x. y.P(x, y) and x. y. P(x, y) are I Formulas that are satisfiable, but not valid are contingent, ¬∃ ∀ ∀ ∃ ¬ equivalent. e.g., x.P(x) Q(x) ∀ → I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 5/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 6/41 1 Motivation for Proof Rules Rules of Inference I Proof rules are written as rules of inference: Hypothesis1 I Learned how to express various facts in logic, but this is not Hypothesis2 all that useful on its own ... Conclusion I The reason logic is useful: allows formalizing arguments, constructing validity proofs, and make inferences I An example inference rule: I Rest of lecture: learn about proof rules for logic All men are mortal Socrates is a man I By applying proof rules, can make logical inferences that are ∴ Socrates is mortal correct by construction I Valid inference rule, but too specific I We’ll learn about more general inference rules that will allow constructing formal proofs I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 7/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 8/41 Modus Ponens Example Uses of Modus Ponens I Most basic inference rule is modus ponens: I Application of modus ponens in propositional logic: φ1 p q ∧ φ1 φ2 (p q) r → ∧ → φ2 I Application of modus ponens in first-order logic: I This rule is valid because we know φ1 is true, and by definition of implication, if φ is true, then φ must be true 1 2 P(a) P(a) Q(b) I Modus ponens applicable to both propositional logic and → first-order logic I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 9/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 10/41 Modus Tollens Example Uses of Modus Tollens I Second imporant inference rule is modus tollens: I Application of modus tollens in propositional logic: φ φ p (q r) 1 → 2 → ∨ φ (q r) ¬ 2 ¬ ∨ φ ¬ 1 I Recall: φ φ and its contrapositive φ φ are I Application of modus tollens in first-order logic: 1 → 2 ¬ 2 → ¬ 1 equivalent to each other Q(a) P(a) Q(a) I Therefore, correctness of this rule follows from modus ponens ¬ → ¬ and equivalence of a formula and its contrapositive. I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 11/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 12/41 2 Hypothetical Syllogism (HS) Or Introduction φ φ φ 1 1 → 2 φ φ φ1 φ2 2 → 3 ∨ φ1 φ3 → I Correctness follows from definition of ∨ I Basically says ”implication is transitive” I φ φ is true if either φ or φ is true. 1 ∨ 2 1 2 I Example: I Example application: ”Socrates is a man. Therefore, either P(a) Q(b) Socrates is a man or there are red elephants on the moon.” → Q(b) R(c) → I The book calls this rule addition – feel free to use whichever term is more natural for you I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 13/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 14/41 Or Elimination And Introduction φ1 φ2 ∨ φ1 φ2 ¬ φ2 φ 1 φ φ 1 ∧ 2 I Either φ1 or φ2 is true. We know φ2 is false. Therefore, φ1 I This rule just follows from definition of conjunction must be true. I Example application: ”It is Tuesday. It’s the afternoon. I Example application: ”It is either a dog or a cat. It is not a Therefore, it’s Tuesday afternoon”. dog. Therefore, it must be a cat.” I The book calls this rule conjunction; I call it And Intro – use I The book calls this rule disjunctive syllogism; I call it Or whichever you prefer Elimination – use whichever you prefer I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 15/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 16/41 And Elimination Resolution I Final inference rule: resolution φ φ φ1 φ2 1 2 ∨ ∧ φ φ φ1 ¬ 1 ∨ 3 φ φ 2 ∨ 3 I This rule also just follows from definition of conjunction I To see why this is correct, observe φ1 is either true or false. I Example application: ”It is Tuesday afternoon. Therefore, it is Tuesday”. I Suppose φ1 is true. Then, φ1 is false. Therefore, by second ¬ hypothesis, φ3 must be true. I The book calls this rule simplification; I call it And Elimination – use whichever you prefer I Suppose φ1 is false. Then, by 1st hypothesis, φ2 must be true. I In any case, either φ or φ must be true; φ φ 2 3 ∴ 2 ∨ 3 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 17/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 18/41 3 Resolution Example Summary Name Rule of Inference φ1 φ1 φ2 Modus ponens → φ2 φ1 φ2 → φ2 I Example 1: Modus tollens ¬ φ1 ¬ P(a) Q(b) φ1 φ2 → ∨ ¬ φ2 φ3 Q(b) R(c) Hypothetical syllogism → ∨ φ1 φ3 → φ1 Or introduction φ1 φ2 ∨ I φ1 φ2 Example 2: ∨ φ2 p q Or elimination ¬ ∨ φ1 p ¬ φ1 φ2 And introduction φ1 φ2 ∧ φ1 φ2 And elimination ∧ φ1 φ1 φ2 ∨ φ1 φ3 Resolution ¬ ∨ φ2 φ3 ∨ I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 19/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 20/41 Using the Rules of Inference Encoding in Logic Assume the following hypotheses: I First, encode hypotheses and conclusion as logical formulas. 1. It is not sunny today and it is colder than yesterday. I To do this, identify propositions used in the argument: I s = ”It is sunny today” 2. We will go to the lake only if it is sunny. I c= ”It is colder than yesterday” 3. If we do not go to the lake, then we will go hiking. I l = ”We’ll go to the lake” 4. If we go hiking, then we will be back by sunset. I h = ”We’ll go hiking” Show these lead to the conclusion: ”We will be back by sunset.” I b= ”We’ll be back by sunset” I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 21/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 22/41 Encoding in Logic, cont. Formal Proof Using Inference Rules I ”It’s not sunny today and colder than yesterday.” 1. s c Hypothesis I ”We will go to the lake only if it is sunny” ¬ ∧ 2. l s Hypothesis → 3. l h Hypothesis I ”If we do not go to the lake, then we will go hiking.” ¬ → 4. h b Hypothesis → I ”If we go hiking, then we will be back by sunset.” I Conclusion: ”We’ll be back by sunset” I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 23/41 I¸sıl Dillig, CS243: Discrete Structures First Order Logic, Rules of Inference 24/41 4 Another Example Encoding in Logic Assume the following hypotheses: I First, encode hypotheses and conclusion as logical formulas. 1. It is not raining or Kate has her umbrella I To do this, identify propositions used in the argument: 2.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us