logic and discrete math lecture notes introduction …zhang/teaching/cse240/spring10/prop... ·...

128
1 Weixiong Zhang Washington University in St. Louis http://www.cse.wustl.edu/~zhang/teaching /cse240/Spring10/index.html CSE 240 Logic and Discrete Math Lecture notes Introduction and Propositional Logic

Upload: dangnhu

Post on 06-Sep-2018

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

1

Weixiong ZhangWashington University in St. Louis

http://www.cse.wustl.edu/~zhang/teaching/cse240/Spring10/index.html

CSE 240Logic and Discrete Math

Lecture notes Introduction and Propositional

Logic

Page 2: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

2

Why This Course?

Relation to real life:

Algorithm correctness ~ programming, reverse-engineering, debugging

Propositional logic ~ hardware (including VLSI) design

Sets/relations ~ databases (Oracle, MS Access, etc.)

Predicate logic ~ Artificial Intelligence, compilers

Proofs ~ Artificial Intelligence, VLSI, compilers, theoretical physics/chemistry

This is the “calculus” course for the computer science

Page 3: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

3

Code Correctness

Millions of programmers code away daily…How do we know if their code works?

Page 4: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

4

ImportanceUSS Yorktown, a guided-missile cruiser --- the first to be outfitted with Smart Ship technology09/97: suffered a widespread system failure off the coast of Virginia. After a crew member mistakenly entered a zero into the data field of an application, the computer system proceeded to divide another quantity by that zero. The operation caused a buffer overflow, in which data leak from a temporary storage space in memory, and the error eventually brought down the ship's propulsion system. The result: the Yorktown was dead in the water for more than two hours.

Page 5: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

5

More Software Bugs…On June 4, 1996, the maiden flight of the European Ariane 5 launcher crashed about 40 seconds after takeoff. Media reports indicated that the amount lost was half a billion dollars -- uninsured.

The exception was due to a floating-point error: a conversion from a 64-bit integer to a 16-bit signed integer, which should only have been applied to a number less than 2^15, was erroneously applied to a greater number, representing the "horizontal bias" of the flight.

There was no explicit exception handler to catch the exception, so it followed the usual fate of uncaught exceptions and crashed the entire software, hence the on-board computers, hence the mission.

Page 6: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

6

Where is CSE 240?How do we find such bugs in software?

TracingDebug statementsTest casesMany software testers working in parallel…

All of that had been employed in the previous casesYet the disasters occurred…

Page 7: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

7

CSE240 : Program Correctness

Logic : means to prove correctness of software

Sometimes can be semi-automated

Can also verify a provided correctness proof

Page 8: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

8

Argument #1

All men are mortalSocrates is a man

Therefore, Socrates is mortal

Page 9: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

9

Argument #2

Nothing is better than GodA sandwich is better than nothing

Therefore, a sandwich is better than God

Page 10: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

10

Argument #3

An island

A barber cannot cut his/her own hair

The barber cuts everyone’s hair on the island

Jon is a barber

So, Jon will cut his own hair

Page 11: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

11

Validity

An argument is valid if and only if given that its premises hold its conclusion also holds

So…Socrates argument: Valid or Invalid?Sandwich argument: Valid or Invalid?Barber argument: Valid or Invalid?

Page 12: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

12

How can we tell ?

Common sense?Voting?Authority?What is valid argument anyway?Who cares?

???

Page 13: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

13

CSE 240

Logic : a formal way to assess a validity of an argument

Can prove theorems in a semi-automatic fashion – construct a proof

Can verify given proofs that an argument is valid

Page 14: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

14

Material CoverageChapter 1: propositional calculusChapter 2: 1st order predicate calculusChapter 3: number theory and proof techniquesChapter 4: mathematical inductionChapter 5: set theoryChapter 6: counting / probabilitiesChapter 7: functionsChapter 10: relationsChapter 11: graphs and trees

Page 15: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

15

Questions?

Page 16: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

16

Arguments in Puzzles

The Island of Knights and Knaves

Never lie

Always lie

Page 17: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

17

Example #1

