Presentation is loading. Please wait.

Presentation is loading. Please wait.

Propositional Logic.

Similar presentations


Presentation on theme: "Propositional Logic."— Presentation transcript:

1 Propositional Logic

2 Proposition A proposition is a statement that is either true or false, but not both. Atlanta was the site of the 1996 Summer Olympic games. 1+1 = 2 3+1 = 5 Who will win the elections in Israel?

3 Definition 1. Negation of p
Let p be a proposition. The statement “It is not the case that p” is also a proposition, called the “negation of p” or ¬p (read “not p”) Table 1. The Truth Table for the Negation of a Proposition p ¬p T F F T p = The sky is blue. p = It is not the case that the sky is blue. p = The sky is not blue.

4 Definition 2. Conjunction of p and q
Let p and q be propositions. The proposition “p and q,” denoted by pq is true when both p and q are true and is false otherwise. This is called the conjunction of p and q. Table 2. The Truth Table for the Conjunction of two propositions p q pq T T T T F F F T F F F F

5 Definition 3. Disjunction of p and q
Let p and q be propositions. The proposition “p or q,” denoted by pq, is the proposition that is false when p and q are both false and true otherwise. Table 3. The Truth Table for the Disjunction of two propositions p q pq T T T T F T F T T F F F

6 Definition 5. Implication pq
Let p and q be propositions. The implication pq is the proposition that is false when p is true and q is false, and true otherwise. In this implication p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or consequence). Table 5. The Truth Table for the Implication of pq. p q pq T T T T F F F T T F F T

7 Implications How can both p and q be false, and pq be true?
Think of p as a “contract” and q as its “obligation” that is only carried out if the contract is valid. Example: “If you make more than $25,000, then you must file a tax return.” This says nothing about someone who makes less than $25,000. So the implication is true no matter what someone making less than $25,000 does. Another example: p: Bill Gates is poor. q: Pigs can fly. pq is always true because Bill Gates is not poor. Another way of saying the implication is “Pigs can fly whenever Bill Gates is poor” which is true since neither p nor q is true.

8 Definition 6. Biconditional
Let p and q be propositions. The biconditional pq is the proposition that is true when p and q have the same truth values and is false otherwise. “p if and only if q, p is necessary and sufficient for q” Table 6. The Truth Table for the biconditional pq. p q pq T T T T F F F T F F F T

9 Practice p: You learn the simple things well.
q: The difficult things become easy. The difficult things become easy but you did not learn the simple things well. You learn the simple things well but the difficult things did not become easy. You do not learn the simple things well. If you learn the simple things well then the difficult things become easy. If you do not learn the simple things well, then the difficult things will not become easy. p q  p pq p  q p  q

10 Truth Table Puzzle Steve would like to determine the relative salaries of three coworkers using two facts (all salaries are distinct): If Fred is not the highest paid of the three, then Janice is. If Janice is not the lowest paid, then Maggie is paid the most. Who is paid the most and who is paid the least?

11 p : Janice is paid the most. q: Maggie is paid the most.
r: Fred is paid the most. s: Janice is paid the least. p q r s rp s q (rp) (sq) T F F F T F F F T F T F T F F F T T T T T F T F F F T F F F T F T F F Fred, Maggie, Janice If Fred is not the highest paid of the three, then Janice is. If Janice is not the lowest paid, then Maggie is paid the most.

12 p : Janice is paid the most. q: Maggie is paid the most.
r: Fred is paid the most. s: Janice is paid the least. p q r s rp s q (rp) (sq) T F F F T T T F T F T F T F F F T T T F F F T F F F T F F F T F T T T Fred, Janice, Maggie or Janice, Maggie, Fred or Janice, Fred, Maggie If Fred is not the highest paid of the three, then Janice is. If Janice is the lowest paid, then Maggie is paid the most.

13 Logical Equivalence An important technique in proofs is to replace a statement with another statement that is “logically equivalent.” Tautology: compound proposition that is always true regardless of the truth values of the propositions in it. Contradiction: Compound proposition that is always false regardless of the truth values of the propositions in it.

14 Logically Equivalent Compound propositions P and Q are logically equivalent if PQ is a tautology. In other words, P and Q have the same truth values for all combinations of truth values of simple propositions. This is denoted: PQ (or by P Q)

15 Example: DeMorgans Prove that (pq)  (p  q)
p q (pq) (pq) p q (p  q) T T T F F T F F T F F F F T F F T F T F T F F F T T T T

16 Illustration of De Morgan’s Law
(pq) p q

17 Illustration of De Morgan’s Law
p p

18 Illustration of De Morgan’s Law
q q

19 Illustration of De Morgan’s Law
p  q p q

20 Example: Distribution
Prove that: p  (q  r)  (p  q)  (p  r) p q r qr p(qr) pq pr (pq)(pr) T T T T T T T T T T F F T T T T T F T F T T T T T F F F T T T T F T T T T T T T F T F F F T F F F F T F F F T F F F F F F F F F

