prop logic

125
Propositional Logic: Basics A. V. Ravishankar Sarma Indian Institute of Technology Kanpur [email protected] May 21, 2014 Revised: May 21, 2014 A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 1 / 125

Upload: navneet-chaubey

Post on 28-Dec-2015

63 views

Category:

Documents


1 download

DESCRIPTION

propsitional logic

TRANSCRIPT

Page 1: Prop Logic

Propositional Logic: Basics

A. V. Ravishankar Sarma

Indian Institute of Technology [email protected]

May 21, 2014

Revised: May 21, 2014

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 1 / 125

Page 2: Prop Logic

What is Propositional Logic?

1 It is a systematic study of logical propositions and it deals with theanalysis of truth functional connectives (or, and, if, not, iff).

2 Most basic logical inferences are about expressions that arecombinations of sentences involving not, or, and, if, iff.

3 The formal language used to express sentential formulas- sententiallanguage.

4 The Truth functional calculas or propositional calculas is a logicalstudy of those statements whose truth values are determined by thetruth values of their component parts.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 2 / 125

Page 3: Prop Logic

Four examples where we use PL

1 Logical reasoning, and in the argumentation involved in day to daydiscourse.

2 Mathematical Reasoning.3 Analysis of simple digital switching circuits.4 Knowledge Representation (AI)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 3 / 125

Page 4: Prop Logic

Outline:Propositional Logic

1 Syntax and Semantics of Propositional Logic2 Translation of English language sentences to the Language of

Propositional Logic3 Tautologies, contradictions, contingent propositions,4 Syntactic and Semantic Validity.5 Decision, Proof Procedures(Semantic):

1 Truth Table Method/Indirect Truth Table Method2 Semantic Tableaux or Tree Method3 Conjunctive and Disjunctive Normal Forms (CNF and DNF)4 Resolution and refutation method.

6 Syntactic Methods: Natural Deduction

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 4 / 125

Page 5: Prop Logic

What is Propositional Logic?

1 Branch of Formal Logic and the basic units are Sentences.2 Example: Socrates is Wise (W).3 It only deals with constants that stand for entire natural language

sentences and the ways these constants may be combined to formmore complex expressions.

4 Sentential logic is concerned only with the way in which simplesentences are combined by means of sentential operators into morecomplex sentences.

5 It has no Quantifiers6 The sentences that are generated from the other sentential

connectives (or, and, implies,) are compound sentences7 Mars is a planet which has no satellites. Mars is a planet and Mars

has satellites (Where the second sentence is false.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 5 / 125

Page 6: Prop Logic

Some Questions

1 What does it mean for one sentence to follow logically from certainothers?

2 If a sentence does follow logically from certain others, what methodsof proof might be necessary to establish this fact?

3 Is there a gap between what we can prove in an axiomatic system (sayfor the natural numbers) and what is true about the natural numbers?

4 What is the connection between logic and computability?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 6 / 125

Page 7: Prop Logic

Alfred North Whitehead

Alfred North Whitehead, one of the foremost pioneers in symbolic logic,declares: [B]y the aid of symbolism, we can make transitions in reasoningalmost mechanically by the eye, which otherwise would call into play thehigher faculties of the brain.WHITEHEAD, AN INTRODUCTION TO MATHEMATICS 61 (1911).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 7 / 125

Page 8: Prop Logic

Why Formal Language?

Reasons1 English (and any natural language in general) is such a rich language

that it cannot be formally described.2 meaning of an English sentence can be ambiguous, subject to different

interpretations depending on the context and implicit assumptions.3 Natural languages tend to be verbose, and even fairly simple

mathematical statements become exceedingly long (and unclear)when expressed in them.

If the object of our study is to carry out precise rigorous arguments aboutassertions and proofs, a precise language whose syntax can be completelydescribed in a few simple rules and whose semantics can be definedunambiguously is required.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 8 / 125

Page 9: Prop Logic

Two different ways of using Language of Logic:

Syntax1 For instance, a language can be used as a deduction system (or proof

system); that is, to construct proofs or refutations. This use of alogical language is called proof theory.

2 When using logic as a proof system, one is not concerned with themeaning of the statements that are manipulated, but with thearrangement of these statements, and specifically, whether proofs orrefutations can be constructed.

3 This use of logic is similar to game playing. Certain facts and rulesare given, and it is assumed that the players are perfect, in the sensethat they always obey the rules.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 9 / 125

Page 10: Prop Logic

Semantics

1 The second use of a formal language is for expressing statements thatreceive a meaning when they are given what is called aninterpretation.

2 In this case, the language of logic is used to formalize properties ofstructures, and determine when a statement is true of a structure.This use of a logical language is called model theory.

3 A statement true under all interpretations of the parameters is said tobe valid.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 10 / 125

Page 11: Prop Logic

Syntax of Propositional Logic

Definition (Formal Language)A formal language consists of a set of symbols together with a set of rulesfor forming grammatically correct strings of symbols in this language.

Definition (String)A string or word in a formal language is any finite sequence of the symbolsin the language. We include in this the empty string containing nosymbols at all.

Example (String)p ∨ pq)⇒ pqr , (p ∧ q), p)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 11 / 125

Page 12: Prop Logic

Symbols in Propositional Logic:

In the language of propositional logic we have the following list of symbols1 propositional variables: this is an infinite list p1; p2; p2;. . . . . . of

symbols. We often use p; q; r;. . . . . . to denote propositional variables.2 symbols for the (common) propositional connectives: ¬,∨,∧,→, ↔3 parentheses: (, ).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 12 / 125

Page 13: Prop Logic

Well formed Formulas

Definition (Wffs)1 Every propositional variable P is a well formed formula.2 If A is a wff, so is ¬A.3 If A; B are formulas, so are ¬A, (A ∧ B), (A ∨ B), (A→ B), and

(A↔ B).

NoteThus a string A is a wff exactly when there is a finite sequenceA1; . . . . . . . . . ; An (called a parsing sequence) such that An = A and foreach 1 ≤ i ≤ n, Ai is either (1) a propositional variable, (2) for somej < i , Ai = Aj , or (3) for some j , k < i , Ai = (Aj ∗ Ak), where ∗ is one of¬,∨, ∧,→,↔

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 13 / 125

