Logics for Data and Knowledge Representation

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Logic.
Logic Concepts Lecture Module 11.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
EE1J2 – Discrete Maths Lecture 5
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Intro to Discrete Structures
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
The Foundations: Logic and Proofs
LDK R Logics for Data and Knowledge Representation Exercise 2: PL, ClassL, Ground ClassL.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Normal Forms, Tautology and Satisfiability 2/3/121.
Propositional Equivalences
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Chapter 3: Semantics PHIL 121: Methods of Reasoning March 13, 2013 Instructor:Karin Howe Binghamton University.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
CS6133 Software Specification and Verification
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Logics for Data and Knowledge Representation Exercises: ClassL Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 25.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
Chapter 1 Logic and proofs
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
Knowledge Representation and Reasoning
ARTIFICIAL INTELLIGENCE
Logics for Data and Knowledge Representation
Logical Inference: Through Proof to Truth
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Propositional Equivalences
Back to “Serious” Topics…
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
COMP 1380 Discrete Structures I Thompson Rivers University
Logics for Data and Knowledge Representation
Presentation transcript:

Logics for Data and Knowledge Representation Exercises of Propositional Logic Vincenzo Maltese

Modeling the world World Monkey SEMANTIC GAP Mental Model Language L 2 PROPOSITION SENTENCE 2

The famous triangle Monkey CONCEPT (what we have in mind) refers to symbolizes Monkey REFERENT (the real object) SYMBOL (what we write) stands for 3

Example: what is a Banana? THE WORLD CHANGED MENTAL MODEL MENTAL MODEL I mean banana as something yellow and curve, no matter if partially opened I mean banana as something yellow or red, which can be one or many together, no matter how big they are, and whether they are opened or not T F T F FORMAL MODEL M1 FORMAL MODEL M2 4

Symbols in PL Which of the following symbols are used in PL? SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Which of the following symbols are used in PL? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨

Symbols in PL (solution) SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Which of the following symbols are used in PL? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ 6

Formation Rules (FR): well formed formulas SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Well formed formulas (wff) in PL can be described by the following BNF grammar (codifying the FR): <Atomic Formula> ::= A | B | ... | P | Q | ... | ⊥ | ⊤ <wff> ::= <Atomic Formula> | ¬<wff> | <wff>∧ <wff> | <wff> ∨ <wff> <wff> <wff> | <wff>  <wff> Σ0 + FR define a propositional language A formula is correct if and only if it is a wff PARSER ψ, PL Yes, ψ is correct! No

Formation rules Which of the following is not a wff? SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Which of the following is not a wff?  MonkeyLow ∨ BananaHigh   MonkeyLow  BananaHigh MonkeyLow   BananaHigh MonkeyLow →  GetBanana NUM. 3 IS WRONG! 8

Translate NL sentences into PL SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS If David comes to the party then Bruno and Carlo come too D  B ∧ C Carlo comes to the party only if Angelo and Bruno do not come (A ∧ B)  C Carlo comes to the party given that David doesn't come, but, if David comes, then Bruno doesn't come (C  D) ∧ (D  B) A necessary condition for Angelo coming to the party, is that, if Bruno and Carlo aren't coming, David comes A  ((B ∧ C)  D) CHANGED 9

Modeling the problem of passing the exam SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS If you play and you study you'll pass the exams, while if you play and don't study you won't pass. Thus, if you play, then you study and you'll pass the exams, or you don't study and you won't pass. L = {P, S, E} P = “you play”, S = “you study”; E = “you pass the exam” (P ∧ S)  E (P ∧ S)  E P  (S ∧ E)  (S ∧ E) CHANGED 10

Modeling the Bananas SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Bananas may differ in many ways. However, there are red and yellow bananas. I like bananas, but I eat only yellow bananas. If I do not eat at least a banana I get crazy. CHANGED L = {RedBanana, YellowBanana, EatBanana, GetCrazy, Banana} T = {RedBanana → Banana, YellowBanana → Banana, EatBanana → YellowBanana,  EatBanana → GetCrazy} 11

