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

Post on 18-Jan-2016

278 views 7 download

Tags:

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

1

Propositional Logic

Introduction

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

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)

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

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”

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

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

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

9

Conjunctions A and B

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

Conjunctions A and B

11

A and BT T TT F FF F TF F F

TRUTH TABLE for the conjunction “A and B”

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

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”

14

Disjunctions A or B

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”

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)

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

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”

19

Conditionals:If A then B

20

Conditionals: If A then B

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

ANTECEDENT CONSEQUENT

If A Then B

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

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)

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)

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

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”

Equivalence (A B)

The truth table

26

A B

T T T

T F F

F F T

F T F

27

Contradictories:not-A

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

Contradictories: not-A

29

A Not-A

T F

F T

TRUTH TABLE for the CONTRADICTORY “not-A”

30

Models of complex sentences

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.

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)

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.

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

35

Truth tables IIThe five logical connectives:

A complex sentence:

36

Thank You!