Page 14: Prop Logic

Recursive Definition of Wff

1 (Base clause) Any statement constant or propositional variable is aWff.

2 (Recursion clause) If P and Q are well formed formulas, so are thefollowing: P ∨ Q, P ∧ Q, P → Q, ¬P, P ↔ Q.

3 (Closure clause) Nothing will count as a Wff unless it can beconstructed according to clauses I and 2.

It is recursive, or generative, definition, because it tells us exactly how togenerate instances of the things we are trying to define.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 14 / 125

Page 15: Prop Logic

Parentheses and Conenctives

Standard Rules:Apply the conenctives, inserting parenthesis if needed in the followingpreferential order:

1 ¬ Applies to shortest proposition to its right.2 ∧ Applies to shortest proposition on each side of it.3 ∨ Applies to shortest proposition on each side of it.4 → Applies to shortest proposition on each side of it.5 ↔ Applies to shortest proposition on each side of it.

If at any time you are with repeats of the some connective, group themworking from the left to right.(A ∨ B ∨ C).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 15 / 125

Page 16: Prop Logic

Convention

ConventionWe can omit the use of parenthesis by assigning decreasing ranks to thepropositional connectives as follows: ↔, →, ∧, ∨,¬. The connective withgreater rank always reaches further.First preference is given to ¬ and then ∨ etc.

Example (Wff’s)1 p → q ∧ r ∨ s is written as p → (q ∧ (r ∨ s)).2 p → ¬p ∨ ¬q ∧ p ↔ q is written as ??3 p ∨ ¬(q ∧ r)↔ p???

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 16 / 125

Page 17: Prop Logic

Exercise:

Use conventions to eliminate as many parentheses as possible.1 A ∨ B ∧ C ↔ D → F2 (((P → Q) ∧ ¬Q)→ ¬P). (P → Q) ∧ ¬Q → ¬P.3 ¬[P → (P → Q)]

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 17 / 125

Page 18: Prop Logic

Definitions

1 A sentence is compound if it logically contains another completesentence as a component.

2 A sentence is simple if and only if it is not compound.3 One sentence is a component of another sentence if, whenever the

first sentence is replaced by any other declarative sentence, the resultis still a grammatical sentence..

4 A sentential operator is an expression containing blanks such that,when the blanks are filled with complete sentences, the result is asentence.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 18 / 125

Page 19: Prop Logic

Main Logical Connective

The main logical operator in a compound statement is the one thatgoverns the largest component or components of a compound statement.A minor logical operator governs smaller components

Example (Main Logical Connective)¬[(p → q) ∧ p)]¬ is the main logical operator whereas → and ∧ are the minor logicaloperator.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 19 / 125

Page 20: Prop Logic

Truth Functional Connectives

1 The truth value of the compound that they form can be determinedsolely by the truth values of their components.

2 This means that there will be a rule telling us exactly what the valueof the compound must be for each combination of values for thecomponents.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 20 / 125

Page 21: Prop Logic

Negation: ¬

1 Not p [or the result of transforming p by putting not just after theverb or an auxiliary verb]

2 p does not hold3 It is not the case that p4 p isn’t so.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 21 / 125

Page 22: Prop Logic

Inclusive OR: P ∨ Q

1 P or Q or both.2 P or Q [sometimes(s)]3 P unless Q [s]4 P and/or Q [in legal documents]5 Either P or Q [s]6 P except when Q [s]

Neither P nor Q: ¬(P ∨ Q)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 22 / 125

Page 23: Prop Logic

Conjunction:P ∧ Q

1 p and q; p but q;2 p despite the fact that q; p although q; p though q; p even though q.3 p while q; p moreover q; not only p but also q4 p, albeit q; p, whereas q; p for q.5 p no sooner than q; p, still q; p besides q.6 p on the other hand q.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 23 / 125

Page 24: Prop Logic

Disjunction:inclusive

(p ∨ q)1 p or q2 Either p or q3 p or q or both.4 p, or alternatively q.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 24 / 125

Page 25: Prop Logic

Conditionals: (p → q)

1 If p then q; If p, q; Provided that p, then q.2 on the condition that P, then q3 IN the circumstance that p, then q4 Int he event that p, then q; in case of p, then q5 Assuming that p, then q; on the supposition that p then q.6 granting that p, then q; given that p then q; p only if q;

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 25 / 125

Page 26: Prop Logic

Conditionals: (q → p)

1 p if q; p when q p so long as q.2 p provided that q; p on the condition that q; p inn the circumstance

that q.3 p in the event that q; p in case q; p assuming that q;4 p on the supposition that q; p granting taht q;5 p given that q.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 26 / 125

Page 27: Prop Logic

Biconditionals:

(p ↔ q)1 p if and only if q; p when and only when q2 p if q otherwise not.3 p just in case q4 p whether or not q p5 p even if q p.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 27 / 125

Page 28: Prop Logic

Complex Connecting Words:

1 Neither p nor q: ¬(p ∨ q).2 p unless q(inclusive): ¬q → p3 p except if q(inclusive); (¬q → p)

4 p or q (exclusive); p or q, but not both; p unless q(exclusive); pexcept if q(exclusive); (p ∨ q) ∧ ¬(p ∧ q).

5 p rather than q; p instead of q; p without q: (p ∧ ¬q)

6 p if q, in which case r: [q → p) ∧ (p → r)]

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 28 / 125

Page 29: Prop Logic

Example:

1 A man is either mentally deficient or mentally healthy.(D, H) D ∨ H2 Either we accept Quantum mechanics or we study objects larger than

atomic size.(M, O). M ∨ O.3 You must pass this course or make up your credit hours in some other

way.(C, H). C ∨ H.4 A successful man is either intellectually creative and/or mentally

dynamic (C, D) C ∨ D

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 29 / 125

Page 30: Prop Logic

Exclusive OR: (P ∨ Q) ∧ ¬(P ∧ Q)

1 P or Q but not both.2 P or Q [s].3 Either P or Q [s]4 P unless Q [s]5 P except when Q [s]6 P or else Q [s]

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 30 / 125

