1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned...

36
1 Propositional Logic Introduction

Transcript of 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned...

Page 1: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

1

Propositional Logic

Introduction

Page 2: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

2

What is propositional logic?

Propositional Logic is concerned with propositions and their interrelationships. Def: A proposition is a statement that is either true or false

Deals with logic relationships between propositions (claims, statements, sentences)

A proposition is a possible condition of the world that is

either true or false

Sometimes called “sentential logic” or “Statement logic”

Is the branch of logic that studies ways of joining and/or modifying entire propositions to form more complicated propositions, as well as the logical relationships and properties

J= “Ibrahim is wearing a red coat”Either Ganymede is a moon of Jupiter or Ganymede is a moon of Saturn

Page 3: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

3

What is propositional logic?

Propositional logic is interested in how the truth value of “compound claims” depends on the truth value of the individual claims that make it up.

“Ibrahim is wearing a red coat” “he’s stealing a jeep”

(True or False)(True or False)

“Ibrahim is wearing a red coat and he’s stealing a jeep”

(T or F)

Page 4: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

4

Propositional logic

Logical constants: true, false

Propositional symbols: P, Q, S, ... (atomic sentences)

Sentences are combined by logical connectives: ...and [conjunction] ...or [disjunction] ...implies [implication/conditional] ..is equivalent [biconditional] ...not [negation]

Literal: atomic sentence or negated atomic sentence

A and BA or B

If A then BA==Bnot-A

Page 5: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

5

Examples of PL sentences

P means “It is hot.”

Q means “It is humid.”

R means “It is raining.”

(P Q) R

“If it is hot and humid, then it is raining”

Q P

“If it is humid, then it is hot”

A better way:

Hot = “It is hot”

Humid = “It is humid”

Raining = “It is raining”

Page 6: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

6

What is propositional logic?

Basic compound claims that express logical relationships between the simpler sentences of which they are composed:

Given the truth values of A, B, C and D

Is the above claim as a whole True or False”

“If (A or B) then (C and not-D))”

Page 7: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

7

Propositional logic (PL)

A simple language useful for showing key ideas and definitions

User defines a set of propositional symbols, like P and Q.

User defines the semantics of each propositional symbol: P means “It is hot” Q means “It is humid” R means “It is raining”

A sentence (well formed formula) is defined as follows: A symbol is a sentence If S is a sentence, then S is a sentence If S is a sentence, then (S) is a sentence If S and T are sentences, then (S T), (S T), (S T), and (S ↔

T) are sentences A sentence results from a finite number of applications of the

above rules

Page 8: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

8

We are going to focus on:

(Part I) the definitions of the basic compound claims:

(Part 2) contradictories, contradictions, and consistency

(Part 3) contradictories of compound claims:

(Part 4) ways of saying “if A then B”

“A and B”, “A or B”, “If A then B”

“not-(A and B)”, “not-(A or B)”, “not-(If A then B)”

Page 9: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

9

Conjunctions A and B

Page 10: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

10

Conjunctions A and B

A=“I love Chicken” B= “I hate Meat”

A and B= “I love Chicken and I hate Meat”

“A”=True “A and B”= True and

“B”=True

Page 11: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conjunctions A and B

11

A and BT T TT F FF F TF F F

TRUTH TABLE for the conjunction “A and B”

Page 12: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conjunctions A and B

12

Ibrahim is a father and Ibrahim is a teacher

Ibrahim is a father and a teacher

Ibrahim is a teacher but he doesn’t like chockAlthoughHowever

yet

Page 13: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conjunctions A and B

13

One last Point:

Is also conjunction, and follows the same logical rules as “A and B”

“A and B and C and D and E”

Page 14: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

14

Disjunctions A or B

Page 15: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

15

Disjunctions A or B

A=“Ibrahim is at the movies”

B= “Ibrahim is at the library”

A or B= “Ibrahim is at the movies or Ibrahim is at the library”

