1 / 28

Logics for Data and Knowledge Representation

Logics for Data and Knowledge Representation. Exercises: Description Logics. Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese. Normalization of a TBox. Normalize the TBox below: MonkeyLow ⊑  GetBanana GetBanana ≡ Survive Possible solution: MonkeyLow ≡  GetBanana ⊓  ClimbBox

yale
Télécharger la présentation

Logics for Data and Knowledge Representation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logics for Data and KnowledgeRepresentation Exercises: Description Logics Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

  2. Normalization of a TBox Normalize the TBox below: MonkeyLow ⊑  GetBanana GetBanana ≡Survive Possible solution: MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡Survive Note that, with this theory, the monkey necessarily needs to get the banana to survive. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 2

  3. Expansion of a TBox Expand the TBox below: MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡Survive T’, expansion of T (The Venn diagram gives a possible model): MonkeyLow ≡  Survive ⊓  ClimbBox GetBanana ≡Survive ClimbBox Survive GetBanana MonkeyLow TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING Notice that the fact that a monkey climbs the box does not necessarily mean that it survives. 3

  4. Satisfiability with respect to a TBox T (I) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING RECALL: A concept P is satisfiable w.r.t. a terminology T, if there exists an interpretationI with I⊨θ for all θ∈T, and such that I⊨P, namely I(P) is not empty 4

  5. Satisfiability with respect to a TBox T (II) Suppose we model the Monkey-Banana problem as follows: “If the monkey is low in position then it cannot get the banana. If the monkey gets the banana it survives”. TBox T MonkeyLow ⊑  GetBanana GetBanana ⊑ Survive Is T satisfiable? Survive GetBanana MonkeyLow TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING YES! Look at the Venn diagram 5

  6. Satisfiability with respect to a TBox T (III) Suppose we model the Monkey-Banana problem as follows: TBox T MonkeyLow ⊑  GetBanana GetBanana ⊑ Survive Is it possible for a monkey to survive even if it does not get the banana? We can restate the problem as follow: does T ⊨  GetBanana ⊓ Survive ? Survive GetBanana MonkeyLow TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING YES! Look at the Venn diagram 6

  7. Translate the following statements in DL (I) All users can download files User ⊑ ∃Download.File A read access user can read files only ReadAccesUser ⊑ ∀Read.File Those who can write can also read Write⊑ Read A limited user can download no more than 3 files LimitedUser ⊑ ≤3 Download.File TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  8. Translate the following statements in DL (I) Programmers write programs Programmer ⊑ ∃Write.Programs Producers can produce music and song files only Music ⊑ File Song ⊑ File Producer ⊑ ∀Produce.(Music ⊔ Song) A program can be downloaded by developers only Program ⊑ ∀Download-1.Developer TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  9. Define a TBox and ABox for the following problem Diana wants to give read access to her friends to the files on her PC, and write access to her best friend Gloria only. Bill is just a friend. Friend ⊑ ∃Read.File BestFriend ⊑ ∃Write.File ⊓ Friend BestFriend(Gloria) Friend(Bill) Can Gloria read Diana’s files? Yes BestFriend(Gloria)  Friend(Gloria)  ∃Read.File(Gloria) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  10. Define a TBox and ABox for the following problem In a library, employees have access to books. However, a loaned book is a non precious book and can be read by clients. Mary is a client and reads a book titled “Top stories”. Employee ⊑ ∃Access.Book LoanedBook⊑ Book ⊓ Precious ⊓ ∀Read-1.Client Client(Mary) Book(TopStories) Read(Mary,TopStories) Is it possible for the book to be precious? Yes We can verify that Precious(TopStories) is consistent with the ABox and TBox above. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  11. Defining the TBox and ABox: the LDKR Class TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Define a TBox and ABox for the following database: ABox = {Italian(Fausto), Italian(Enzo), Chinese(Rui), Indian(Bisu), BlackHair(Enzo), BlackHair(Rui), BlackHair(Bisu), WhiteHair(Fausto)} TBox = {Italian ⊑ LDKR, Indian ⊑ LDKR, Chinese ⊑ LDKR, BlackHair ⊑ LDKR, WhiteHair ⊑ LDKR} LDKR NOTE: ClassL is not expressive enough to represent database constrains such as keys involving two fields. 11

  12. Formalization of a semantic network TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING Person ⊑ ∃Drives.Car Person ⊑ ∃HasHobby.SportCar Person ⊑ ∃HasHobby.Opera Student ⊑ Person SportCar ⊑ Car Student(Ralf) Opera(DonCarlos) instance-of instance-of

  13. Venn diagrams TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Provide the Venn diagram for: A ⊑ B ⊓ ¬Cas a way to prove the satisfiability C B A

  14. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  15. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  16. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  17. TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING

  18. Using DPLL for reasoning tasks TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • DPLL solves the CNFSAT-problem by searching a truth-assignment that satisfies all clauses θi in the input proposition P = θ1 … θn • DL sentences must to be translated in PL (via TBox and ABox elimination) • 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 18

  19. Reduce to PL reasoning TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING The steps: T’ = Normalize(T); C’ = Expand(C, T’); D’ = Expand(D, T’); C’ = RewriteInPL(C’); D’ = RewriteInPL(D’); return DPLL(C’ → D’); • Consider the TBox T = {A ⊑ B ⊔ C, C ⊑ D ⊓ E}. Determine if A ⊑ E by elimination of T. T’ = {A ≡ (B ⊔ C) ⊓ X, C ≡ D ⊓ E ⊓ Y} A’ = (B ⊔ (D ⊓ E ⊓ Y)) ⊓ X E’ = E A’ = (B (D E  Y)) X E’ = E Call DPLL((B (D E  Y)) X → E) (Note that the formula has to be converted in CNF first)

  20. Satisfiability of a TBox (a set of formulas) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Say if the following TBox is satisfiable and provide a class valuation in the case: FederalAgent ⊑ ∃Access.TopSecretDocument XFile ⊑ TopSecretDocument ⊓ Restricted ⊓ ∀Read-1.Policeman I(FederalAgent) = {A} We have that I ⊨ T I(TopSecretDocument) = {D1, D2} I(Access) = {(A, D1), (A, D2)} I(XFile) = {D1} I(Restricted) = {D2} I(Read) = {(B, D1)} I(Policeman) = {B}

  21. Satisfiability w.r.t. a TBox TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Consider the TBox T: FederalAgent ⊑ ∃Access.TopSecretDocument XFile ⊑ TopSecretDocument ⊓ Restricted ⊓ ∀Read-1.Policeman and the formula P: TopSecretDocument ⊓ Restricted does T ⊨ P ? • Yes, if fact these is an interpretation I (e.g. the one of the previous exercise) such that I ⊨ T and I ⊨ P. I(TopSecretDocument) = {D1, D2} I(Restricted) = {D1} • Notice that T does not affect P at all (i.e. we cannot further expand P w.r.t. T)

  22. Subsumption TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Consider the TBox T: FederalAgent ⊑ ∃Access.TopSecretDocument XFile ⊑ TopSecretDocument ⊓ Restricted ⊓ ∀Read-1.Policeman does T ⊨ TopSecretDocument ⊑ Restricted? By definition, it must be I(TopSecretDocument)  I(Restricted ) for every model I of T. Even if this is true for the I of the previous exercise, this is not true in general. It is enough to provide a counterexample: • I(XFile) = {D2} • I(Restricted) = {D1} • I(Read) = {(B, D2)} • I(Policeman) = {B} • I(FederalAgent) = {A} • I(TopSecretDocument) = {D2} • I(Access) = {(A, D1), (A, D2)}

  23. Satisfiability of a TBox using tableaux TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Say if the following TBox is satisfiable using the tableaux: FederalAgent ⊑ ∃Access.TopSecretDocument XFile ⊑ TopSecretDocument ⊓ Restricted ⊓ ∀Read-1.Policeman Translate into a formula: ( FederalAgent ⊔ ∃Access.TopSecretDocument) ⊓ ( XFile ⊔ (TopSecretDocument ⊓ Restricted ⊓ ∀Read-1.Policeman)) Apply the tableaux rules: (1)  FederalAgent(x) or ∃Access.TopSecretDocument(x) and (2)  Xfile(x) or {TopSecretDocument(x), Restricted(x), ∀Read1.Policeman(x)}…

  24. Expansion of an ABox TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • Provide the expansion of A w.r.t. T (without normalization), where: TBox T = {Student ⊑ Faculty, Professor ⊑ Faculty ⊓ Teach} ABox A = {Professor(Bob), Faculty(Rui)} Professor(Bob), Faculty(Bob), Teach(Bob) Faculty(Rui)

  25. ABox Consistency TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • An ABox A is consistent with respect to a TBox T if there is an interpretation I which is a model of both A and T. T = {Parent⊑≤1hasChild} A = {hasChild(mary, bob), hasChild(mary, cate), Parent(mary)} A is consistent ALONE but is not consistent with respect T. In fact, from A mary has two children while T imposes maximum one 25

  26. ABox: Instance checking (I) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING • A: • Mother(Anna) • Father(Bob) • has(Cate,Anna) • has(Cate,Bob) Given the TBox and ABox below • T: • Female⊑Human • Male⊑Human • Mother⊑Female • Father⊑Male • Child≡∃has.Mother⊓ ∃has.Father • Male⊓Female⊑⊥ • Prove: • Human(Anna) • ¬Female(Bob) • Child(Cate) 26

  27. ABox: Instance checking (II) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING Expand A w.r.t. T: • A: • Mother(Anna)  Female(Anna)  Human(Anna) • Father(Bob)  Male(Bob)  Human(Bob) , ¬Female(Bob) • has(Cate,Anna) , has(Cate,Bob)  Child(Cate) 27

  28. ABox: Instance checking (III) TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING Given the ABox A = {R(a,b), R(a, c), A(b)} is a an instance of ∃R.A? Take ∃R.A(a). Given its semantics, there should be {R(a, x), A(x)}  A for some x. If we take x = b we see that this actually holds. 28

More Related