Page 31: Prop Logic

Example

1 Logical Positivists maintain that meanigful statements are eitherempirical or analytic, but not both(E, A). E ∨ A.

2

3 You must pass this course or make up your credit hours in some otherway.(C, H). C ∨ H. Both inclusive and exclusive.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 31 / 125

Page 32: Prop Logic

Conjunction:P ∧ Q

1 P and Q.2 P but Q3 P although Q. P nonetheless Q.4 Both P and qQ; P nevertheless Q.5 Not only P but Q6 P despite Q7 P yet Q8 P while Q.9 P moreover Q,P however Q.10 Whereas

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 32 / 125

Page 33: Prop Logic

Example

1 It is not necessary to give up Newtonian Mechanics even though weaccept Quantum Mechanics(M, T). ¬M ∧ T

2 The Government declared war in spite of the fact that it did not wantto do so.(G,W). G ∧ ¬W

3 While theory construction is often seen as a goal in its own right, stillit must be related to empirical research.(C,R). C ∧ R

4 Any body may be electrically charged under proper conditions, butnot every body seems to have very strong magnetic properties.(C,P)C ∧ ¬P.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 33 / 125

Page 34: Prop Logic

Examples: Conjunction

1 it is raining, but I am happy2 although it is raining, I am happy3 it is raining, yet I am happy4 it is raining and I am happy

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 34 / 125

Page 35: Prop Logic

Implication: P → Q

1 If P, then Q2 When P, then Q.3 In case P, Q.4 Q provided that P5 P is (a) sufficient (condition) for Q6 Q is (a) necessary (condition) for P

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 35 / 125

Page 36: Prop Logic

Implication

1 P implies Q.2 Q if P.3 Q when P;4 Q in case P;5 P only if Q;6 P only when Q;7 P only in case Q;

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 36 / 125

Page 37: Prop Logic

Translation guide: if p then q

if A then BA→ B.

1 if A then B2 A only if B.3 B if A4 A implies B5 It follows from A that B.6 Whenever A, B7 A is sufficient condition for B8 B is necessary condition for A.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 37 / 125

Page 38: Prop Logic

Unless

1 A unless B can be approximated as ¬A→ B.2 I go swimming unless it rains= If it is not raining then I go swimming.3 I don’t go swimming unless the sun shines = If the sun does not shine

then I don’t go swimming.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 38 / 125

Page 39: Prop Logic

Implication: Example

1 If the Taj Mahal is in Agra, then the Taj Mahal is in India.2 If the Taj Mahal is in Agra, then the Tajmahal is in Singapore.3 If Tajmahal is in Andhra pradesh , then the tajmahal is India.4 If the Taj Mahal is in AP, then the Tajmahal is in Kerala.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 39 / 125

Page 40: Prop Logic

Unless. . .

1 One of the more confusing English words to translate is unless.2 This word expresses a dependency between two propositions, but one

which is not always as straightforward as the conditional withif. . . . . . then.

3 In strong sense it is equivalent to if and only if not, and in the weaksense it is translated as if not.

4 The library will remain till 11PM(O) from Mon-Saturday unless it isSunday or public holiday (O ↔ ¬(S ∨ P)). .

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 40 / 125

Page 41: Prop Logic

Necessary and sufficient conditions:

Examples:1 Being a bachelor is sufficient for being a male. Being male is

necessary for being a bachelor2 Q unless P: Q is necessary for not P; Not P is sufficient for Q.

(¬P → Q).3 Q if P: Q is necessary for P; P is sufficient for Q. (P → Q)4 Q provided that P: Q is necessary for P; P is sufficient for Q (P → Q).5 P only if Q:Q is necessary for P; P is sufficient for Q.(P → Q)6 When P then Q; Q is necessary for P; and P is sufficient for Q.

(P → Q)7 All P’s are Q’s: Q is necessary for P; and P is sufficient for Q

(P → Q)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 41 / 125

Page 42: Prop Logic

iff: P ↔ Q

1 P if and only if Q2 P if Q, and Q if P3 P exactly if Q4 P is (a) necessary and sufficient (condition) for Q: P iff Q5 If P then Q, and conversely

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 42 / 125

Page 43: Prop Logic

Exercise:

Paraphrase the following statements into the sentential language using thesuggested letters for the simple statements.

1 Only those who do exercises will pass logic. (E, P):(P → E )

2 This litmus paper turns red if it is placed in acid. (R, A)(R → A).3 This litmus paper has been placed in acid only if it turns red. (A,

R):A→ R4 You won’t pass the course unless you do the exercises. (P, E)5 If you do the exercises you will pass the course provided that you are

diligent and intelligent. (E, P, D,I):(E ∧ D ∧ I)→ P)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 43 / 125

Page 44: Prop Logic

Translation: Some Examples

1 Ravi and Priya go to the movie while Sita goes to work.((r ∧ p) ∧ s)2 Inorder for Ravi to go to the Movie, it is necessary that Sita goes to

the school.R → S.3 Ravi goes to the Movie only if Sita goes to the School.R → S.4 Ravi goes to the movie if Sita stays home.S → R.5 Ravi will fail the exam unless he studies. f ∨ s.6 We will have picnic unless(exclusive) it rains.p ∨ q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 44 / 125

Page 45: Prop Logic

Examples of translation

1 There is little doubt in the scientific community that carbon emissionscontribute to global warming. If carbon emissions contribute to globalwarming, then we should reduce our carbon footprint. Therefore, weshould reduce our carbon footprint. (C: Carbon emissions contributeto global warming; R: We should reduce our carbon footprint)

2 If Dostoyevsky was right, then everything is permissible if God doesnot exist. But it is not true that if God does not exist, everything ispermissible. Therefore, Dostoyevsky was not right. (D: Dostoyevskywas right; E: Everything is permissible; G: God exists)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 45 / 125

Page 46: Prop Logic

Knights and Knaves

