Logics for Data and Knowledge Representation

Slides:



Advertisements
Similar presentations
OWL - DL. DL System A knowledge base (KB) comprises two components, the TBox and the ABox The TBox introduces the terminology, i.e., the vocabulary of.
Advertisements

LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation Modeling Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang.
LDK R Logics for Data and Knowledge Representation Description Logics: tableaux.
LDK R Logics for Data and Knowledge Representation Description Logics as query language.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Tableau Algorithm.
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
LDK R Logics for Data and Knowledge Representation Exercise 3: DLs.
Logics for Data and Knowledge Representation Exercises: Modeling Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
LDK R Logics for Data and Knowledge Representation ClassL (part 3): Reasoning with an ABox 1.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Description Logics: Logic foundation of Semantic Web Semantic.
Logics for Data and Knowledge Representation Exercises: DL.
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation PL of Classes.
LDK R Logics for Data and Knowledge Representation Description Logics (ALC)
LDK R Logics for Data and Knowledge Representation Description Logics.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Logics for Data and Knowledge Representation
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
Logics for Data and Knowledge Representation Exercises: ClassL Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
LDK R Logics for Data and Knowledge Representation ClassL (part 2): Reasoning with a TBox 1.
ece 627 intelligent web: ontology and beyond
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Logics for Data and Knowledge Representation Exercises: DL.
LDK R Logics for Data and Knowledge Representation Description Logics: family of languages.
LDK R Logics for Data and Knowledge Representation Modal Logic: exercises Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
LDK R Logics for Data and Knowledge Representation Description Logics.
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Knowledge Representation and Reasoning
Exercises: First Order Logics (FOL)
Logics for Data and Knowledge Representation
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
Propositional Logic: exercises
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
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
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
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
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Presentation transcript:

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

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

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

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

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

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

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

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

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)

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.

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

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)

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

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

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

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

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

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

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’);

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}

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)

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}

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)} …

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)

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

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

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

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