Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logics for Data and Knowledge Representation

Similar presentations


Presentation on theme: "Logics for Data and Knowledge Representation"— Presentation transcript:

1 Logics for Data and Knowledge Representation
Exercises: Description Logics Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

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

3 TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING
Expansion of a TBox TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING Expand the TBox below: MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡ Survive T’, expansion of T (The Venn diagram gives a possible model): MonkeyLow ≡  Survive ⊓  ClimbBox Survive GetBanana MonkeyLow ClimbBox 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 interpretation I with I ⊨ θ for all θ ∈ T, and such that I ⊨ P, namely I(P) is not empty ADD EXAMPLE 4

5 Satisfiability with respect to a TBox T (II)
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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? YES! Look at the Venn diagram Survive GetBanana MonkeyLow 5

6 Satisfiability with respect to a TBox T (III)
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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 ? YES! Look at the Venn diagram Survive GetBanana MonkeyLow 6

7 Translate the following statements in DL (I)
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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

8 Translate the following statements in DL (I)
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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

9 Define a TBox and ABox for the following problem
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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)

10 Define a TBox and ABox for the following problem
TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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.

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 Name Nationality Hair Fausto Italian White Enzo Black Rui Chinese Bisu Indian 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 instance-of Person ⊑ ∃Drives.Car Person ⊑ ∃HasHobby.SportCar Person ⊑ ∃HasHobby.Opera Student ⊑ Person SportCar ⊑ Car Student(Ralf) Opera(DonCarlos)

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

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 TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING
Reduce to PL reasoning TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING 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 Call DPLL((B  (D  E  Y))  X → E) (Note that the formula has to be converted in CNF first) The steps: T’ = Normalize(T); C’ = Expand(C, T’); D’ = Expand(D, T’); C’ = RewriteInPL(C’); D’ = RewriteInPL(D’); return DPLL(C’ → D’);

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 FederalAgent ⊑ ∃Access.TopSecretDocument
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(FederalAgent) = {A} I(TopSecretDocument) = {D2} I(Access) = {(A, D1), (A, D2)} I(XFile) = {D2} I(Restricted) = {D1} I(Read) = {(B, D2)} I(Policeman) = {B}

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 TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING
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 TBOX :: MODELING IN DL :: PROOFS :: TBOX REASONING :: ABOX REASONING
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 Given the TBox and ABox below T: Female⊑Human Male⊑Human Mother⊑Female Father⊑Male Child≡∃has.Mother⊓ ∃has.Father Male⊓Female⊑⊥ A: Mother(Anna) Father(Bob) has(Cate,Anna) has(Cate,Bob) 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


Download ppt "Logics for Data and Knowledge Representation"

Similar presentations


Ads by Google