On a distant island, every inhabitant is either a Knight or Knave. Knightsonly tell the truth. Knaves only tell lies.everything said by a Knave is false.You meet three inhabitants: A, B and C. A says, C is not a Knave. B says,C and A are both Knights. C says, A is a Knight or B is a Knave. Which,if any, are Knights? Which, if any, are Knaves?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 46 / 125

Page 47: Prop Logic

Semantics of Propositional Logic

1 Meaning of a formula means providing truth conditions for it.2 An interpretation or valuation of a language is an assignment of

meanings to its various symbols or its wffs.3 A valuation v is a function from propositional symbols to the boolean

set B = {T ,F}, i.e. v : P → B

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 47 / 125

Page 48: Prop Logic

Valuation extended to propositional wff’s

1 v(T ) = true and v(F ) = F2 v(A ∧ B) = T if v(A) = v(B) = T ; v(A ∧ B) = F .3 v(A ∨ B) = F if v(A) = v(B) = F ; v(A ∨ B) = T otherwise.4 v(A→ B) = F v(A) = T and v(B) = F ; v(A→ B) = T otherwise.5 v(A↔ B) = T if v(A) = v(B); v(A↔ B) = F otherwise6 v(¬A) = T if v(A) = F ; v(¬A) = F if v(A) = T .

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 48 / 125

Page 49: Prop Logic

Some Definitions: Validity

1 Validity: A propositional wff A is valid if for every valuation v wehave v(A) = T .

2 Under all interpretations the the formula is true. It is also calledTautology. All tautologies are valid wffs.

1 p ∧ (p → q)→ qValid2 q ∧ (p → q)→ pInvalid

3 A pwff A is valid if for every valuation v we have v(A) = T (and it isinvalid otherwise)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 49 / 125

Page 50: Prop Logic

Inconsistency:

1 A wff is is said to be inconsistent if it comes out F’s for all possiblecombinations of input values. Example: p ∧ ¬p.

2 A wff is said to be contingent iff it has occurrences of both T and Fin its truth table. Truth depends upon the facts, not on the logicalform. Example: p ∨ q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 50 / 125

Page 51: Prop Logic

Satisfiability:

1 Satisfiability: A pwff A is satisfiable if there is at least one valuationv such that v(A) = T (and it is unsatisfiable otherwise)

2 Note: A is unsatisfiable iff ¬A is valid.3 p → (q → p)

4 (p → q)→ (q → ¬p)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 51 / 125

Page 52: Prop Logic

Logical equivalence

1 Two propositional wffs A and B are equivalent if for every valuation vwe have v(A) = v(B)

2 A and B are equivalent iff A↔ B is valid.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 52 / 125

Page 53: Prop Logic

Logical Consequence:

1 A propositional well formed formula(pwff) A is a logical consequenceof a finite set of pwff S if for every valuation v such that v(B) = Tfor every B ∈ S we have v(A) = T .

2 A |= B, under all interpretations in which B is true A is also true.3 {p, p → q} |= q4 Check whether the following holds. {p, (p ∧ ¬q),¬p} |= ¬p → ¬q5 A |= B iff |= A→ B, i,e the RHS is a tautology or Valid.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 53 / 125

Page 54: Prop Logic

Logical Consequence

Definition (Logical Consequence)Let Γ be a set of formulas and φ a formula involving propositionalvariables in a set P . Then φ is a logical consequence of Γ, or equivalentlyΓ logically implies φ, when for all truth assignments v on P , if v(λ) = Tfor all λ ∈ Γ, then v(φ) = T . We write this as Γ |= φ.In the case where Γ is the empty set, we write |= φ to say that for all truthassignments v , v(φ) = T , i.e. φ is a tautology.When φ is not a logical consequence of Γ, we write Γ when φ is not atautology, we write 6|= φ.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 54 / 125

Page 55: Prop Logic

Logical Consequence: Example

1 {p ∧ r ,¬q ∨ (p ∧ ¬p)} |= (p ∧ ¬q)→ r .2 {p, p → q} 6|= ¬q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 55 / 125

Page 56: Prop Logic

Satisfiability

Definition (Satisfiability)The set Γ of formulas is satisfiable if there is some truth assignment vwhich satisfies Γ, i.e. v(λ) = T for all λ ∈ Γ.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 56 / 125

Page 57: Prop Logic

Satisfiability:

Another description of Γ |= φ is that every truth assignment satisfying Γalso satisfies φ. Informally, φ is true whenever Γ is true.

Example1 p ∧ q |= q2 p ∨ q 6|= q.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 57 / 125

Page 58: Prop Logic

Sentential Operators

1 a sentential operator is an expression containing blanks such thatwhen the blanks are filled with complete sentences, the result is asentence.

2 Example: The conjunction operator, then, would be “. . . . . . and. . . . . . ”

3 The company is bankrupt and all the workers are laid off.4 The other sentential operators in Propositional logic are: or, and,

implies, it is not the case that, if and only if.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 58 / 125

Page 59: Prop Logic

Intensional operators in English Language:

Intensional contexts are statements that report on how a proposition isrepresented to, or in a person or thing capable of representation. Theymight report on someone’s state of mind or utterances. John believesthat. . .Johns knows that. . .John hopes that. . .John heard that. . .Science proves that ghosts does not exist.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 59 / 125

Page 60: Prop Logic

Sentential Operators in the natural Language:

It is possible that. . . ; It is necessary that. . . ; It is likely that. . . ; It is nottrue that. . . ;Either; or; Neither; or; and; If. . . , then . . . ; . . . if and only if . . . ; unless;after; . . . only if. . . ;

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 60 / 125

Page 61: Prop Logic

Non truth functional usage:

Example1 I became sick and I went to see the doctor.2 If Germany’s U-boats had been able to shut off the flow of supplies to

Great Britain, then Germany would have won the war.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 61 / 125

Page 62: Prop Logic

Truth Functional Connectives

Truth Functional ConnectivesA sentential connective is used truth functionally if and only if it is used togenerate a compound sentence from one or more sentences in such a waythat the truth-value of the generated compound sentence is whollydetermined by the truth values of those one or more sentences from whichthe compound sentence is generated, no matter what those truth valuesmay be.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 62 / 125

Page 63: Prop Logic

Truth Tables:

