Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Similar documents
2. The Logic of Compound Statements Summary. Aaron Tan August 2017

The Logic of Compound Statements cont.

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Propositional Logic. Spring Propositional Logic Spring / 32

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

PROPOSITIONAL CALCULUS

Compound Propositions

Section 1.2: Propositional Logic

Logic: Propositional Logic (Part I)

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

CSC Discrete Math I, Spring Propositional Logic

Chapter 1: The Logic of Compound Statements. January 7, 2008

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Advanced Topics in LP and FP

02 Propositional Logic

A. Propositional Logic

THE LOGIC OF COMPOUND STATEMENTS

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

It rains now. (true) The followings are not propositions.

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

cis32-ai lecture # 18 mon-3-apr-2006

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

PHIL12A Section answers, 16 February 2011

Packet #1: Logic & Proofs. Applied Discrete Mathematics

3 The Semantics of the Propositional Calculus

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

MAI0203 Lecture 7: Inference and Predicate Calculus

Language of Propositional Logic

Logic. Propositional Logic: Syntax

Logic and Proof. Aiichiro Nakano

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Logic Overview, I. and T T T T F F F T F F F F

PHI Propositional Logic Lecture 2. Truth Tables

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

2.2: Logical Equivalence: The Laws of Logic

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Propositional Logic. Fall () Propositional Logic Fall / 30

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

Propositional Logic: Part II - Syntax & Proofs 0-0

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

EECS 1028 M: Discrete Mathematics for Engineers

Learning Goals of CS245 Logic and Computation

Logic. Propositional Logic: Syntax. Wffs

Propositional Equivalence

Logic and Proofs. (A brief summary)

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

1.3 Propositional Equivalences

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Artificial Intelligence. Propositional logic

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

software design & management Gachon University Chulyun Kim

15414/614 Optional Lecture 1: Propositional Logic

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

Supplementary Logic Notes CSE 321 Winter 2009

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Logic, Sets, and Proofs

Truth-Functional Logic

Propositional natural deduction

Math 3336: Discrete Mathematics Practice Problems for Exam I

Artificial Intelligence Knowledge Representation I

Propositional Logic: Syntax

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

03 Propositional Logic II

First Order Logic: Syntax and Semantics

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Valid Reasoning. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February, Outline Truth and Validity Valid Reasoning

Propositional Logic: Review

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

First-Degree Entailment

Propositional Logic Language

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Chapter 1 Elementary Logic

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Chapter 4: Classical Propositional Semantics

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

Introduction to Sets and Logic (MATH 1190)

Propositional Logic Not Enough

Propositional Logics and their Algebraic Equivalents

First Order Logic (1A) Young W. Lim 11/18/13

Logical forms and substitution instances. Philosophy and Logic Unit 2, Section 2.1

Part I: Propositional Calculus

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Logic and Proofs. (A brief summary)

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Transcription:

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