Truth-values SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Definition: a truth valuation on a propositional language L is a mapping ν assigning to each formula A of L a truth value ν(A), namely in the domain D = {T, F} ν(A) = T or F according to the modeler, with A atomic ν(¬A) = T iff ν(A) = F ν(A∧B) = T iff ν(A) = T and ν(B) = T ν(A∨B) = T iff ν(A) = T or ν(B) = T ν(⊥) = F (since ⊥=df P∧¬P) ν(⊤) = T (since ⊤=df ¬⊥) ν(A  B) = T iff ν(A) = F or ν(B) = T

Truth valuations and Truth Tables SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS A truth valuation on a PL language L is a mapping ν that assigns to each formula P of L a truth value ν(P). A truth table is composed of one column for each input variable and one (or more) final column for all of the possible results of the logical operation that the table is meant to represent. Each row of the truth table therefore contains one possible assignment of the input variables, and the result of the operation for those values. LOGICAL OPERATION VARIABLES A B A∧B T F POSSIBLE ASSIGNEMENTS

Example Calculate the Truth Table of the following formulas: SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Calculate the Truth Table of the following formulas: (1) A ∧ B; (2) A ∨ B; (3) A ↔ B. VARIABLES (1) (2) (3) A B A∧B A∨B A↔B T F POSSIBLE ASSIGNEMENTS

Provide the models for the propositions SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS RECALL: a truth valuation ν is a model for a proposition P iff ν(P) = true List the models for the following formulas: A ∧ ¬B (A ∧ B) ∨ (B ∧ C) A ∨ B → C ¬A ↔ B ↔ C A B A ∧ ¬ B T F MODEL 15

Exercise: Truth Valuations SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Compute truth valuations for the formula P: (A∨B)→ C a) Rewrite as  (A ∨ B) ∨  C b) Rewrite as ( A ∧  B) ∨  C A B C P T F 16

Exercise: Truth Valuations SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Compute truth valuations for the formula P: (A  B)  ¬B Notice that the formula is unsatisfiable. In fact: A B P T F 17

Exercise: Truth Valuations SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Compute truth valuations for the formula P: ¬(A → B) → (A  ¬B) Notice that the formula is valid. In fact: a) Rewrite as ¬¬(A → B) ∨ (A  ¬B) b) Rewrite as (¬A ∨ B) ∨ (A  ¬B) A B P T F 18

Entailment SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS RECALL:  ⊨ ψ iff all models satisfying the formulas in  also satisfy ψ Let A, B, C be propositional sentences. If A ⊨ B ∧ C, then A ⊨ B or A ⊨ C or both? Proof: If A ⊨ B ∧ C, for all ν such that v(A) = T it should be v(B ∧ C) = T. However, by definition this means that v(B) = T and v(C) = T. Therefore it is true for both.

Exercise: prove entailment SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Given that: P = (A ∨ B ) ∧ (C ∨ D ∨ E) Q1 = A ∨ B Q2 = (A ∨ B ∨ C) ∧ ((B ∧ C ∧ D) → E) Q3 = (A ∨ B) ∧ (D ∨ E) Does P ⊨ Qi ? Proof: Let X = A ∨ B, Y = D ∨ E, then we can rewrite: P = X ∧ (¬C ∨ Y); Q1 = X; Q2 = (X ∨ C) ∧ (¬B ∨ ¬C ∨ Y); Q3 = X ∧ Y P ⊨ Q1 is obvious. Since X ⊨ X ∨ C and (¬ C ∨ Y) ⊨ (¬B ∨ ¬C ∨ Y), then P ⊨ Q2. Since Y ⊨ (¬C ∨ Y), then Q3 ⊨ P (and not vice versa).