Negationp ¬pT FF T

Other Connectivesp q p ∧ qT T TT F FF F FF F F

p q p ∨ qT T T/FT F TF F TF F F

p q p → qT T TT F FF T TF F T

p q p ↔ qT T TT F FF T FF F T

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 63 / 125

Page 64: Prop Logic

Use of Truth Tables:

Truth tables are used to determine:1 to determine whether a proposition is a logical truth or a logical

falsehood;2 to determine whether a set of sentences is satisfiable (i.e. whether the

sentences can be simultaneously true);3 to determine whether two propositions are logically equivalent;4 to determine whether one proposition follows from another; and to

determine the validity of an argument

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 64 / 125

Page 65: Prop Logic

Strategy for constructing truth table:

1 Across the top of the left-hand side of the table, list each primitiveproposition that occurs in p.

2 Beneath this, fill in each combination of T’s and F’s, beginning withan ‘F’ beneath each primitive proposition and ending each columnwith a ‘T’.

3 Write out the proposition p across the top of the right hand side ofthe table. Leave some space between each symbol.

4 Starting with the smallest subformulas of p (i.e. those nearest the topof p’s construction tree), fill in the column under the main connectiveof those subformulas with ‘F’s and ‘T’s according to the truth tablefor the connective in question.

5 Repeat the previous step until there is a column of ’s and ‘T’s undereach connective. Now highlight the column under ’p’s mainconnective, as this is the information that we are looking for.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 65 / 125

Page 66: Prop Logic

Construct Truth Table for the formulas:

1 p ∧ q ∨ (¬p ∨ ¬q)

2 (p ∧ q) ∧ (¬p ∨ ¬q).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 66 / 125

Page 67: Prop Logic

Tautologies, contradictions, contingent statements

1 Tautologies have only ‘T’s in the main column of their truth table.2 A statement is a contradiction if and only if it is false on every

assignment of truth values to its atomic components.3 A statement is contingent if and only if it is true on some assignments

of truth values to its atomic components and false on others.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 67 / 125

Page 68: Prop Logic

Examples:

Using truth tables, determine which of the following are tautologies. Forany that are not, give a valuation which does not satisfy the sentence.

1 (p → ¬q)→ ¬(p → q)

2 (p → ¬q)→ ¬p3 (p → q)→ ¬(q → p)

4 ¬(q → p)→ (p → q)

5 (p → (q → r))→ (p ∧ q → r)

6 (p ∧ q → r)→ (p → (q → r)).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 68 / 125

Page 69: Prop Logic

Procedure for consistency, inconsistency

1 Symbolize all the propositions of the argument in question.2 Put the premises in conjunction- if there is more than one- by pairs,

associating to the left.3 Construct a truth table for this conjunction.4 If the conjunction is tautological or contingent, the premises are

consistent. If the conjunction is contradictory, the premises areinconsistent. In other words, premises of an argument are consistent ifthere is atleast one interpretation making them all true.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 69 / 125

Page 70: Prop Logic

Procedure for finding Logical Equivalence:

1 Symbolize all the propositions of the argument in question.2 From these two symbolized statements, construct a third statement

of the for p ↔ q, where p is one of the original symbolizedstatements and q the other.

3 Construct the truth table analysis of this biconditional.4 If the biconditional) is either contingent or contradictory, the original

two statements are not logically equivalent. But, if the biconditionalis tautological, the original two statements are logically equivalent.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 70 / 125

Page 71: Prop Logic

Logical Equivalence:Example

1 If the Neuron is alive(A) and fires(F), then it has a given minimumnumber of excitatory fibres(N). (A ∧ F )→ N.

2 If the Neuron is alive, it has a given number of excitatory fiberswhenever it fires. A→ (F → N).

[A ∧ (F → N)]↔ [A→ (F → N)] is a Tautology.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 71 / 125

Page 72: Prop Logic

Example: Tautology

Unless food prices continue to rise or building costs soar, the general livingindex will not remain in an inflationary trend. WE read in the papers thatfood prices continues to rise. So, we must conclude that general livingindex will remain inflationary[F, B, I].

(F ∨ B)→ IFTherefore, I.Valid

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 72 / 125

Page 73: Prop Logic

Consistency: Example

It isn’t true that this litmus paper is put into an acid solution but at thesame time doesn’t turn red. Had the litmus paper turned red, theexperiment wouldn’t have been a failure, Either this litmus paper is putinto an acid solution, and doesn’t turn read, or the experiment is a failure.The litmus paper, therefore, doesnt’t turn red and the experiment is afailure.[S, R, F]

1 ¬(S ∧ R)

2 R → ¬F3 (S ∧ ¬R) ∨ F4 Therefore, ¬R ∧ F .

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 73 / 125

Page 74: Prop Logic

Examples:

1 We dont consider Newtonian Mechanics adequate whenever we wishto study subatomic particles.(M, P) P → ¬M

2 If water is neutral it has pH of 7 when, and only when, basicproperties do not begin before 7, and acid properties do not exceed7.[W,P,B,A] (W → P)↔ (¬B ∧ ¬A)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 74 / 125

Page 75: Prop Logic

Equivalence, Consistency, and Inconsistency

1 Two statements are logically equivalent if and only if they agree intruth value on every assignment of truth values to their atomiccomponents.

2 Two statements are logically contradictory if and only if they disagreein truth value on every assignment of truth values to their atomiccomponents.

3 Two (or more) statements are logically consistent if and only if theyare both (all) true on some assignment of truth values to their atomiccomponents.

4 Two (or more) statements are logically inconsistent if and only if theyare never both (all) true on any assignment of truth values to theiratomic components.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 75 / 125

Page 76: Prop Logic

Classification of Formulas

1 Valid (Tautologous)2 Contingent3 Inconsistent

1 True in allvaluations.

2 True on atleast onevaluation

3 True on novaluations.

1 only T’s2 Both T’s and F’s3 Only F’s

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 76 / 125

Page 77: Prop Logic

Examples:

1 Snakes exist, and yet they do not exist. p ∧ ¬p [Contradiction]2 A→ B ∧ ¬(¬A ∨ B).3 (A→ ¬B)→ (A↔ B)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 77 / 125

