Propositional Logic

25
Propositional Logic Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois School of Athens Fresco by Raphael Wikimedia Commons

description

Propositional Logic. School of Athens Fresco by Raphael Wikimedia Common s. Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois. Mathematical logic (symbolic logic). - PowerPoint PPT Presentation

Transcript of Propositional Logic

Page 1: Propositional Logic

Propositional Logic

Discrete Structures (CS 173)Madhusudan Parthasarathy, University of Illinois

School of AthensFresco by RaphaelWikimedia Commons

Page 2: Propositional Logic

Mathematical logic (symbolic logic)Study of inference using abstract rules that does not assume any particular knowledge of things or of properties.E.g.: All men are mortal

Socrates is a manInference: Socrates is mortal.

E.g. All pigs are boisterousAlfred is a pig.

Inference: Alfred is boisterous

Page 3: Propositional Logic

All snarks are frabjousYeti is a snark.Inference: Yeti is frabjous

Key idea: Inference is independent of the subjects (men, pigs, snarks) and properties (mortality, boisterousness, frabjousness).

Inference follows simply from language!

Page 4: Propositional Logic

All p’s are q. h is a p. Inference: h is q.

Inference: q(h)

Page 5: Propositional Logic

But inference rules needn’t hold in natural language! … quirks of English

Sam and Sally are programmers. Inference: Sam is a programmer

Sam and Sally are together. Inference: Sam is together!

So we need a formal language…. logic!

x

Page 6: Propositional Logic

Propositional logicA proposition is a statement that is either true or false.

Examples:• Socrates is a man• This car is purple• 43 is prime

Non-examples:• Trucks• Hello• Trkjkjugirtu

Page 7: Propositional Logic

Propositional logicPropositional logic talks about Boolean combinations of propositions and inferences we can make about them.

E.g., If it is raining, then it is cloudy. It is not cloudy. Inference: It is not raining.

Abstraction: p: it is raining q: it is cloudy

Inference:

Page 8: Propositional Logic

Propositional logicPropositions: p, q, r, s, ….Constants: T, FOperators (boolean):

bi-implication; iff

Syntax: Any formula that combines propositions and constants using these operators

Page 9: Propositional Logic
Page 10: Propositional Logic

Propositional logic: Semantics

A formula f, in general, doesn’t have a “truth” value associated to it.

Model: M - Assigns truth/falsehood to each proposition

Any formula f evaluates to true/false in such a model.

Page 11: Propositional Logic
Page 12: Propositional Logic

Implication can be non-intuitive

says “if p is true then q is true”

If the model sets p to true, and q to true, then evaluates to true.If the model sets p to true, and q to false, then evaluates to false.If the model sets p to false and q to true, then evaluates to true. If the model sets p to false and q to false, then evaluates to true! (vacuosly)

Page 13: Propositional Logic

ImplicationSo is really the same as

“If p then q” is same as “either p is false or q is true”

Page 14: Propositional Logic

TautologyA formula is a tautology if it evaluates to true in every model.

E.g. If model sets p to true, then formula is true. If model sets p to false, then formula is true.

E.g., (

Why?

“Do you like this or not?” --- “Yes”

Non-example:

Page 15: Propositional Logic

Equivalence

Formulas f and g are equivalent () if in every model M, either both f and g evaluate to true in M or both evaluate to false in M.

E.g.,

Page 16: Propositional Logic
Page 17: Propositional Logic

Some important equivalences• •

De Morgan’s laws

Page 18: Propositional Logic
Page 19: Propositional Logic

Some important equivalencesDistributive laws:

Commutativity• • Associativity• •

Page 20: Propositional Logic

Contrapositive, converse, negationProposition: “If the sky is green, then I’m a monkey’s uncle.”

• Converse– If I’m a monkey’s uncle, then the sky is green.

• Contrapositive– If I’m not a monkey’s uncle, then the sky is not green.

• Negation– The sky is green, but I am not a monkey’s uncle.

Page 21: Propositional Logic

Contrapositive, converse, negationProposition: “If the sky is green, then I’m a monkey’s uncle.”

• Converse– If I’m a monkey’s uncle, then the sky is green.

• Contrapositive– If I’m not a monkey’s uncle, then the sky is not green.

• Negation– The sky is green, but I am not a monkey’s uncle.

Page 22: Propositional Logic

More manipulation examplesShow that these are tautologies:

Page 23: Propositional Logic
Page 24: Propositional Logic

Logistics• If you’re not registered yet and

– Sign sheet at end of class (again)– Sign up for moodle and piazza– Keep on top of homeworks

• only mini-homework for next week• will be released by Friday

• No discussion sections this week

Page 25: Propositional Logic

See you next week!• Tuesday

– More logic• Predicate logic• Quantifiers• Binding and scope

– Direct proofs

• Thursday– More proof practice and strategies