21 Prove: pq(pq)  (qp)
p q pq pq qp (pq)(qp) T T T T T T T F F F T F F T F T F F F F T T T T We call this biconditional equivalence.

22 List of Logical Equivalences
pT  p; pF  p Identity Laws pT  T; pF  F Domination Laws pp  p; pp  p Idempotent Laws (p)  p Double Negation Law pq  qp; pq  qp Commutative Laws (pq) r  p (qr); (pq)  r  p  (qr) Associative Laws

23 List of Equivalences p(qr)  (pq)(pr) Distribution Laws
(pq)(p  q) De Morgan’s Laws (pq)(p  q) Miscellaneous p  p  T Or Tautology p  p  F And Contradiction (pq)  (p  q) Implication Equivalence pq(pq)  (qp) Biconditional Equivalence

24 Logic Logic is a language for reasoning.
It is a collection of rules that we use when doing logical reasoning. Human reasoning has been observed over centuries from at least the times of Greeks, and patterns appearing in reasoning have been extracted, abstracted, and streamlined.

25 Propositional Logic Propositional logic is a logic about truth and falsity of sentences. The smallest unit of propositional logic is thus a sentence. No analysis will be done to the components of a sentence. We are only interested in true or false sentences, but not both. Sentences that are either true or false are called propositions (or statements).

26 Propositions If a proposition is true, then we say it has a truth value of "true"; if a proposition is false, its truth value is "false". E.g.: 1. Ten is less than seven 2. 10 > 5 3. Open the door. 4. how are you? 5. She is very talented 6. There are life forms on other planets 7. x is great than 3 (1) and (2) are propositions (or statements). (1) is false and (2) is true. (3) – (7) are not propositions

27 Identifying logical forms
argument 1 and 2 have the same form. If Jane is a math major or Jane is a computer major, then Jane will take Math 150. Jane is a computer science major Therefore Jane will take Math 150 2. If logic is easy or I will study hard , then I will get a A in this course . I will study hard Therefore, I will get a A in this course Logic form: if P or Q, then R Q Therefore, R

28 Logic Connectives Simple sentences which are true or false are basic propositions. Larger and more complex sentences are constructed from basic propositions by combining them using connectives. Thus, propositions and connectives are the basic elements of propositional logic. English word Connective Symbol Not Negation  () And Conjunction  Or Disjunction  If then Implication   if and only if Equivalence 