Page 78: Prop Logic

A short-cut-truth-table-Method

1 Assume that the formula is not a tautology by placing an F under themain logical connective.

2 Follow out the consequences of this. If we arrive at a contradiction,the formula is a tautology. If we do not, it is not a tautology.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 78 / 125

Page 79: Prop Logic

Example: Contd

A N A→ N N → AT FT TFF

FTT TFFF T FTT TFF

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 79 / 125

Page 80: Prop Logic

Examples:

ExampleE ∨ S, E → (B ∧ U), ¬S ∨ ¬U therefore B

E S B U E ∨ S E → (B ∧ U) ¬S ∨ ¬U therefore BT T F

F T F F F T T F T F F F F TT TFF

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 80 / 125

Page 81: Prop Logic

Validity

ExampleA ∨ B, ¬A therefore B

A B A ∨ B, ¬B therefore BT T F

FTF,TF FF(T/F)F,TF F

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 81 / 125

Page 82: Prop Logic

Example

ExampleA ∨ ¬B, ¬A, ¬B → (C → D), therefore C → D

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 82 / 125

Page 83: Prop Logic

Principles: Conjunction and biconditional

1 Principle 1: If there is any assignment of values in which the premisesare all true and the conclusion is false, then the argument is invalid.

2 Principle 2: If more than one assignment of truth values will makethe conclusion false, then consider each such assignment; if eachassignment that makes the conclusion false makes at least onepremise false, then the argument is valid.

ExampleA→ B, B → C therefore ¬A ∧ C .

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 83 / 125

Page 84: Prop Logic

Satisfiability

1 Whichever truth values we assign to p and q, the entire propositioncomes out false. We say that the proposition is unsatisfiable, sincenone of the available assignments satisfies it (i.e. makes it true)

2 Unsatisfiable propositions have only ‘F’s in the main column of theirtruth table.

3 Satisfiable propositions have at least one ‘T’ in the main column oftheir truth table.

4 Negation of a tautology is unsatisfiable and similarly the negation ofan unsatisfiable proposition is tautologous.

5 Tautologies are satisfied by every valuation, satisfiable propositions byat least one valuation and unsatisfiable propositions by none.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 84 / 125

Page 85: Prop Logic

Examples

Classify the following wff’s into satisfiable, valid, invalid, unsatisfiablewff’s.

1 (p → q)→ (¬p → ¬q)

2 (p ∨ q)→ (¬q → ¬p)

3 p ∧ (¬p ∨ q)→ q4 p ∧ (¬q → ¬p)→ q.5 Determine satisfiability of the sets of well formed formulas:{x ↔ y , y → z ,¬z ∨ p,¬x → p,¬p}.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 85 / 125

Page 86: Prop Logic

Check validity of following Argument

1 If Rajesh lives in Bangalore(B) he will be happy(H).B → H2 If he is happy(H) and likes his work(W), he will get on well at his

job(J) unless he falls in love(L) H ∧W → (¬L→ J).3 If he falls in love, he likes his work even more (L→W ). Therefore, if

he lives in Bangalore, he will get on well at his Job (B → J).

The above argument is invalid.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 86 / 125

Page 87: Prop Logic

Check the validity of the following argument

If God is willing to prevent suffering(S), but unable to do so(D), He is notomnipotent(O). If He is able to prevent suffering(S), but unwilling to doso(U), He is not loving(L). If God exists, He is loving and omnipotent.And if He is both willing and able to prevent suffering, then there can’t beany suffering, but there is. So God does not exist.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 87 / 125

Page 88: Prop Logic

Example:2

If the dog is barking, then there is someone at the door only if it issnowing. The dog is playing outside unless there is someone at the door.For the dog to be barking, it suffices that there be someone at the door orthat it snows. For the dog to play outside, it is necessary that there be noone at the door and that it does not snow. Therefore the dog is barkingbut there is someone at the door.

B: The dog is barking.D: There is someone at the door.P: The dog is playing outside.S: It is snowing.Use any method you know to determine whether or not the aboveargument is valid. If you claim it is invalid, give a counterexample.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 88 / 125

Page 89: Prop Logic

Example:Who is chatting?

Five friends (Abhisheik, Harini, Kaushal, Ravi and Vijay) have access to anon-line chat room. We know the following are true:

1 Either K or H or both are chatting (K ∨ H) ∨ (K ∧ H).2 Either R or V but not both are chatting (R ∨ V ) ∨ ¬(R ∨ V ).3 If A is chatting, then R is chatting.(A→ R)

4 V is chatting if and only if K is chatting.V ↔ K )

