Logics for Data and Knowledge Representation Exercise 2

  • Slides: 24
Download presentation
Logics for Data and Knowledge Representation Exercise 2: PL, Class. L, Ground Class. L

Logics for Data and Knowledge Representation Exercise 2: PL, Class. L, Ground Class. L

Outline q Reasoning q Truth Table q Deduction q Logics q PL q Class.

Outline q Reasoning q Truth Table q Deduction q Logics q PL q Class. L q Ground Class. L 2

Summary of Logics Mentioned by Now (1) q Language / Syntax Choose proper logics

Summary of Logics Mentioned by Now (1) q Language / Syntax Choose proper logics for the following symbols ⊓ ⊤ ⊢ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ PL 3 Class. L Ground Class. L

Summary of Logics Mentioned by Now (2) q Semantics q PL q p. I={True,

Summary of Logics Mentioned by Now (2) q Semantics q PL q p. I={True, False} q Class. L q p. I={set 1, …, setn} q Ground Class. L q p. I={set 1, …, setn}, q. I={element 1, …, elementm} 4

Truth Table q What is a Truth valuation? q Def. A truth valuation on

Truth Table q What is a Truth valuation? q Def. A truth valuation on a propositional language L is a mapping ν assigning to each formula P of L a truth value ν(P). q What is a Truth Table? q A truth table is composed of one column for each input variable and one 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. 5

Example q Calculate the Truth Table of the following formulas q A∧B q P∨Q

Example q Calculate the Truth Table of the following formulas q A∧B q P∨Q q X↔Y A B A∧B A∨B A↔B T T T F F T F T F F F T q What about this? q (A∨B→C∨D∨E)∧(¬F↔A)∧(¬F∨G∧¬H∨F)∧(¬I→ ¬(D∧J))∧(¬J∨¬D∨E)∧F 6

Deduction q Double negative elimination q P⊢P q Conjunction introduction / elimination q {P,

Deduction q Double negative elimination q P⊢P q Conjunction introduction / elimination q {P, Q}⊢P∧Q; P∧Q⊢P, P∧Q⊢Q q Disjunction introduction / elimination q P⊢P∨Q, Q⊢P∨Q; {P∨Q, P→R, Q→R}⊢R q Bi-conditional introduction / elimination q (P→Q)∧(P←Q)⊢(P↔Q) q De Morgan q (P∧Q)⊢ P∨ Q, (P∨Q)⊢ P∧ Q 7

Proofs of Deduction Rules 8 P Q P∧Q P∨Q P↔Q T T T F

Proofs of Deduction Rules 8 P Q P∧Q P∨Q P↔Q T T T F F T F T F F F T P Q ¬¬P P→Q Q→P ¬(P∧Q) ¬P∨¬Q ¬(P∨Q) ¬P∧¬Q T T F F F T F T T F F F T T T

Soundness and Completeness q A deduction system is sound if any sentence P that

Soundness and Completeness q A deduction system is sound if any sentence P that is derivable from a set Г of sentences is also a logical consequence of that set Г. q A deductive system is complete if every sentence P that is a semantic consequence of a set of sentences Γ can be derived in the deduction system from that set. q A soundness property provides the initial reason for counting a logical system as desirable. The completeness property means that every validity (truth) is provable. 9

Outline q Reasoning q Truth Table q Deduction q Logics q PL q Class.

Outline q Reasoning q Truth Table q Deduction q Logics q PL q Class. L q Ground Class. L 10

Warming up q List the number of models for the following formulas (A∧B)∨(B∧C) A∨B→D

Warming up q List the number of models for the following formulas (A∧B)∨(B∧C) A∨B→D ¬A↔B↔C (A↔¬B)∧(A ↔B) 1. 2. 3. 4. Wait! 5. Something has to be mentioned: Suppose the formulas are represented by a PL with 4 propositions: A, B, C and D. 11

PL Exercises 1 q Let A, B, C be propositional sentences, if A⊨B∧C, then

PL Exercises 1 q Let A, B, C be propositional sentences, if A⊨B∧C, then A⊨B or A⊨C or both? What if A⊨B∨C? q The model of ‘B∧C’ is I={B=T, C=T}; q If ‘A⊨B∧C’, I should be also a model of ‘A’; q Because I assigns True to ‘B’, I is a model of ‘B’; q Similarly, I is also a model of ‘C’; q So, the proposition is true. q If ‘A⊨B∨C’, a model of ‘B∨C’ can be I’={B=T, C=F}; q I’ is not a model of either ‘A⊨B ’ and ‘A⊨C ’. 12

PL Exercises 2 q Given that P=(A∨B)∧( C∨ D∨E), Q 1=A∨B, Q 2=(A∨B∨C)∧(B∧C∧D→E), Q

PL Exercises 2 q Given that P=(A∨B)∧( C∨ D∨E), Q 1=A∨B, Q 2=(A∨B∨C)∧(B∧C∧D→E), Q 3=(A∨B)∧( D∨E), list i that P⊨Qi. A B C D E P Q 1 Q 2 Q 3 T T T T T F T T … T F T T T T T F T … F 13 … F F …

PL Exercises 2 cont. q Given that P=(A∨B)∧( C∨ D∨E), Q 1=A∨B, Q 2=(A∨B∨C)∧(B∧C∧D→E),

PL Exercises 2 cont. q Given that P=(A∨B)∧( C∨ D∨E), Q 1=A∨B, Q 2=(A∨B∨C)∧(B∧C∧D→E), Q 3=(A∨B)∧( D∨E), list i that P⊨Qi. q Notice that let X= A∨B, Y= D∨E, then we rewrite q P=X∧(¬C∨Y), q Q 1=X q Q 2=(X∨C)∧(¬ B∨¬C∨Y), q Q 3=X∧Y q So, P⊨Q 1; ⊨X∨C, (¬C∨Y) ⊨(¬ B∨¬C∨Y) thus P ⊨ Q 2, q Y ⊨(¬C∨Y) thus Q 3 ⊨ P. q. X 14

PL Exercises 3 p Q r s A T T T q Suppose p,

PL Exercises 3 p Q r s A T T T q Suppose p, q, r, s are four T T T F T T F F T T T F F F T T T T F T F T T F F T T T F F F T T F F T propositional sentences, is the following sentence valid? (p→r)∧(q→s)∧( r∨ s)→( p∨ q) A=(p→r)∧(q→s)∧(¬r∨¬s)→( ¬p∨¬q) =¬((p→r)∧(q→s)∧(¬r∨¬s)) ∨ ¬p∨¬q =(p∧¬r)∨(q∧¬s)∨(r∧s) ∨ ¬p∨¬q =⊤ 15

Are you ‘Sherlock Holmes’? There was a robbery in which a lot of goods

Are you ‘Sherlock Holmes’? 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. q So, is A innocent or guilty? q A∨B∨C q C→A q B 16 A

Knights and Knaves q A very special island is inhabited only by knights and

Knights and Knaves q 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? ) q Z: M Contradictory! q M: Z∧M proof: If M, then Z∧M, then Z, then M. 17

Class. L Exercises 1 q T={A⊑B, B⊑A}, is (A⊓B) satisfiable in Class. L? B

Class. L Exercises 1 q T={A⊑B, B⊑A}, is (A⊓B) satisfiable in Class. L? B A 18 B A

Class. L Exercises 2 q T={C⊑A, C⊑B} is (A⊓B) satisfiable in Class. L? A

Class. L Exercises 2 q T={C⊑A, C⊑B} is (A⊓B) satisfiable in Class. L? A c B C A 19 B A C B C C A B

Class. L Exercises 3 q Suppose a ⊨A, ⊨B, is the following sentence A∧B

Class. L Exercises 3 q Suppose a ⊨A, ⊨B, is the following sentence A∧B satisfiable in PL, what about A⊓B in Class. L? A A B A∧B T T F F F T F F A B A 20 B B

PL vs. Class. L For any PL sentence P, suppose a corresponding Class. L

PL vs. Class. L For any PL sentence P, suppose a corresponding Class. L P’ is built by changing ∧, ∨, →, into ⊓, ⊔, ⊑, (not wff’s are not considered). Then do we have that ⊨P iff ⊨P’? The transmission of truth VS. coverage. q For all wff’s P of PL, there exists a truth valuation ν that ν(P) = True iff there exists a class valuations σ, σ(P’) ≠ ∅ with P’ as the corresponding proposition in Class. L. q NOTE: although there are more possible assignments in Class. L for the ‘same’ formula, some of them may collapse into one case in PL. 21

Example q Suppose a PL wff ¬A⋀B and a corresponding Class. L wff ¬A⊓B,

Example q Suppose a PL wff ¬A⋀B and a corresponding Class. L wff ¬A⊓B, the possible assignments (interpretations) are as the following: A B ¬A⋀B T T F F F B A A B … q More than one model in Class. L collapse into one model in PL. (All non-empty are mapped to T. ) 22

Ground Class. L q What distincts Ground Class. L from Class. L? The expressiveness

Ground Class. L q What distincts Ground Class. L from Class. L? The expressiveness to represent ‘instance’. q What for? To capture the instance/individual in the world. 23

Exercise: LDKR Class People Italian White LDKRBlack Hair Indian Hair Chinese White Hair Black

Exercise: LDKR Class People Italian White LDKRBlack Hair Indian Hair Chinese White Hair Black Hair Chinese Italian LDKR 24 Indian ID Name Nationality Hair 1 Fausto Italian White 2 Enzo Italian Black 3 Rui Chinese Black 4 Bisu Indian Black … … TBox={Italian⊑LDKR, Black. Hair⊑LDKR, Indian ⊑LDKR} ABox={Italian(Fausto), Italian(Enzo), Chinese(Rui), Indian(Bisu), Black. Hair(Enzo), Black. Hair(Rui), Black. Hair(Bisu), White. Hair(Fausto)}