Exercise: prove entailment using truth tables SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Given that: P = (A ∨ B ) ∧ (C ∨ D ∨ E) Q1 = A ∨ B Q2 = (A ∨ B ∨ C) ∧ ((B ∧ C ∧ D) → E) Q3 = (A ∨ B) ∧ (D ∨ E) (1) List all truth assignments such that P ⊨ Qi (2) Is there any assignment such that P ⊨ Qi for all i? Solution to (1): First compute the truth tables for all the propositions above. Then, list all rows for which both P and Qi are true. Solution to (2): Check whether there is any assignment for which all the sentences above are true. 21

Logical implication and deduction SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Deduction (⊢) is the process of inferring new knowledge from known facts. Logical implication (→) is a way to include deduction directly in the language. It is an alternative way to implement deduction (deduction theorem). For instance: ¬(A ∨ B) → (¬A ∧ ¬B) iff ¬(A ∨ B) ⊢ (¬A ∧ ¬B) Well-known tautologies (e.g. the De Morgan Law above) can be used 22

Prove using truth tables, the following deductions SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Double negative elimination  P ⊢ P Conjunction introduction / elimination (a) {P, Q} ⊢ P∧Q; (b) P ∧ Q ⊢ P; (c) P ∧ Q ⊢ Q. Disjunction introduction / elimination  (a) P ⊢P ∨ Q; (a) Q ⊢ P ∨ Q; (c) {P ∨ Q, P → R, Q → R} ⊢ R Bi-conditional introduction / elimination (P → Q) ∧ (Q → P) ⊢ (P ↔ Q)  De Morgan (a) (P ∧ Q) ⊢ P ∨ Q; (b) (P ∨ Q) ⊢ P ∧ Q 23

Proofs of the Deduction Rules SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS P Q P∧Q P∨Q P↔Q T F P Q ¬¬P P→Q Q→P ¬(P∧Q) ¬P∨¬Q ¬(P∨Q) ¬P∧¬Q T F 24

Prove validity (I) SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Suppose p, q, r, s are four propositional sentences, is the following sentence valid? A = (p → r) → (p ∨ r) A way to prove validity is to show that the proposition entails ⊤. This can be done by applying well known tautologies (e.g. De Morgan). In alternative we can show using truth tables that all the assignments are true. (p → r) → (¬p ∨ r) = ¬(p → r) ∨ (¬p ∨ r) = ¬(¬p ∨ r) ∨ (¬p ∨ r) = ⊤

Recall the DPLL algorithm SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Recall the DPLL algorithm Input: a proposition P in CNF Output: true if "P satisfiable" or false if "P unsatisfiable" boolean function DPLL(P) { if consistent(P) then return true; if hasEmptyClause(P) then return false; foreach unit clause C in P do P = unit-propagate(C, P); foreach pure-literal L in P do P = pure-literal-assign(L, P); L = choose-literal(P); return DPLL(P  L) OR DPLL(P  L); } Consistency Check Empty Close Test Unit Propagation Pure Literal Elimination Splitting rule 26

Convert a formula in CNF SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS (A  B)  ¬A ¬ (A  B)  ¬A ¬ A  ¬B  ¬A (C  ¬A)  ¬(B  ¬A) (¬C  ¬A)  ¬(B  ¬A) (¬C  ¬A)  (¬B  ¬¬A) (¬C  ¬A)  (¬B  ¬A)

Convert a formula in CNF SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS (A  C)  (C  ¬A) ¬(A  C)  (C  ¬A) ¬(A  C)  (¬C  ¬A) ¬A  ¬C  ¬C  ¬A ¬A  ¬ C ((A → B) → A) → A (( A  B)  A)  A ((A  B)  A)  A ((A  A)  (A  B))  A A  (A  B)  A (A  B) A  B

Using DPLL for reasoning tasks SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Model checking Does ν satisfy P? (ν ⊨ P?) Check if ν(P) = true Satisfiability Is there any ν such that ν ⊨ P? Check that DPLL(P) succeeds and returns a ν Unsatisfiability Is it true that there are no ν satisfying P? Check that DPLL(P) fails Validity Is P a tautology? (true for all ν) Check that DPLL(P) fails NOTE: typical DPLL implementations take two parameters: the proposition P and a model ν. Therefore, in case of model checking the real call would be DPLL(P, ν) and check that it succeeds 29

