Propositional Logic Jason Filippou CMSC250 @ UMCP 05-31-2016 - - PowerPoint PPT Presentation

propositional logic
SMART_READER_LITE
LIVE PREVIEW

Propositional Logic Jason Filippou CMSC250 @ UMCP 05-31-2016 - - PowerPoint PPT Presentation

Propositional Logic Jason Filippou CMSC250 @ UMCP 05-31-2016 Jason 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


slide-1
SLIDE 1

Propositional Logic

Jason Filippou

CMSC250 @ UMCP

05-31-2016

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 1 / 38

slide-2
SLIDE 2

Outline

1 Syntax 2 Semantics

Truth Tables Simplifying expressions

3 Inference

Valid reasoning Basic rules of inference

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 2 / 38

slide-3
SLIDE 3

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!

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 3 / 38

slide-4
SLIDE 4

Propositional Logic: Overview

We will study Propositional (and “Predicate” logic) in three (unbalanced) steps:

Syntax. Semantics. Inference (or “Proof theory”).

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 4 / 38

slide-5
SLIDE 5

Syntax

Syntax

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 5 / 38

slide-6
SLIDE 6

Syntax

Syntax

Syntax in Propositional Logic is very easy to grasp. Components:

The (self-explanatory) constant symbols True and False. A pre-defined vocabulary of propositional symbols which we usually denote P. Those “map” to either True or False.

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 6 / 38

slide-7
SLIDE 7

Syntax

Recap

Syntax for Propositional Logic consists of: {True, False, P, ∼, ∧, ∨, (, ), ⇒, ⇔, ≡}. So what do all of these symbols mean?

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 7 / 38

slide-8
SLIDE 8

Semantics

Semantics

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 8 / 38

slide-9
SLIDE 9

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 9 / 38

slide-10
SLIDE 10

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?

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 10 / 38

slide-11
SLIDE 11

Semantics Truth Tables

Truth Tables

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 11 / 38

slide-12
SLIDE 12

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

∼p

False True True False

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 12 / 38

slide-13
SLIDE 13

Semantics Truth Tables

Conjunction / Disjunction

What would the truth table for conjunction and disjunction be?

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 13 / 38

slide-14
SLIDE 14

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

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 13 / 38

slide-15
SLIDE 15

Semantics Truth Tables

Binary connectives

Implication:

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38

slide-16
SLIDE 16

Semantics Truth Tables

Binary connectives

Implication: p q p ⇒ q F F T F T T T F F T T T

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38

slide-17
SLIDE 17

Semantics Truth Tables

Binary connectives

Implication: p q p ⇒ q F F T F T T T F F T T T Bi-conditional:

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38

slide-18
SLIDE 18

Semantics Truth Tables

Binary connectives

Implication: p q p ⇒ q F F T F T T T F F T T T Bi-conditional: p q p ⇔ q F F T F T F T F F T T T

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 14 / 38

slide-19
SLIDE 19

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. Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 15 / 38

slide-20
SLIDE 20

Semantics Simplifying expressions

Simplifying expressions

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 16 / 38

slide-21
SLIDE 21

Semantics Simplifying expressions

Take 3

Do the truth tables for ∼(p ∧ q) and ∼p ∨ ∼q. What do you observe?

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 17 / 38

slide-22
SLIDE 22

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 18 / 38

slide-23
SLIDE 23

Semantics Simplifying expressions

Other logical Equivalences

Convince yourselves about the following:

∼p ∨ q ≡ p ⇒ q

p ⇒ q ≡ ∼q ⇒ ∼p (contrapositive)

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 19 / 38

slide-24
SLIDE 24

Semantics Simplifying expressions

Tautologies / Contradictions

Tautology: A logical statement that is always True , regardless

  • f 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

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 20 / 38

slide-25
SLIDE 25

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 op- erators (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Distributivity of binary op- erators 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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 21 / 38

slide-26
SLIDE 26

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))

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 22 / 38

slide-27
SLIDE 27

Inference

Inference

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 23 / 38

slide-28
SLIDE 28

Inference Valid reasoning

Valid reasoning

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 24 / 38

slide-29
SLIDE 29

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 25 / 38

slide-30
SLIDE 30

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 26 / 38

slide-31
SLIDE 31

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

  • f the knowledge that logically follows from the stuff that we

already know, we have a complete reasoning system.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 27 / 38

slide-32
SLIDE 32

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: Premise 1 Premise 2 . . . Premise n ∴ Conclusion Some authors prefer the form: Premise 1, Premise 2, . . . , Premise n Conclusion

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 28 / 38

slide-33
SLIDE 33

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 29 / 38

slide-34
SLIDE 34

Inference Valid reasoning

Definition of validity

Valid rule Premise 1 Premise 2 Premise n

Figure 1: A pictorial representation of valid reasoning.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 30 / 38

slide-35
SLIDE 35

Inference Basic rules of inference

Basic rules of inference

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 31 / 38

slide-36
SLIDE 36

Inference Basic rules of inference

Modus Ponens

The cornerstone of deductive reasoning. Modus Ponens p p ⇒ q ∴ q

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38

slide-37
SLIDE 37

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.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38

slide-38
SLIDE 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

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 32 / 38

slide-39
SLIDE 39

Inference Basic rules of inference

Modus Tollens

Modus Tollens p ⇒ q

∼q

∼p

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 33 / 38

slide-40
SLIDE 40

Inference Basic rules of inference

Modus Tollens

Modus Tollens p ⇒ q

∼q

∼p

Proof?

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 33 / 38

slide-41
SLIDE 41

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!

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 34 / 38

slide-42
SLIDE 42

Inference Basic rules of inference

Valid inference rules cheat sheet

Modus Ponens Modus Tol- lens Disjunctive addition Conjunctive addition p p ⇒ q ∴ q

∼q

p ⇒ q ∴ ∼p p ∴ p ∨ q p, q ∴ p ∧ q Conjunctive Simplification Disjunctive syllogism Hypothetical Syllogism p ∧ q ∴ p, q p ∨ q

∼p

∴ q p ⇒ q q ⇒ r ∴ p ⇒ r Note that disjunctive syllogism is symmetric, i.e if ∼q is the premise, p is the conclusion.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 35 / 38

slide-43
SLIDE 43

Inference Basic rules of inference

Take 5

Are the following inference rules valid? Rule 1 Rule 2 Rule 3 p ∨ q p ⇒ r q ⇒ r ∴ r p ⇒ q q ∴ p p ⇒ q

∼p

∴ ∼q

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 36 / 38

slide-44
SLIDE 44

Inference Basic rules of inference

Take 5

Are the following inference rules valid? Rule 1 Rule 2 Rule 3 p ∨ q p ⇒ r q ⇒ r ∴ r p ⇒ q q ∴ p p ⇒ q

∼p

∴ ∼q

YES: Division Into Cases NO: Converse Error NO: Inverse Error

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 36 / 38

slide-45
SLIDE 45

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. If these tracks are Bigfoot’s, Bigfoot exists. My pet ostrich can do 100 me- ters in under 10 seconds. Bigfoot exists. ∴ My pet ostrich can partici- pate in the Olympics. ∴ These tracks are Bigfoot’s.

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 37 / 38

slide-46
SLIDE 46

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!

Jason Filippou (CMSC250 @ UMCP) Propositional Logic 05-31-2016 38 / 38