You meet two people: A, BA says:

I am a Knave or B is a Knight.

Who is A?

Who is B?

Page 18: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

18

A possible argument (solution)The original statement can be written as:S = X or YX = “A is a Knave”Y = “B is a Knight”Suppose A is a KnaveThen S must be false since A said itThen both X and Y are falseIf X is false then A is not a Knave(Contradiction : A can be a Knave and cannot a Knave !)So A must be a KnightSo S is true (why?) and X is not trueThus, to keep S true Y must be trueSo B is a Knight too

Page 19: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

19

How about…

You meet just one guy : A

A says:“I’m a Knave!”

Who is A?

Page 20: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

20

Features Of An Argumentarguments involve things or objectsthings have propertiesarguments consist of statementsstatements may be composedan argument starts with assumptions which create a context.each step yields another statement which is true, within its context.arguments may contain sub-argumentsit is absurd for a statement to be both true and false

Page 21: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

21

Formalization

Why formalize?

to remove ambiguity

to represent facts on a computer and use it for proving, proof-checking, etc.

to detect unsound reasoning in arguments

Page 22: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

22

Graphically…

Page 23: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

23

Logic

Mathematical logic is a tool for dealing with formal reasoningIn a nutshell:

Logic does:Assess if an argument is valid/invalid

Logic does not directly:Assess the truth of atomic statements

Page 24: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

24

DifferencesLogic can deduce that:

St Louis is in the USAgiven these facts:

St Louis is in MissouriMissouri is a part of the USA

and the definitions of:‘to be a part of’‘to be in’

Logic knows nothing of whether these facts actually hold in real life!

Page 25: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

25

Questions?

Page 26: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

Lecture 04 © Vadim Bulitko : CMPUT 272, Winter 2004, UofA 26

Announcement

It is Ok for an assignment problem to refer to the material that is:

Not covered in class by the due dateNot covered in class at all

Why?

Because the lectures only highlight the material in the textbookThey are not a substitute for reading the text

Page 27: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

27

Propositional Calculus (Ch 1.)

Simplest kind of math logic

Dealing with:

Propositions: X,P,Q,…each can be true or falseExamples: P=“I’m a knave”

Q=“He is a knight”

Connectives: & (˄), v, , , ~ (¬), …connect propositions: X v Y

Page 28: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

28

Connectives

Different notation is in useWe will use the common math notation:

~ notV or (non-exclusive!)& and implies (if … then …) if and only if∀ for all∃ exists

See the reverse of the text’s front cover

Page 29: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

29

Formulae

A statement/proposition: true or false

Atomic: P, Q, X, Y, …

Unit Formula: P, ~P, (formula), …

Conjunctive: P & Q, P & ~Q, …

Disjunctive: P v Q, P v (P & X),…

Conditional: P Q

Biconditional: P Q

Page 30: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

30

Determining Truth of A Formula

Atomic formulae: givenCompound formulae: via meaning of

the connectivesSuppose: P is true

Q is falseHow about: (P v Q)

Truth tables

Page 31: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

31

Truth Tables

Suppose: P is falseQ is falseX is true

How about:P & Q & XP v Q & XP & Q v X

Page 32: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

32

Precedence

~ highest&v, lowest

Avoid confusion - use ‘(‘ and ‘)’:P & Q v X(P & Q) v X

Page 33: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

33

Parenthesizing

Parenthesize & build truth tablesSimilar to arithmetics:

3*5+7 = (3*5)+7 but NOT 3*(5+7)A&B v C = (A&B) v C but NOT A&(B v C)

So start with sub-formulae with highest-precedence connectives and work your way out

Let’s do the knave & knight problem in TT

Page 34: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

34

TT for K&KS = X or YX = “A is a Knave”Y = “B is a Knight”

A B S X Y X v Y Absurd------------------------------------------------------------------------------Knave Knave false true false true yesKnave Knight false true true true yesKnight Knave true false false false yesKnight Knight true false true true no

Page 35: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

35

Questions?

Page 36: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

36

Conditionals