5 If H is chatting, then both A and K are chatting.(H → (A ∧ K )

Determine who is chatting.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 89 / 125

Page 90: Prop Logic

Tree Method

1 Truth trees are one of the most efficient ways of checking thesemantic properties of propositional formulas.

2 In particular, it gives a very easy way of checking the validity ofsequents.

3 The basic idea of truth trees is that they give a graphic way ofdisplaying whether or not a set of formulas is inconsistent.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 90 / 125

Page 91: Prop Logic

Tableau Method

1 This method has been introduced for propositional logic and predicatelogic by the Dutch philosopher and logician E W. Beth (1908-1964),Simplified by Hintikka(model sets), Raymond Smullyan.

2 A Semantic tree is a device for displaying all the valuations on whichthe formula or set of formulas is true.

3 Basic Idea: An inference is valid if and only if there exists no counterexamples, i.e., there is no situation in which the premises hold andthe conclusion is false.

4 This involves rule-based construction of a counter-example for a giveninference. We start with negation of formula and see whether thetableau closes. Each step of the construction is given account of in atree like structure called a tableau.

5 Tableau closes when there is a conflicting information.No counterexample can be constructed (the branch is not open).

6 It implies no counter examples exist.A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 91 / 125

Page 92: Prop Logic

Tableau Rules: Alpha rules

¬p∴¬p

(p ∨ q)————∧p q

(p ∧ q)————pq

(p → q)————∧¬p q

(p ↔ q)————∧p,q //¬p, ¬q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 92 / 125

Page 93: Prop Logic

Tableau Rules: Beta rules

¬¬p∴p

¬(p ∨ q)————¬p¬q

¬(p ∧ q)————∧¬p, ¬q

¬(p → q)————p¬q

¬(p ↔ q)————∧p,¬q, ¬p, q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 93 / 125

Page 94: Prop Logic

Example

(p ⊃ q)

(r ∨ ¬q)

¬r¬p

¬p

r

¬q

q

r

¬q

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 94 / 125

Page 95: Prop Logic

Why Semantic tableaux method?

1 Semantic tableaux method conducts a direct search for models. Allthe open paths of the tree corresponding to satisfiability ofconjunction of formulas at the node.

2 Traditional approaches, such as constructing a truth table, can take2n steps for n. If n is large, truth table method is difficult o handle aspropositional letters which are large.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 95 / 125

Page 96: Prop Logic

Some Definitions

Definition (Path)A path of a tree (in any stage of construction) is a complete column offormulas from top to the bottom of the tree.A route going from the initial set of formulas at the top down to one ofthe atomic formulas at the bottom, while choosing only one side of eachbranch as one goes, will be called here a path

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 96 / 125

Page 97: Prop Logic

Definitions

Definition (Finished Path)A path is finished if it is closed or if the only unchecked formula it containsare propositional variables or negations of prepositional variables so thatno more rules apply to its formulas. A tree is closed or finished if all of itspaths are closed.

Definition (Open and closed Path)An open path is a path that has not been ended with an X . A closed pathis a path that has been ended with an X .

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 97 / 125

Page 98: Prop Logic

Some Definitions

DefinitionA formula occurs on a path if it is on the path and is not merely a subformula of some other formula on that path (2) it is unchecked.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 98 / 125

Page 99: Prop Logic

Strategy

Apply non-branching rules before branching rules.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 99 / 125

Page 100: Prop Logic

validity, Satisfiability

1 To determine whether a formula is valid, construct a tree startingwith its premises and the negation of its conclusion. If all paths close,the formula is valid. If not, it is invalid and the open paths display thecounter examples.

2 To show that A |= B as valid, it suffices to show that A ∧ ¬B isunsatisfiable.

3 To determine whether a formula or set of formulas is consistent,construct a tree starting with that formula (or set of formulas). If allpaths close, that formula (set of formulas) is inconsistent. If not, it isconsistent, and the open paths display the valuations that make theformula true.

4 A formula A is tautology iff ¬A is unsatisfiable.5 Contingency: Construct two different trees, one to test it for

consistency and one to test for validity. If the formula is consistentbut not valid, then it is contingent.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 100 / 125

Page 101: Prop Logic

Theorems

1 Main Theorem:A completed semantic tableau for a formula A isclosed if and only if A is unsatisfiable.

2 Soundness: If a tableau is closed, then A is unsatisfiable.3 Completeness: If a wff A is unsatisfiable, then any tableau for A is

closed.4 Corollary1: A well formed formula A is a satisfiable formula if and

only if any tableau for A is open.5 Corollary2: A well formed formula A is a valid formula (tautology) if

and only if a tableau for ¬A is closed.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 101 / 125

Page 102: Prop Logic

Some Theorems

Theorem (soundness of the tableau method)If α is tableau provable, then α is a tautology, i.e.` α implies |= α

The tableau method is consistent. This means that there is no propositionα such that both ` α and ` ¬α.

Theorem (Soundness of the tableau method)If α is provable in the natural deduction system(ND), then α is atautology, i.e. `ND α implies |= α.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 102 / 125

Page 103: Prop Logic

Knights and Knaves Puzzle using Truth Table:

On some island, there are knights (who always tell the truth) and knaves(who always lie).

ProblemYou meet two islanders (call them A and B) and hear the first one say atleast one of us is a knave. Can you tell whether the islanders are knightsor knaves and which islander is which?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 103 / 125

Page 104: Prop Logic

Knights and Knaves: Truth Table Method

Take p :A is a knight andq : B is a knight.Then the sentence At least one of us is a knave is translated as (¬p ∨¬q),since being a knave is the negation of being a knight. p ↔ (¬p ∨ ¬q)

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 104 / 125

Page 105: Prop Logic

Knights and Knaves

p q ¬p ∨ ¬q p → (¬p ∨ ¬q)

T T F FT F T TF T T FF F T F

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 105 / 125

Page 106: Prop Logic

Knights and Knaves:

1 The island of Knights and Knaves has two types of inhabitants,Knights who always tell the truth, and Knaves who always lie (noknaves are knights).

2 Suppose A is the proposition person a is a knight and suppose amakes a statement S . Then, A is true if and only if S is true, since Ais equivalent to S .

3 That is, A↔ S . So, whenever an inhabitant x makes a claim S , wecan infer that X ↔ S . That is, we can infer that x is a knight if andonly if S is true.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 106 / 125

Page 107: Prop Logic

Knights and Knaves Puzzles:

1 If a says I am a Knight then we can infer from this statement thatA↔ A. But, since this is logically true, we get no information fromsuch a statement.

2 A native cannot say I am a Knave, since if this were true, then itwould be false and if it were false, then it would be true (and, noKnights are Knaves).

3 If a says I am the same type as b, then we can infer A↔ (A↔ B)which is equivalent to B (that is, B ≡ A↔ (A↔ B). So, thisstatement allows us to infer that person b is a Knight!

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 107 / 125

Page 108: Prop Logic

Some Puzzles

1 You meet two people, A and B. A says: I’m a knave but B isn’t.What are A and B?

2 Suppose A says: If I am a knight, then so is B. Can it be determinedwhat A and B are?

3 Suppose you know that A and B are either both knights or bothknaves. What do you make of A’s statement If B is a knight, then Iam a knave”?

4 Suppose A says: We are both knights” and B says Either A is aknight or I am a knight, but not both.” What can you conclude?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 108 / 125

Page 109: Prop Logic

Example

It is rumoured that there is gold buried on the Island. You ask one of thethe natives, A, whether there is gold on the island. He makes the followingresponse: There is a gold on this island equivales I am a knight. Theproblem is as follows:

1 Can it be determined whether A is knight or Knave?2 Can it be determined whether there is gold on the island?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 109 / 125

Page 110: Prop Logic

Gold in an Island

Let G denote the proposition: There is Gold in an IslandStatement made by A: A↔ G .The statement: A↔ G

It is not possible to tell whether A is a knight or knave.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 110 / 125

Page 111: Prop Logic

Tourist at the Fork

A tourist comes to a fork in the road, where one branch leads toRestaurant, and one doesn’t. A native of the island is standing at the fork,Formulate a single yes/no question that the tourist can ask such that theanswer will be yes if the left fork leads to the restaurant, and otherwise theanswer will be no.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 111 / 125

Page 112: Prop Logic

Tourist at the Fork

Let Q be the question.Let A be the native is a knight.Let L be the proposition, the left fork leads to the restaurant

We require that L equivalent to the response to the question is yes.Response to the question Q is yes equivales QA.We require L↔ (Q ↔ A).Q ↔ (L↔ A).

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 112 / 125

Page 113: Prop Logic

Tourist at the Fork

QuestionIs it the case that th statement that the left fork leads to the restaurant isequivalent to your being knight?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 113 / 125

Page 114: Prop Logic

Knights and Knaves problem:

We have three inhabitants, A, B, and C, each of whom is a knight or aknave. Two people are said to be of the same type if they are both knightsor both knaves. A and B make the following statements:

1 A: B is a knave.2 B: A and C are of the same type.

What is C?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 114 / 125

Page 115: Prop Logic

Knights and Knaves

Suppose, A and B say the following:1 A: All of us are knaves.2 B: Exactly one of us is a knave.

Can it be determined what B is? Can it be determined what C is?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 115 / 125

Page 116: Prop Logic

Constraint Satisfaction problem

Example (Planning a party)You are planning a party, but your friends are a bit touchy about who willbe there.

1 If Jay comes, he will get very hostile if Sita is there.2 Sita will only come if Kavita will be there also.3 Kavita says she will not come unless Jay does.

Who can you invite without making someone unhappy?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 116 / 125

Page 117: Prop Logic

Example

Translation to logic: let J;(S; K) represent Jay (Sita, Kavitha) comes tothe party.Then the constraints are:

1 J → ¬S.2 S → K3 K → J .

Fir a Successful Party to be possible, we want the formulaφ = (J → ¬S) ∧ (S → K ) ∧ K → J) to be satisfiableTruth values for J, S, K making this true are satisfying assignments,

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 117 / 125

Page 118: Prop Logic

Example

There was a robbery in which a lot of goods were stolen. The robber (s)left in a truck. It is known that :

1 Nobody else could have been involved other than A, B and C.2 C never commits a crime without A’s participation.3 B does not know how to drive.

Is A innocent or guilty?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 118 / 125

Page 119: Prop Logic

Example

There was a robbery in which a lot of goods were stolen. The robber (s)left in a truck. It is known that :

1 Nobody else could have been involved other than A, B and C.(A ∨ B ∨ C).

2 C never commits a crime without A’ s participation.(C → A)

3 B does not know how to drive (B → [(B ∧ A) ∨ (B ∧ C)].Is A innocent or guilty?

A is Guilty

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 119 / 125

Page 120: Prop Logic

Examples

1 If the pilot was conscious and knew the rate of descent of hisairplane, then if the altimeter was accurate, mechanical failure wasresponsible for the crash. Inspection of wreckage shows that therewas no mechanical failure, and that the altimeter was accurate.Therefore, if the pilot was conscious, he did not know the rate of ofdescent of his airplane[C, K, A, M].

2 If the capital investment remains constant, then government spendingwill increase or unemployment will result. If the government spendingwill not increase, taxes can be reduced. If taxes can be reduced andcapital investment remains constant, then unemployment will notresult. Hence, the government spending will increase [C, G, U, T].

3 Either Logic is difficult or not many students like it. If mathematics iseasy, then logic is not difficult. Therefore, if many students like logic,mathematics is not easy[D, L, M].

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 120 / 125

Page 121: Prop Logic

Example:Who is chatting?

Five friends (Abhisheik, Harini, Kaushal, Ravi and Vijay) have access to anon-line chat room. We know the following are true:

1 Either K or H or both are chatting (K ∨ H) ∨ (K ∧ H).2 Either R or V but not both are chatting (R ∨ V ) ∨ ¬(R ∨ V ).3 If A is chatting, then R is chatting.(A→ R)

4 V is chatting if and only if K is chatting.V ↔ K )

5 If H is chatting, then both A and K are chatting.(H → (A ∧ K )

Determine who is chatting.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 121 / 125

Page 122: Prop Logic

Logical Puzzle about Lady or Tiger

In this puzzle a prisoner is faced with a decision where he must open oneof two doors. Behind each door is either a lady or a tiger. There might betwo tigers, two ladies or one of each.If the prisoner opens a door and finds a lady he will marry her and if heopens a door and finds a tiger he will be eaten alive.Of course, the prisoner would prefer to be married than eaten alive. Eachof the doors has a sign bearing a statement that may be either true or false

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 122 / 125

Page 123: Prop Logic

Problem 1:

1 The statement on do or 1 says, In this room is a lady, and in theother room is a tiger.

2 The statement on do or 2 says, In one of these rooms is a lady, and inone of these rooms is a tiger.

Clue:The prisoner is informed that one of the two statements is true andone is false.Which door should he open?

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 123 / 125

Page 124: Prop Logic

Problem:2

The second puzzle of the book runs as follows. Again there are two signs.1 The sign on the first door says: At least one of these rooms contains

a lady.2 The sign on the second door says: A tiger is in the other room.

This time either the statements are both true or both false

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 124 / 125

Page 125: Prop Logic

References:

1 Raymond M. Smullyan. The Lady or the Tiger?: and Other LogicPuzzles. Dover, 2009. First edition: 1982.

2 Raymond M. Smullyan. What is the name of this book? Dover, firstedition 1990 edition, 2011.

A. V. Ravishankar Sarma (IITK) Propositional Logic May 21, 2014 125 / 125