Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Peter Cappello 2013 Propositional Logic.

Similar presentations


Presentation on theme: "Copyright © Peter Cappello 2013 Propositional Logic."— Presentation transcript:

1 Copyright © Peter Cappello 2013 Propositional Logic

2 Copyright © Peter Cappello 2013 Sentence Restrictions Building more precise tools from less precise tools Precise use of natural language is difficult.Precise use of natural language is difficult. Want a notation that is suited to precision.Want a notation that is suited to precision. Restrict discussion to sentences that are:Restrict discussion to sentences that are: declarativedeclarative either true or false but not both.either true or false but not both. Such sentences are called propositions.Such sentences are called propositions.

3 Copyright © Peter Cappello 2013 Examples of Propositions Which of the sentences below are propositions? “Mastercharge, dig me into a hole!”“Mastercharge, dig me into a hole!” “Peter Cappello thinks this class is fascinating.”“Peter Cappello thinks this class is fascinating.” “Do I exist yet?”“Do I exist yet?” “This sentence is false.”“This sentence is false.”

4 Copyright © Peter Cappello 2013 Not Operator Not ( ~ ): p is true exactly when ~p is false.Not ( ~ ): p is true exactly when ~p is false. Let p denote “This class is the greatest entertainment since Game of Thrones.”Let p denote “This class is the greatest entertainment since Game of Thrones.” ~p denotes “It is not the case that this class is the greatest entertainment since Game of Thrones.”~p denotes “It is not the case that this class is the greatest entertainment since Game of Thrones.”

5 Copyright © Peter Cappello 2013 Or Operator (Disjunction) Or (  ): proposition p  q is true exactly when either p is true or q is true:

6 Copyright © Peter Cappello 2013 And Operator (Conjunction) And (  ): proposition p  q is true exactly when p is true and q is true:

7 Copyright © Peter Cappello 2013 If and Only If Operator (IFF) If and only if ( ↔ ): proposition p ↔ q is true exactly when (p  q) or (~ p  ~ q):

8 Copyright © Peter Cappello 2013 Exclusive-Or Exclusive-or ( ⊕ ) is the negation of ↔.

9 Copyright © Peter Cappello 2013 Implies Operator (If … Then) Implies ( → ): proposition p → q is true exactly when p is false or q is true:Implies ( → ): proposition p → q is true exactly when p is false or q is true:

10 Copyright © Peter Cappello 2013 If … Then... Example: “If pigs had wings they could fly.”Example: “If pigs had wings they could fly.” In English, implies normally connotes a causal relation:In English, implies normally connotes a causal 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 Peter hates Family Guy.

11 Copyright © Peter Cappello 2013 Converse & Inverse The converse of p →  q is q →  p.The converse of p →  q is q →  p. The inverse of p →  q is ~p →  ~q.The inverse of p →  q is ~p →  ~q. The contrapositive of p →  q is ~q →  ~p.The contrapositive of p →  q is ~q →  ~p. If p →  q then which, if any, is always true:If p →  q then which, if any, is always true: Its converse?Its converse? Its inverse?Its inverse? Its contrapositive?Its contrapositive? Use a truth table to find the answer. Describe the contrapositive of p →  q in terms of the converse & inverse.Describe the contrapositive of p →  q in terms of the converse & inverse.

12 Copyright © Peter Cappello 2013 p →  q may be expressed as p implies qp implies q if p then qif p then q q if pq if p q follows from pq follows from p q provided pq provided p q is a consequence of pq is a consequence of p q whenever pq whenever p p is a sufficient condition for qp is a sufficient condition for q p only if q (if ~q then ~p)p only if q (if ~q then ~p) q is a necessary condition for p (if ~q then ~p)q is a necessary condition for p (if ~q then ~p)

13 Copyright © Peter Cappello 2013 Abstraction Capture the logical form of a Proposition in English Let g, h, and b be propositions:Let g, h, and b be propositions: g : Grizzly bears have been seen in the area. g : Grizzly bears have been seen in the area. h : Hiking is safe on the trail. h : Hiking is safe on the trail. b : Berries are ripe along the trail. b : Berries are ripe along the trail. Translate the following sentence using g, h, and b, and logical operators:Translate the following sentence using g, h, and b, 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.

14 Copyright © Peter Cappello 2013 1. 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. 2. If b, ( h if and only if  g ). 3. b  →  ( h  ↔  g ).

15 Copyright © Peter Cappello 2011 Truth Table of a Compound Proposition bhg  g h  ↔  g b  →  ( h  ↔  g ) TTT TTF TFT TFF FTT FTF FFT FFF

16 Copyright © Peter Cappello 2013 System Specification Systems are increasing in complexity.Systems are increasing in complexity. e.g., software, hardware, workflow, security, legale.g., software, hardware, workflow, security, legal Can we know that a system works as intended?Can we know that a system works as intended? 1. Specify a set of desired system properties Each property is expressed as a compound proposition. 2. Verify that such a system is feasible. All compound propositions are simultaneously satisfiable. Z specification languageZ specification language Allow: http://alloy.mit.edu/alloy/Allow: http://alloy.mit.edu/alloy/

17 Copyright © Peter Cappello 2011 Google Search Operators Query: “US states” “income tax rate” Beatles: “Taxman” (Query: Beatles Taxman) Let me tell you how it will be There's one for you, nineteen for me 'Cause I'm the taxman, yeah, I'm the taxman Should five per cent appear too small Be thankful I don't take it all 'Cause I'm the taxman, yeah I'm the taxman If you drive a car, I'll tax the street, If you try to sit, I'll tax your seat. If you get too cold I'll tax the heat, If you take a walk, I'll tax your feet. Don't ask me what I want it for If you don't want to pay some more 'Cause I'm the taxman, yeah, I'm the taxman Now my advice for those who die Declare the pennies on your eyes 'Cause I'm the taxman, yeah, I'm the taxman And you're working for no one but me. http://http://support.google.com/websearch/answer/136861?hl=en.google.com/websearch/answer/136861?hl=en http://.google.com/websearch/answer/136861?hl=en


Download ppt "Copyright © Peter Cappello 2013 Propositional Logic."

Similar presentations


Ads by Google