1 propositional logic section 1.1. 2 definition a proposition is a declarative sentence that is...

22
1 Propositional Logic Section 1.1

Upload: cameron-snow

Post on 24-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

1

Propositional Logic

Propositional Logic

Section 1.1

Page 2: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

2

DefinitionDefinition

A proposition is a declarative sentence that is either true or false but not both nor neither

Any proposition has a truth value {T, F}

Page 3: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

3

Examples Examples Statement Prop Truth

Value

Today is Friday yes F

1+1 = 2

I know that you hate this course

Is that correct?

Do not answer quickly

I’m a liar

X+ 2 = 0

Page 4: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

4

Examples Examples Statement Prop Truth

Value

Today is Friday Yes F

1+1 = 2 Yes T

I know that you hate this course Yes T

Is that correct? No

Do not answer quickly No

I’m a liar No

X+ 2 = 0 No

Page 5: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

5

Proposition TypesProposition Types

A proposition could be either simple or compound.

Simple: without logical operators Compound: with logical operators

(connectives)

Page 6: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

6

Logical Operators Logical Operators

Let p & q be propositions, then the following are compound propositions:

Negation of p: p = not p Conjunction: p q = p AND q Disjunction: p q = p OR q Exclusive OR: p q = p XOR q Implication: p q = if p then q Biconditional: p q = p iff q

Page 7: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

7

NegationNegation

p = It is raining p = It is not raining

= it is not the case that it is raining

Truth table

P p

T F

F T

Page 8: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

8

ConjunctionConjunction p = it is Friday q = it is raining p q = it is Friday and it is raining Truth Table:

p q p qT T T

T F F

F T F

F F F

Page 9: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

9

DisjunctionDisjunction p = 1> 0 q = monkeys can fly p v q = 1>0 or monkeys can fly Truth Table:

p q p v q

T T T

T F T

F T T

F F F

Page 10: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

10

Conditional Statement: ImplicationConditional Statement: Implication

p = I think q = I exist p q = if I think then I exist Truth Table:

p q p q

T T T

T F F

F T T

F F T

Page 11: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

11

If p, then qIf p, then q

p = hypothesis q = conclusion (consequence)

There are many ways to write a conditional statement

Page 12: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

12

Other Rephrasing of ImplicationOther Rephrasing of Implication

If p, then q If p, q q if p p is sufficient for q

a sufficient condition for q is p a necessary condition for p is q in order to have p true, q has to be true also q when p

Page 13: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

13

Other Rephrasing of ImplicationOther Rephrasing of Implication

p q p implies q p only if q

p is true only if q is also true q follows from p

Page 14: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

14

Examples of ImplicationExamples of Implication

If you get 98% then I’ll give you A+ 98% is sufficient for A+ If you get A+ then it doesn’t mean you have

98% A+ is necessary for 98% 98% however is not necessary for A+ 98% only if A+ A+ follows from 98% 98% doesn’t follow from A+

Page 15: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

15

Examples of ImplicationExamples of Implication

Notice that if p is true then q must be true, however if p is not true then q may or may not be true.

Page 16: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

16

Examples of Implicationاألنبياء 68 - 59سورة

Examples of Implicationاألنبياء 68 - 59سورة �م�ين� الظ�ال �م�ن� ل �ه� �ن إ �ا �ن �ه�ت �آل ب ه�ذ�ا ف�ع�ل� م�ن �وا )59 (ق�ال

اه�يم� $ر� �ب إ �ه� ل �ق�ال� ي ه�م$ �ر� �ذ$ك ي *ى ف�ت �ا م�ع$ن س� �وا )60 (ق�ال

ه�د�ون� �ش$ ي �ه�م$ �ع�ل ل �اس� الن �ن� �ع$ي أ ع�ل�ى �ه� ب �وا $ت ف�أ �وا )61 (ق�ال

اه�يم� $ر� �ب إ �ا ي �ا �ن �ه�ت �آل ب ه�ذ�ا ف�ع�ل$ت� �نت� �أ أ �وا )62 (ق�ال

�نط�ق�ون� ي �وا �ان ك �ن إ �وه�م$ �ل أ ف�اس$ ه�ذ�ا ه�م$ �ير� �ب ك �ه� ف�ع�ل �ل$ ب )63 (ق�ال�

�م�ون� الظ�ال �م� �نت أ �م$ �ك �ن إ �وا ف�ق�ال ه�م$ �نف�س� أ �ى �ل إ ج�ع�وا )64 (ف�ر�

�نط�ق�ون� ي ء ه�ؤ�ال� م�ا �م$ت� ع�ل �ق�د$ ل ه�م$ ؤ�وس� ر� ع�ل�ى وا �ك�س� ن �م� )65 (ث

�م$ ك �ض�ر? ي و�ال� * $ئا ي ش� �م$ �نف�ع�ك ي ال� م�ا �ه� الل د�ون� م�ن �د�ون� �ع$ب �ف�ت أ )66 (ق�ال�

�ون� �ع$ق�ل ت �ف�ال� أ �ه� الل د�ون� م�ن �د�ون� �ع$ب ت �م�ا و�ل �م$ �ك ل Eف� )67 (أ

�ين� ل ف�اع� �م$ �نت ك �ن إ �م$ �ك �ه�ت آل وا و�انص�ر� ق�وه� Jح�ر �وا )68 (ق�ال

Page 17: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

17

Examples of Implicationاألنبياء 68 - 59سورة

Examples of Implicationاألنبياء 68 - 59سورة

It is very clear that the prophet Ebrahim didn’t lie because he said that

If they speak, then the biggest one did it

Page 18: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

18

BiConditional Statement BiConditional Statement p = 1 < 0 q = monkeys can fly p q = 1< 0 if and only if monkeys can fly Truth Table:

p q p q

T T T

T F F

F T F

F F T

Page 19: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

19

BiConditional Statement BiConditional Statement p q = p if and only if q

= p if q and p only if q

= “q p” and “p q”

= “p q” “q p” p is necessary & sufficient for q p and q always have the same truth

value

Page 20: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

20

TheoremTheorem

p and q are logically equivalent, i.e.,

p q if and only if p q is always true

p q p q p q

T T T T

T F F F

F T F F

F F T T

Page 21: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

21

ExampleExample

p q p p v q p q

T T F T T

T F F F F

F T T T T

F F T T T

Logically equivalentp v q p q

Page 22: 1 Propositional Logic Section 1.1. 2 Definition A proposition is a declarative sentence that is either true or false but not both nor neither Any proposition

22

Precedence of Logical OperatorsPrecedence of Logical Operators

The following operators are sorted according to their precedence

, , v , ,

This means for example

(((p(q)) v p v q ) q) ( (p(q)) v p)