29 Construction of Complex Propositions
Let X and Y represent arbitrary propositions. Then (X),   (X  Y), (X  Y), (X  Y), and (X  Y), are propositions. E.g., (A)  (B  C) is a proposition. It is obtained by first constructing (A) by applying (X), (B V C) by applying (X  Y) to propositions B and C, and then by applying (X  Y) to the two propositions (A)  (B  C) considering them as X and Y, respectively. A well-formed formula (wff): A legitimate string yes: (A)  (B  C) no: ((A  BC((

30 Logical Reasoning Logical reasoning is the process of drawing conclusions from premises using rules of inference These inference rules are results of observations of human reasoning over centuries. They have contributed significantly to the scientific and engineering progress of the mankind. Today they are universally accepted as the rules of logical reasoning and they should be followed in our reasoning.

31 Valid and invalid arguments
An argument is a sequence of statements. All statements but the final one are called premises (assumptions or hypotheses). The final statement is called the conclusion. The symbol , read “therefore” is normally placed just before the conclusion. “An argument form is valid” means that no matter what statements are substituted for the statement variables in its premises, if the resulting premises are all true, then the conclusion is also true. A valid argument is called a proof.

32 Reasoning with Propositions
The basic inference rule is modus ponens. It states that if both P  Q and P hold, then Q can be concluded, and it is written as P P  Q  Q The lines above the dotted line are premises and the line below is the conclusion drawn from the premises.

33 Some more modus tollens Q P  Q ---------  P
Conjunctive Simplification P  Q  P Conjunctive addition P Q  P  Q Rule of contradiction P  c, where c is a contradiction  P

34 Yet some more Disjunctive Addition P -------------  P  Q
Disjunctive syllogism P  Q Q  P Hypothetical syllogism P  Q Q  R  P  R Dilemma: proof by division into cases P  Q P  R Q  R  R

35 Proof A proof is a sequence of sentences, where each sentence is either a premise or a sentence derived from earlier sentences in the proof by one of the rules of inference. The last sentence is the theorem (also called goal or query) that we want to prove.

36 A complex example If my glasses are on the kitchen table, then I saw them at breakfast. I was reading the newspaper in the living room or I was reading the newspaper in the kitchen. If I was reading the newspaper in the living room, then my glasses are on the coffee table. I did not see my glasses at breakfast. If I was reading my book in bed, then my glasses are on the bed table. If I was reading the newspaper in the kitchen, then my glasses are on the kitchen table. Where are the glasses?

37 Translate them into symbols
P = my glasses are on the kitchen table, Q = I saw my glasses at breakfast. R = I was reading the newspaper in the living room S = I was reading the newspaper in the kitchen. T = my glasses are on the coffee table. U = I was reading my book in bed. V= my glasses are on the bed table. Statements in the previous slide are translated as follows: 1. P  Q R  S 3. R  T Q 5. U  V S  P

38 Example: weather problem
If it is humid, it is hot. If it’s hot & humid, it’s raining. It is humid.

39 Example for the “weather problem” given above.
1 Hu Premise “It is humid” 2 HuHo Premise “If it is humid, it is hot” 3 Ho Modus Ponens(1,2) “It is hot” 4 (HoHu)R Premise “If it’s hot & humid, it’s raining” 5 HoHu And Introduction(1,2) “It is hot and humid” 6 R Modus Ponens(4,5) “It is raining”

40 Entailment Entailment: KB |= Q
Q is entailed by KB (a set of premises or assumptions) if and only if there is no logically possible world in which Q is false while all the premises in KB are true. Or, stated positively, Q is entailed by KB if and only if the conclusion is true in every logically possible world in which all the premises in KB are true.

41 derivation Derivation: KB |- Q
We can derive Q from KB if there is a proof consisting of a sequence of valid inference steps starting from the premises in KB and resulting in Q

42 Two important properties for inference
1. Soundness 2. Completeness

43 Soundness: If KB |- Q then KB |= Q
If Q is derived from a set of sentences KB using a given set of rules of inference, then Q is entailed by KB. Hence, inference produces only real entailments, or any sentence that follows deductively from the premises is valid.

44 Completeness: If KB |= Q then KB |- Q
If Q is entailed by a set of sentences KB, then Q can be derived from KB using the rules of inference. Hence, inference produces all entailments, or all valid sentences can be proved from the premises.

45 Logics Logics are formal languages for representing information such that conclusions can be drawn Syntax: defines the sentences in the language Semantics: define the “meaning” of sentences: i.e., define true of a sentence in a world Example: arithmetic

46 Worlds in Propositional Logic
Assignment of a truth value – true or false – to every atomic sentence Examples: Let A, B, C, and D be the propositional symbols is m = {A=true, B=false, C=false, D=true} a world? is m’ = {A=true, B=false, C=false} a world? How many worlds can be defined over n propositional symbols?

47 Models A world is a possible truth assignment to the propositional symbols. Given a world m, we say m is a model of a sentence  if  is true in m M() is the set of all models of  Then KB  if and only if M(KB)  M() M() M(KB)

48 Inference KB |-i  : sentence  can be derived from KB by procedure i
Soundness: i is sound if whenever KB |-i  it is also true that KB  Completeness: i is complete if whenever KB  it is also true that KB |-i 

49 Examples of Logics Propositional calculus A  B  C
First-order predicate calculus ( x)( y) Mother(y,x) Logic of Belief B(John,Father(Zeus,Cronus))

50 Semantics of PL It specifies how to determine the truth value of any sentence in a world m The truth value of True is True The truth value of False is False The truth value of each atomic sentence is given by m The truth value of every other sentence is obtained recursively by using truth tables

51 Truth Tables A B  A A  B A  B A  B True False

52 Satisfiability of a KB A KB is satisfiable iff it admits at least one model; otherwise it is unsatisfiable KB1 = {P, QR} is satisfiable KB2 = {PP} is satisifiable KB3 = {P, P} is unsatisfiable valid sentence or tautology

53 Proof Methods Applications of inference rules Model checking
Legitimate (sound) generation of new sentences from old Proof = a sequence of inference rule applications Model checking Truth table enumeration (exponential in n) Improved backtracking Heuristic search in model space (sound but incomplete) e.g. min-conflicts like hill-climbing algorithms

54 Inference Rule: Modus Ponens
{  ,  } 

55 Example: Modus Ponens {  ,  }  
{  ,  }  Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Battery-OK  Bulbs-OK

56 Example: Modus Ponens {  ,  }  
{  ,  }  Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Battery-OK  Bulbs-OK

57 Example: Modus Ponens {  ,  }  
{  ,  }  Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Battery-OK  Bulbs-OK

58 Example: Modus Ponens {  ,  }  
{  ,  }  Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Battery-OK  Bulbs-OK Headlights-Work

59 Review: 2 Important Properties
#1: If KB |- Q then KB |= Q If Q is derived from a set of sentences KB using a given set of rules of inference, then Q is entailed by KB. Hence, inference produces only real entailments, or any sentence that follows deductively from the premises is valid. #2: If KB |= Q then KB |- Q If Q is entailed by a set of sentences KB, then Q can be derived from KB using the rules of inference. Hence, inference produces all entailments, or all valid sentences can be proved from the premises. Soundness Completeness

60 Summary Basic concepts of logic: Syntax: formal structure of sentences
Semantics: truth of sentences wrt worlds Entailment: necessary truth of one sentence given another Inference: deriving sentences from other sentences Soundness: derivations produce only entailed sentences Completeness: derivations can produce all entailed sentences


Download ppt "Propositional Logic."

Similar presentations


Ads by Google