“If I go to Save-on-Foods tomorrow I will buy oranges there”

S = (go to SOF) (buy oranges)

When is S true?When I went to SOF and bought orangesWhen I didn’t go there at all!

When is S false?When I went there but didn’t buy oranges

Page 37: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

37

Truth Table

N independent atomic formulae (variables) 2N rowsN=20: 220 ~ 1 millionConsider A B:

A B A BF F TF T TT F FT T T

Page 38: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

38

More terminology

A B

A is called:AssumptionPremiseAntecedent

B is calledConclusion

Page 39: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

39

Bi-Conditionals“Marion will take 240 if and only if Norma does so”

S = (Marion takes 240) (Norma takes 240)

When is S true?When Marion takes is and Norma takes itWhen Marion doesn’t take it and neither does Norma

When is S false?When one of them takes it but not the other

Page 40: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

40

Truth Tables

A B A BF F TF T FT F FT T T

Page 41: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

41

, and Daily LifeSuppose:

“Buy Ferrari” = B“Ferrari is on sale” = S

I will buy a Ferrari if it is on sale:S B

I will buy a Ferrari if and only if it is on sale:

S BI will buy a Ferrari only if it is on sale:

~S ~BB S

Page 42: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

42

Sufficient & Necessary Conditions

Suppose the Ferrari salesperson wants to figure out when you are ready to buy one of their cars…

B = “ready to buy”X = some condition of you

If they find X such that: X BThen they have a sufficient conditionExample: X = “got a WashU scholarship”

If they find X such that: B XThen they have a necessary conditionExample: X = “it is winterized”

Page 43: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

43

CriteriaIf they find X such that: B X

Then they have a criterion

What would be an example?How about a conjunction of the sufficient and necessary conditions?

X = “got WashU scholarship and it is winterized”

Doesn’t work: you may get a Ferrari Christmas gift certificate from your grandma and you will just go and pick one up (regardless of whether you got the scholarship)

Page 44: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

44

SummarySuppose X is a statement

A is a sufficient condition for X iff we can prove that:“A implies X”

A is necessary condition for X iff we can prove that:“X implies A”

A is a criterion for X iff we can prove that:“X holds if and only if A holds”

Page 45: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

45

Contradictions & Tautologies

Contradiction:A statement that is always false regardless of the values of its variables

Examples: A & ~A

Tautology:A statement that is always true regardless of the values of its variables

Examples: A v ~A

Page 46: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

46

Contingencies

What is I have a formula that is sometimes true and sometimes false?

It is called a contingency

Example:A & B

If A and B are independent variables

Page 47: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

47

Interpretation

In propositional logic interpretation (instantiation) is a mapping from symbols in your formulae to {true, false}

Example:Formula: A v BInterpretation: A = true, B = false

Page 48: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

48

Formula Classification

Tautology : all interpretations satisfy the formula

Contradiction : all interpretations falsify the formula

Contingency : some interpretations satisfy and some falsify the formula

Page 49: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

49

Models / Counter-models

An interpretation is called a model for formula F iff:

It satisfies F (i.e., makes F=true)

An interpretation is called a counter-model for formula F iff:

It falsifies F (i.e., makes F=false)

Page 50: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

50

Logic EquivalencePropositions/statements/formulae A and B are logically equivalent when:

A holds if and only if B holdsNotation: A ≡ BExamples:

A v A is equivalent to:A

A v ~A is equivalent to:true

Page 51: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

51

Equivalence & Tautology

Suppose A and B are logically equivalentConsider proposition (A B)What can we say about it?It is a tautology!Why?A B A BF F TT T T

Page 52: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

52

More Equivalences

Alex is not unemployedAlex is employed

P ≡ ~(~P) : Double-negationIt is not true that she is single and she is cute

She is not single or she is not cute

~(A & B) ≡ ~A v ~B : De Morgan’s lawIt is not true that she is single or she is cute

She is not single and she is not cute

~(A v B) ≡ ~A & ~B : De Morgan’s law

Page 53: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

53