Page 16: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Disjunctions A or B

16

“A triangle can be defined as a polygon with three sides or as a polygon with three vertices”

(Inclusive OR)

“ The coin landed either heads or tails”

(Exclusive OR)

Page 17: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Disjunctions A or B

17

A or BT T TT T FF T TF F F

TRUTH TABLE for the disjunction “A or B”

A or B

T F T

T T F

F T T

F F F

Inclusive OR Exclusive OR

Page 18: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Disjunctions A or B

18

One last Point:

Is also disjunction, and follows the same logical rules as “A or B”

“A or B or C or D or E”

Page 19: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

19

Conditionals:If A then B

Page 20: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

20

Conditionals: If A then B

If I miss the bus then I will be late for work.

ANTECEDENT CONSEQUENT

If A Then B

Page 21: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conditionals: If A then B

21

What does the conditional assert ((يأكد?A B

If I eat much then I will be fat

Doesn't assert that A is true

Doesn’t assert that B is true

Assert a logical relationship between A and B

Page 22: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conditionals: If A then B

22

What does the conditional assert ((يأكد?A B

If I live in MAKKA then I live in the Saudi

(False) (False)

(True)

Page 23: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conditionals: If A then B

23

When is the conditional false?

A B

If I study hard then I will pass the exam

Case I: I didn’t study hard (A is false)

I pass the test (B is true)

Case 2: I didn’t study hard (A is false)

I didn’t pass the test (B is false)

Case 3: I study hard (A is true)

I didn’t pass the test (B is false)

Page 24: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conditionals: If A then B

24

When is the conditional false?

True False

If I study hard then I will pass the exam

A conditional claim is FALSE when

The antecedent is True

But

The consequent is False

Page 25: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Conditionals: If A then B

25

A BT T TT F FF T TF T F

TRUTH TABLE for the CONDITIONAL “If A then B”

Page 26: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Equivalence (A B)

The truth table

26

A B

T T T

T F F

F F T

F T F

Page 27: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

27

Contradictories:not-A

Page 28: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Contradictories: not-A

A= “Ibrahim is at the home”

The CONTRADICTORY of A:

A claim that always has the OPPOSITE truth value of A

Not-A

~ A

¬A

Not-A=“Ibrahim is not at the home”

28

Page 29: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

Contradictories: not-A

29

A Not-A

T F

F T

TRUTH TABLE for the CONTRADICTORY “not-A”

Page 30: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

30

Models of complex sentences

Page 31: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

31

Some terms

The meaning or semantics of a sentence determines its interpretation.

Given the truth values of all symbols in a sentence, it can be “evaluated” to determine its truth value (True or False).

A model for a KB is a “possible world” (assignment of truth values to propositional symbols) in which each sentence in the KB is True.

Page 32: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

32

More terms

A valid sentence or tautology is a sentence that is True under all interpretations, no matter what the world is actually like or what the semantics is. Example: “It’s raining or it’s not raining.”

An inconsistent sentence or contradiction is a sentence that is False under all interpretations. The world is never like what it describes, as in “It’s raining and it’s not raining.”P entails Q, written P |= Q, means that whenever P is True, so is Q. In other words, all models of P are also models of Q.

(p → q) ˅ (p → q)

Page 33: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

33

Truth Tables

In general, a truth table for compound proposition will have rows, where n = number of unique propositional variables occurring in the expression.

Count in binary with F being 0 and T being 1 to cover all cases.

Page 34: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

34

Boolean logic properties

Associative: (A and B) and C = A and (B and C) (A or B) or C = A or (B or C)

Commutative: A and B = B and A A or B = B or A

Distributive: (A and B) or C = (A or C) and (B or C) (A or B) and C = (A and C) or (B and C)

Idempotent: A and A = A A or A = A

Transitive: A → B and B → C implies A → C

Page 35: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

35

Truth tables IIThe five logical connectives:

A complex sentence:

Page 36: 1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships.

36

Thank You!