Use DPLL to prove satisfiability SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS B  ¬A  (¬C  A)  (B  C) 1. Is it a consistent set of literals? There are no contradictions, but there are closes which are not atomic. 2. Are there any empty clauses? No, go ahead. 3. Assign the right truth value to all literals and simplify the formula: Assign v(B) = T, v(A) = F and then the formula simplifies to ¬C 4. Assign the right value to pure literals: Assign v(C) = F. Done. 5. No need for the splitting rule The formula is satisfiable at least for the assignment (a model for it): v(A) = F, v(B) = T, v(C) = F

Use DPLL to prove satisfiability SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS (C  A)  (C  B)  (A  B) First convert in CNF: ( C  A)  ( C  B)  ( A   B) 1. Is it a consistent set of literals? There are no contradictions, but there are closes which are not atomic. 2. Are there any empty clauses? No, go ahead. 3. Assign the right truth value to all literals and simplify the formula. There are no atomic clauses. Go ahead. 4. Assign the right value to pure literals: Assign v(C) = T and simplify to ( A   B) 5. Apply the splitting rule and return DPLL(( A   B)  A) or DPLL(( A   B)   A) …

Use DPLL to prove unsatisfiability SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Using DPLL, prove the unsatisfiability of (B → A)  (¬A  B) First convert in CNF: (B  A)  ¬A  B Assign the right truth value to all literals and simplify the formula: Assign v(A) = F, v(B) = T. Now, by propagation all the literals in the first clause become false. This generates an empty clause, thus the DPLL returns false.

Use DPLL to prove validity SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Using DPLL, prove the validity of (A → B) → (¬B → ¬A) First negate the formula: ¬((A → B) → (¬B → ¬A)) Then convert in CNF: ¬((¬A  B) → (B  ¬A)) ¬(¬(¬A  B)  (B  ¬A)) (¬A  B)  ¬(B  ¬A) (¬A  B)  ¬B  A Assign the right truth value to all literals and simplify the formula: Assign v(A) = T, v(B) = F. Now, by propagation all the literals in the first clause become false. This generates an empty clause, thus the DPLL returns false. Thus, the original formula is valid.

Use DPLL to prove validity SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS Using DPLL, prove the validity of ¬(A → B) → (A  ¬B) First negate the formula: ¬(¬(A → B) → (A  ¬B)) Then convert in CNF: ¬((A → B)  (A  ¬B)) ¬(A → B)  ¬(A  ¬B) ¬(¬A  B)  ¬(A  ¬B) (A  ¬B)  (¬A  B) (A  ¬B  ¬A)  (A  ¬B  B) (¬B  ⊥)  (A  ⊥) This is clearly unsatisfiable even before calling DPLL.

Are you ‘Sherlock Holmes’? SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS 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? Proof: The 3 points above can be translated in PL as follows: (1) θ1 = A ∨ B ∨ C; (2) θ2 = C → A; (3) θ3 = B → (B ∧ A) ∨ (B ∧ C) Does {θ1 , θ2 , θ3} ⊨ A ? Yes! We can prove it by showing that θ1 ∧ θ2 ∧ θ3 → A is a tautology.

Knights and Knaves SYNTAX :: MODELING A PROBLEM :: SEMANTICS :: LOGICAL IMPLICATION :: REASONING :: SOME NICE PROBLEMS A very special island is inhabited only by knights and knaves. Knights always tell the truth, and knaves always lie. You meet two inhabitants: Zoey and Mel. Zoey tells you that Mel is a knave. Mel says ‘Neither Zoey nor I are knaves’. Can you determine what are they? (who is a knight and who is a knave?) Proof: The two sentences above can be translated in PL as follows: (1) Z → M; (2) M → Z ∧ M. We can use truth tables to prove that there are two possible situations: - Both lie (they are both knaves) - Zoey tells the true (is a Knight) and Mel lies (is a knave)