Boolean AlgebraPage 14 presents Theorem 1.1.1 with 21 equivalencesHowever, only the first 10 are neededThe rest can be derived from them

Example: let’s prove that P v P ≡ PP v C ≡ P (4)P v (P & ~P) ≡ P (5)(P v P) & (P v ~P) ≡ P (3)(P v P) & T ≡ P (5)P v P ≡ P (4)

Page 54: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

54

Challenge

Derive the rest (e.g., #8) from the first 5 equivalences…

Page 55: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

55

Proving Equivalences

Suppose P and Q can take on T and Fonly Then all equivalences can be proven by definition using truth tablesP Q ~(P v Q) ~P & ~QF F T F T T TF T F T T F FT F F T F F TT T F T F F F

Page 56: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

56

Another Example

Prove P Q ≡ ~P v QTruth tables…

Page 57: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

57

Questions?

Page 58: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

58

Uses of Equivalences

SimplificationSuppose someone gives you

~P v (AB) v ~(C v D H) v P v XY

and asks you to compute it for all possible input valuesYou can either immediately draw a truth table with 28 = 256 rows

Or you can simplify it first

Page 59: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

59

Simplification

~P v (AB) v ~(C v D H) v P v XY~P v P v (AB) v ~(C v D H) v XYT v (AB) v ~(C v D H) v XYT YY

Page 60: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

60

Test Drive

Let’s take our equivalence tool box for a spin…What can we tell about

A B

and its contraposition:~B ~A

?They are equivalent !

Page 61: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

61

Proof?

Truth-tables

EquivalencesA B~A v BB v ~A~B ~A

Isn’t this fun?

Page 62: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

62

Test Drive

Let’s try another one!What can we tell about

A B

and its inverse:~A ~B

?Oh-oh…They are not equivalent!Counter-model: A is false and B is true…

Page 63: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

63

Summary

ImplicationA B

is equivalent to:~B ~A : its contraposition

But is not equivalent to:~A ~B : its inverse

Or to:B A : its converse

Page 64: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

64

Another Lesson Learned

Proving equivalencesvia truth-tablesvia other equivalences

Proving non-equivalence:Finding an instantiation that makes one formula hold and the other doesn’t

Page 65: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

65

Bi-conditionals

How can we express:A B

With &, v, ~ ?It is simply:

(A & B) v (~A & ~B)

How can we express it with , & ?Why, but of course it is just:

(A B) & (B A)

Page 66: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

66

Another Spin…

Ok, let’s try this fun ride:(P Q) & P

In English it would sound:(If P is true then Q is true) and (P is true)

What does it tell us?Naturally Q is true!

Let’s prove it…

Page 67: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

67

Proving…

(P Q) & P(~P v Q) & P~P & P v Q & PF v Q & PQ & PBut we want just Q not Q & P!Is Q & P ≡ Q ?No -- counter-model: Q=T and P=F …

Page 68: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

68

What is the matter?

Not all arguments have the form of a chain of equivalencesExample:

PQ = “If Socrates is human then Socrates is mortal”P=“Socrates is human”A conjunction of these two is NOT equivalent to Q= “Socrates is mortal”Why? Name a dog Socrates. It is mortal (Q holds). But it is NOT human (P does not hold)…

Page 69: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

69

Entailment

A collection of statements P1,…,Pn (premises) entails statement Q (conclusion) if and only if:Whenever all premises hold the conclusion holds

Example:Premises:

P1 = “If Socrates is human then Socrates is mortal”P2 = “Socrates is human”

Conclusion:Q = “Socrates is mortal”

Page 70: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

70

Valid/Invalid Arguments

Suppose someone makes an argument:P1,..,PN therefore Q

The argument is called valid iff:P1,…,PN logically entail Q

That is:Q must hold when all Pi hold

Otherwise the argument is called invalid

Page 71: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

71

Relation to Tautologies

We already know that formulae A and B are equivalent iff (A B) is a tautology (i.e., holds for any interpretation)

How about entailment?

Formula A entails formula B iff (A B) is a tautologyIn general: premises P1,…,PN entail Q iff (P1 & … & PN Q) is a tautology

Page 72: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

72

Questions?

Page 73: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

73

Today

Refresher: Chapter 1.2

Chapter 1.3 : Arguments

All i

mag

es a

re c

opyr

ight

ed t

o th

eir

resp

ectiv

e co

pyrig

ht h

olde

rs a

nd r

epro

duce

d he

re fo

r ac

adem

ic p

urpo

ses

unde

r th

e co

nditi

on o

f “fa

ir us

ing”

.

Page 74: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

74

Interpretation

In propositional logic interpretation is a mapping from variables in your formulae to {true, false}

Example:Formula: A v BInterpretation 1: A = true, B = falseInterpretation 2: A = false, B = false

Page 75: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

75

Interpretations

How many interpretations do the following formulae allow?A B

4

(AB & A) B4

Why not 8 or 16?

The number of interpretations is 2N where Nis the number of independent variables

Page 76: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

76

Questions?

Page 77: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

77

ConditionsSuppose we care about statement X

X = “this assignment is copied”We want to evaluate X (true/false?)

Suppose we know A such that AXA is a sufficient conditionA=“the cheater is caught in the act”

Suppose we know B such that XBB is a necessary conditionB=“there was an original assignment to copy from”

Page 78: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

78

Criteria

Suppose we know C such that CXC is a criterionC=“someone has copied this assignment”

Graphically:

X

A

B

C

Page 79: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

79

Wanted : Criteria

Medical testsSoftware/hardware correctnessFraud/cheatingFinancial marketPsychology (e.g., in sales)Science : mathematics, physics, chemistry, etc.Logic :

If C is a criterion for X then C ≡ X !

Page 80: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

80

PracticeIt is frequently non-trivial to derive a criterion for a real-life property X

Then we have to settle for:Sufficient conditions:

“If this quality test passes then the product is fine”Necessary conditions:

“If the patient breaks a leg they will be in pain”

Statistical validity : the condition works most of the timeIn logic : the condition works all the time!

Page 81: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

81

Derivation of Criteria

Logic/Mathematics/Theoretical sciences:Equivalent transformationsProofs by contradiction

Empirical sciences:Statistical testsFunction approximation

Artificial Intelligence:Machine learning

These methods are

notguaranteed to produce true

criteria…

Page 82: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

82

Questions?

Page 83: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

83

Logic EquivalencePropositions/statements/formulae A and B are logically equivalent when:

A holds if and only if B holdsNotation: A ≡ BExamples:

A v A is equivalent to:A

A v ~A is equivalent to:true

Page 84: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

84

Challenge

Theorem 1.1.1 : Boolean AlgebraDerive the rest (e.g., #8) from the first 5 equivalences…

Page 85: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

85

Use of Equivalences

Deriving equivalent formulae!Of course, but why do we care?

Simplification of formula

Simplification of code

Simplification of hardware (e.g., circuits)

Derivation of criteria!

Page 86: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

86

Limitations

Not all statements are equivalent!Of course not, but what else is there?

Some formulae are stronger than others

They imply or entail other formula but not the other way around…

Equivalences cannot directly help us proving such entailments…

Page 87: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

87

EntailmentA collection of statements P1,…,Pn (premises) entails statement Q (conclusion) if and only if:

Whenever all premises hold the conclusion holds

For every interpretation I that makes all Pj hold, I also makes Q hold

Example:Premises:

P1 = “If Socrates is human then Socrates is mortal”P2 = “Socrates is human”

Conclusion:Q = “Socrates is mortal”

Page 88: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

88

Valid/Invalid Arguments

Suppose someone makes an argument:P1,..,PN therefore Q

The argument is called valid iff:P1,…,PN logically entail Q

That is:Q must hold if all Pi hold

Otherwise the argument is called invalid

Page 89: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

89

Example

Sample argument:P1 = “If Socrates is human then Socrates is mortal”P2 = “Socrates is human”Therefore:Q = “Socrates is mortal”

Valid / invalid?

Page 90: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

90

Entailment

Then is the following argument valid?P1

P2

entailsQ

Yes?Very well, but what if my interpretation I sets P1 and P2 to true but Q to false?

Then by definition Q is not entailed by P1 and P2

So do P1,P2 entail Q or do they not?

Page 91: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

91

What Happened…We considered P1, P2, and Q under a particular(common sense) interpretation:

P1 = “If Socrates is human then Socrates is mortal” trueP2 = “Socrates is human” trueQ = “Socrates is mortal” true

Thus, they were merely logical constants to us:P1=trueP2=trueQ=true

Page 92: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

92

Generality…Thus our argument was:

TrueTrueentailsTrue

Well, this is not very useful because it doesn’t tell us anything about validity of other arguments. For example:

P1=“If J.B. broke his leg then J.B. is in pain”P2=“J.B. broke his leg”entailsQ=“J.B. is in pain”

Is this argument valid?

Page 93: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

93

Extracting the Essence

How do we know it is valid?Because regardless of who J.B. is and what happened to him/her, we somehow know that:

If P1 and P2 holdThen Q will hold

But how do we know that?How can we extract the essence of the “dead Socrates” and “J.B. in pain” arguments?

Page 94: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

94

General Structure!Recall both arguments:

P1 “If Socrates is human then Socrates is mortal” “If J.B. broke his leg then J.B. is in pain”P2 “Socrates is human” “J.B. broke his leg”entailsQ “Socrates is mortal” “J.B. is in pain”

Note that P1, P2, and Q are related!Both arguments share the same structure:

P1 If X then YP2 XentailsQ Y

Then for any interpretation I as long as I satisfies P1and P2, interpretation I must satisfy Q

Page 95: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

95

Modus PonensThe “generalized” argument

P1 = X YP2 = XentailsQ = Y

…is much more useful!Why?

Because it captures the essence of both arguments and can be used for infinitely many more

“method of affirming” (Lat.)

Page 96: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

96

Valid Arguments (Revisited)Suppose someone makes an argument:

P1,..,PN therefore QThe argument is called valid iff:

P1,…,PN logically entail QThat is:

For any interpretation I that satisfies all Pj, interpretation I must necessarily satisfy Q

Usually: Pj and Q are somehow related formulae and P1 & … & PN can be true or false depending on the interpretation I

Page 97: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

97

Questions?

Page 98: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

98

How Do We:Tell between a valid argument and an invalid argument:

People are mortal. Socrates is a man. Socrates is mortal.Ducks fly. F-16 flies. F-16 is a duck.

Prove that something logically follows from something else:

1: Everybody likes Buddha2: Everybody likes someone

Prove that something is logically equivalent to something else:

1: Everybody likes cream and sugar2: Everybody likes cream and everybody likes sugar

Prove that there is a contradiction?

Page 99: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

99

Propositional Logic

Method #1:Go through all possible interpretations and check the definition of valid argument

Method #2:Use derivation rules to get from the premises to the conclusion in a logically sound way

“derive the conclusions from premises”

Page 100: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

100

Method #1

Section 1.3 in the text proves many arguments/inference rules using truth tables

Suppose the argument is:P1,…,PN therefore Q

Create a truth table for formulaF=(P1 & … & PN Q)

Check if F is a tautology

Page 101: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

101

But Why? Recall:

Formula A entails formula Biff (A B) is a tautology

In general:premises P1,…,PN entail Qiffformula F=(P1 & … & PN Q)is a tautology

Page 102: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

102

Example #1

P QP entails Q

valid/invalid?Modus ponens

Page 103: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

103

Example #2

P QQ entails P

valid/invalid?

Page 104: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

104

Example #3

P Q~Q entails ~P

valid/invalid?Modus tollens

Page 105: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

105

Example #4

P Qentails ~Q ~P

valid/invalid?

In fact, we proved last time that: (P Q) ≡ (~Q ~P)

Page 106: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

106

Example #5

P v Q~P & ~Qentails P & Q

valid/invalid?

Any argument with a contradiction in its premises is valid by default…

Page 107: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

107

Example #6

P v Q v R~R entails P v Q

valid/invalid?

(example 1.3.2 in the book, p. 31)

Page 108: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

108

Example #7

P v Q v R~R entails Q

valid/invalid?

Page 109: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

109

Pros & Cons

Method #1:Pro: straight-forward, not much creativity machines can do

Con: the number of interpretations grows exponentially with the number of variables cannot do for many variables

Con: in predicate and some other logics even a small formula may have an infinitenumber of interpretations

Page 110: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

110

Questions?

Page 111: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

111

Method #2 : Derivations

To prove that an argument is valid:

Begin with the premisesThen which high level strategy?

Equivalence, entailment, (contradiction)

Use valid/sound inference rules

Arrive at the conclusion

Page 112: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

112

Inference Rules

But what are these “inference rules”?They are simply…

…valid arguments! Table 1.1.1

Example:X & Y X & Y Z & WthereforeZ & W by modus ponens

Page 113: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

113

Example #1

(X&Y Z&W) & KX&YthereforeZ&WHow?(X&Y Z&W) & KX&Y Z&W by conjunctive simplificationX&YZ&W by modus ponens

Page 114: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

114

Derivations

The chain of inference rules that starts with the premises and ends with the conclusion…is called a derivation:

The conclusion is derived from the premises

Such a derivation makes a proof of argument’s validity

Page 115: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

115

Example #1

(X&Y Z&W) & KX&YthereforeZ&WHow?(X&Y Z&W) & KX&Y Z&W by conjunctive simplificationX&YZ&W by modus ponens

derivation

Page 116: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

116

Pros & Cons

Method #2:Pro: often can get a dramatic speed-up over truth tables.

Con: requires creativity and intuition harder to do by machines some times

Con: semi-decidable : there is no algorithm that can prove any first-order predicate logic argument to be valid or invalid

Page 117: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

117

Questions?

Page 118: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

118

Fallacies

An error in derivation leading to an invalid argumentVague formulations of premises/conclusionMissing stepsUsing non-sound inference rules, e.g.:

Converse errorInverse error

Page 119: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

119

Converse Error

If John is smart then John makes a lot of moneyJohn makes a lot of moneyTherefore:John is smart

Tries to use this non-sound “inference rule”:AB, BThus: A

Page 120: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

120

Inverse Error

If John is smart then John makes a lot of moneyJohn is not smartTherefore:John doesn’t make a lot of money

Tries to use this non-sound “inference rule”:AB, ~AThus: ~B

Page 121: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

121

Questions?

Page 122: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

122

Truth of facts vs. Validity of Arguments

The premises are assumed to be true ONLY in the context of the argument

The following argument is valid:If John Lennon was a rock star then he was a womanJohn Lennon was a rock starThus:John Lennon was a woman

But the 1st premise doesn’t hold under the common sense interpretation

Page 123: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

123

Inference Rules

Table 1.3.1 on page 40 – study them!!

If practice with the rules then will be more fluent using them

If are more fluent using them then will be more likely to get a better mark on exams

Page 124: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

124

Summary

Equivalence:A ≡ BA holds iff B holdsA is a criterion for BB is a criterion for AA entails BB entails AA and B are “equivalently strong”Formula F=(AB) is a tautology

Page 125: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

125

Summary

Entailment:A entails BB follows from AA∴B is a valid argumentA is a sufficient condition for BB is a necessary condition for AIf A holds then B holdsA may be “stronger than” BFormula F=(AB) is a tautology

Page 126: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

126

The Big Picture

Logic is being used to verify validity of arguments

An argument is valid iff its conclusion logically follows from the premises

Derivations are used to prove validity

Inference rules are used as part of derivations

Page 127: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

127

Questions?

Page 128: Logic and Discrete Math Lecture notes Introduction …zhang/teaching/cse240/Spring10/Prop... · Logic and Discrete Math Lecture notes Introduction and Propositional Logic 2 Why This

128

Summary propositional logic

Interpretation – T/FTruth tableLogical equivalences theorem 1.1.1- page 14Order of operationsRules of inference (reading assignment)Necessary and sufficient conditions