15
Propositional Logic Propositional Logic

Propositional Logic

  • Upload
    yuki

  • View
    17

  • Download
    3

Embed Size (px)

DESCRIPTION

Propositional Logic. Sentence Restrictions. Precise use of natural language is difficult . Want a notation that is suited to precision . Restrict discussion to sentences that are: declarative either true or false but not both. Such sentences are called propositions. - PowerPoint PPT Presentation

Citation preview

Page 1: Propositional Logic

Propositional LogicPropositional Logic

Page 2: Propositional Logic

Sentence RestrictionsSentence Restrictions

• Precise use of natural language is Precise use of natural language is difficultdifficult..

• Want a notation that is suited to Want a notation that is suited to precisionprecision..

• Restrict discussion to sentences that are: Restrict discussion to sentences that are:

• declarative

• either true or false but not both.

• Such sentences are called Such sentences are called propositionspropositions..

Page 3: Propositional Logic

Examples of propositionsExamples of propositions

Which of the sentences below are propositions?Which of the sentences below are propositions?

• “Mastercharge, dig me into a hole!”

• “This class is fascinating.”

• “Do I exist yet?”

• “This sentence is false.”

Page 4: Propositional Logic

5 Basic Connectives5 Basic Connectives• Not (~)Not (~): p is true exactly when ~p is false.: p is true exactly when ~p is false.

• Denote by p “This class is the greatest Denote by p “This class is the greatest entertainment since the Rockford files.” entertainment since the Rockford files.”

• ~~p denotes “p denotes “It is not the case thatIt is not the case that this class is the this class is the greatest entertainment since the Rockford files.” greatest entertainment since the Rockford files.”

p ~p

T F

F T

Page 5: Propositional Logic

Or operator (disjunction)Or operator (disjunction)

• Or (Or ( )): proposition p : proposition p q is true exactly when q is true exactly when either p is true either p is true oror q is true: q is true:

p q p q

T T T

T F T

F T TF F F

Page 6: Propositional Logic

And operator (conjunction)And operator (conjunction)

• And (And ( )): proposition p : proposition p q is true exactly q is true exactly when p is true when p is true andand q is true: q is true:

p q p q

T T T

T F F

F T FF F F

Page 7: Propositional Logic

If and only if operator (iff)If and only if operator (iff)

• If and only if (If and only if ()): proposition p : proposition p q is true q is true exactly when (p exactly when (p q) or (~ p q) or (~ p ~ q): ~ q):

p q pq

T T TT F FF T FF F T

Page 8: Propositional Logic

Implies operator (if … then)Implies operator (if … then)

• Implies (Implies ()): proposition p : proposition p q is true q is true exactly when p is false exactly when p is false oror q is true: q is true:

p q p q

T T T T F F F T T F F T

Page 9: Propositional Logic

If … then ...If … then ...

• Example: “If pigs had wings they could fly.”Example: “If pigs had wings they could fly.”

• In English, use of In English, use of impliesimplies normally connotes normally connotes

a a causalcausal relation: relation:

p implies q means that p causes q to be true.

• Not so with the mathematical definition!Not so with the mathematical definition!

If 1 1 then this class is fun.

Page 10: Propositional Logic

p p q may be expressed as q may be expressed as• p implies q• if p then q• p only if q (if ~q then ~p)• q if p• q follows from p• q provided p• q is a consequence of p• q whenever p• q is a necessary condition for p (if ~q then ~p)• p is a sufficient condition for q

Page 11: Propositional Logic

Converse & inverseConverse & inverse• The The converseconverse of p of p q is q q is q p. p.• The The inverseinverse of p of p q is ~p q is ~p ~q. ~q.• The The contrapositivecontrapositive of p of p q is ~q q is ~q ~p. ~p.• If p If p q then which, if any, is always true: q then which, if any, is always true:

• Its converse?• Its inverse?• Its contrapositive?Use a truth table to find the answer.

• Describe the contrapositive of p Describe the contrapositive of p q in terms of q in terms of converse & inverse.converse & inverse.

Page 12: Propositional Logic

Operator PrecedenceOperator Precedence

1.1. 2.2. 3.3. 4.4. 5.5. Thus, p Thus, p q q ~p ~p ~q means ~q means

(p (p q) q) ((~p) ((~p) (~q)). (~q)).

Page 13: Propositional Logic

Capturing the Capturing the formform of a of a Proposition in EnglishProposition in English

• Let Let gg, , hh, and , and bb be the propositions be the propositions• g: Grizzly bears have been seen in the area.• h: Hiking is safe on the trail.• b: Berries are ripe along the trail.

• Translate the following sentence using Translate the following sentence using gg, , hh, , and and bb, and logical operators:, and logical operators:If berries are ripe along the trail, hiking is safe on

the trail if and only if grizzly bears have not been seen in the area.

Page 14: Propositional Logic

1.1. If berries are ripe along the trail, hiking is If berries are ripe along the trail, hiking is safe on the trail if and only if grizzly bears safe on the trail if and only if grizzly bears have not been seen in the area.have not been seen in the area.

2.2. If If bb, (, (hh if and only if if and only if g). g).

3.3. bb ( ( hh gg).).

Page 15: Propositional Logic

CharactersCharacters