Propositional Logic Jason Filippou CMSC250 @ UMCP 05-31-2016 ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 1 / 38
Outline 1 Syntax 2 Semantics Truth Tables Simplifying expressions 3 Inference Valid reasoning Basic rules of inference ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 2 / 38
Propositional Logic: Overview Propositional logic is the most basic kind of Logic we will examine, and arguably the most basic kind of Logic there is. It uses symbols that evaluate to either True or False, combinations of those symbols (which we call compound statements), as well as a set of equivalences and inference rules. Its simplicity allows it to be implemented in computer hardware! ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 3 / 38
Propositional Logic: Overview We will study Propositional (and Predicate logic) in three (unbalanced) steps: Syntax. Semantics. Inference (or Proof theory ). ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 4 / 38
Syntax Syntax ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 5 / 38
Syntax Syntax Syntax in Propositional Logic is very easy to grasp. Components: The (self-explanatory) constant symbols T rue and F alse. A pre-defined vocabulary of propositional symbols which we usually denote P. Those map to either T rue or F alse. Often-used symbols: p, q, r... The negation operator, applied on propositional symbols in P. Examples: p ( not p), p ( not not p ). The binary operators of conjunction ( ) and disjunction ( ). Examples: p q, p q, q q. The left and right parentheses ((,)), used to group terms for prioritization of execution or readability. Examples: (p), (((((... (p)... ))))), (p q) z, p (q z). The binary connectives of implication ( if-then ) ( ), bi-conditional ( if and only if, commonly abbrv. iff)( ) and logical equivalence:. Examples: p r, p (q r), p p p, (p q) (p q) p. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 6 / 38
Syntax Recap Syntax for Propositional Logic consists of: {T rue, F alse, P,,,, (, ),,, }. So what do all of these symbols mean? ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 7 / 38
Semantics Semantics ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 8 / 38
Semantics Constants / Propositional Symbols True and False should be self-explanatory, intuitive symbols. Without agreement on what they mean, we can go no further. Think about them like the notions of a point and a line in Euclidean Geometry. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 9 / 38
Semantics Propositional Symbols and Interpretation Think of a Propositional Symbol like a binary variable with domain True, False. Anything that can be either true or false in our world can be modelled by such a symbol. E.g the symbol rain is True if it s raining today, False otherwise. Probabilities? ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 10 / 38
Semantics Truth Tables Truth Tables ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 11 / 38
Semantics Truth Tables Negation Operator Beginning from the definitions of our truth assignments for constants and propositional symbols, we can assign truth to every compound statement we can build with our syntax. Basic instrument for doing this: Truth Tables. E.g negation operator truth table: p False True p True False ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 12 / 38
Semantics Truth Tables Conjunction / Disjunction What would the truth table for conjunction and disjunction be? ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 13 / 38
Semantics Truth Tables Conjunction / Disjunction What would the truth table for conjunction and disjunction be? p q p q p q F F F F F T F T T F F T T T T T ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 13 / 38
Semantics Truth Tables Binary connectives Implication: ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38
Semantics Truth Tables Binary connectives Implication: p q p q F F T F T T T F F T T T ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38
Semantics Truth Tables Binary connectives Implication: Bi-conditional: p q p q F F T F T T T F F T T T ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38
Semantics Truth Tables Binary connectives Implication: Bi-conditional: p q p q F F T F T T T F F T T T p q p q F F T F T F T F F T T T ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38
Semantics Truth Tables Natural language examples Let s convert the following natural language statements to propositional logic: 1 It s rainy and gloomy. 2 I will pass 250 if I study. 3 I will pass 250 only if I study. 4 THOU SHALT NOT PASS. 5 All work and no play makes Jack a dull boy. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 15 / 38
Semantics Simplifying expressions Simplifying expressions ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 16 / 38
Semantics Simplifying expressions Take 3 Do the truth tables for (p q) and p q. What do you observe? ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 17 / 38
Semantics Simplifying expressions De Morgan s Laws For every p, q P, we have: (p q) p q (p q) p q Fundamental result first observed by Augustus De Morgan. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 18 / 38
Semantics Simplifying expressions Other logical Equivalences Convince yourselves about the following: p q p q p q q p (contrapositive) ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 19 / 38
Semantics Simplifying expressions Tautologies / Contradictions Tautology: A logical statement that is always True, regardless of the truth values of the variables in it. Common notation (also used in Epp): t. E.g: p p, p T Contradiction: A logical statement that is always False, regardless of the truth values of the variables in it. Common notation (also used in Epp): c. E.g: p p, p F ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 20 / 38
Semantics Simplifying expressions Logical Equivalence cheat sheet For (possibly compound) statements p, q, r, tautological statement t and contradicting statement c: Commutativity p q q p p q q p Associativity of binary operators (p q) r p (q r) (p q) r p (q r) Distributivity of binary operators p (q r) (p q) (p r) p (q r) (p q) (p r) Identity laws p t p p c p Negation laws p p t p p c Double negation ( p) p Idempotence p p p p p p De Morgan s axioms (p q) p q (p q) p q Universal bound laws p t t p c c Absorption laws p (p q) p p (p q) p Negations of contradictions / tautologies c t t c Those will be posted on our website as a reference. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 21 / 38
Semantics Simplifying expressions Practice Using the equivalences we just established, simplify the following expressions: p ( p q) ( ( (z q))) (p r) ((p s) (p a)) ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 22 / 38
Inference Inference ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 23 / 38
Inference Valid reasoning Valid reasoning ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 24 / 38
Inference Valid reasoning The role of inference We ve looked at syntax, or the vocabulary of propositional logic. Semantics helped us combine the members of the vocabulary into sentences (compound statements) and the notion of equivalence helped us find equivalent statements, as well as simplify unnecessarily long sentences. We haven t talked about constructing new knowledge! That s where inference, (or proof theory in the context of logic) comes to play. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 25 / 38
Inference Valid reasoning Valid reasoning All reasoning has to be valid. Intuitively: the knowledge we infer has to obey the constraints of the world defined by the stuff we already know. Formal definition later. Examples: All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All men are mortal. Socrates is mortal. Therefore, Socrates is a man. All men are mortal. Socrates is not mortal. Therefore, Socrates is not a man. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 26 / 38
Inference Valid reasoning Complete reasoning The notion of complete reasoning is one that we won t examine much, if at all, in 250. Intuitively, if we have a rule (or a set of rules) that can produce all of the knowledge that logically follows from the stuff that we already know, we have a complete reasoning system. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 27 / 38
Inference Valid reasoning Premises and conclusions All reasoning systems consist of rules. All rules consist of premises and conclusions. We will write rules in the following manner: P remise 1 P remise 2... P remise n Conclusion Some authors prefer the form: P remise 1, P remise 2,..., P remise n Conclusion ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 28 / 38
Inference Valid reasoning Definition of validity Split rule to premises and conclusions Critical rows: The rows of a truth table where all premises are True. The rule is valid if the conclusion is also True for all critical rows. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 29 / 38
Inference Valid reasoning Definition of validity Premise 1 Premise 2 Valid rule Premise n Figure 1: A pictorial representation of valid reasoning. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 30 / 38
Inference Basic rules of inference Basic rules of inference ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 31 / 38
Inference Basic rules of inference Modus Ponens The cornerstone of deductive reasoning. Modus Ponens p p q q ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38
Inference Basic rules of inference Modus Ponens The cornerstone of deductive reasoning. Modus Ponens p p q q Theorem (Validity of Modus Ponens) Modus Ponens is a valid rule of reasoning. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38
Inference Basic rules of inference Modus Ponens The cornerstone of deductive reasoning. Modus Ponens p p q q Theorem (Validity of Modus Ponens) Modus Ponens is a valid rule of reasoning. Proof. p q p q F F T F T T T F F T T T ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38
Inference Basic rules of inference Modus Tollens Modus Tollens p q q p ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 33 / 38
Inference Basic rules of inference Modus Tollens Modus Tollens p q q p Proof? ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 33 / 38
Inference Basic rules of inference Other valid rules of inference The following are mentioned on Epp (but there exist many more). Disjunctive addition p p q Conjunctive simplification p q p, q Disjunctive syllogism p q q p Hypothetical syllogism p q q r p r Prove their validity as an exercise! ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 34 / 38
Inference Basic rules of inference Valid inference rules cheat sheet Modus Ponens Modus Tollens p q p q q Conjunctive Simplification p q p, q p q p Disjunctive syllogism p q p q Disjunctive addition p p q Hypothetical Syllogism p q q r p r Conjunctive addition p, q p q Note that disjunctive syllogism is symmetric, i.e if q is the premise, p is the conclusion. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 35 / 38
Inference Basic rules of inference Take 5 Are the following inference rules valid? Rule 1 Rule 2 Rule 3 p q p q p q p r q p q r p q r ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 36 / 38
Inference Basic rules of inference Take 5 Are the following inference rules valid? Rule 1 Rule 2 Rule 3 p q p q p q p r q p q r p q r YES: Division Into Cases NO: Converse Error NO: Inverse Error ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 36 / 38
Inference Basic rules of inference Difference with language Background knowledge oftentimes blurs the distinction between valid and invalid arguments. Consider the following arguments: If my pet ostrich could do 100 meters in under 10 seconds, it could participate in the Olympics. My pet ostrich can do 100 meters in under 10 seconds. My pet ostrich can participate in the Olympics. If these tracks are Bigfoot s, Bigfoot exists. Bigfoot exists. These tracks are Bigfoot s. ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 37 / 38
Inference Basic rules of inference Proof by contradiction A very popular proof methodology, which we will be using a lot, is proof by contradiction. Intuitively, we want to prove something, so we assume that it doesn t hold (i.e its converse holds), and we arrive at a contradiction. Formally, the following rule is sound: Proof by contradiction p c p Very important to convince yourselves that the rule is sound! ason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 38 / 38