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

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 as query language.
Logics for Data and Knowledge Representation Exercises: Languages Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
LDK R Logics for Data and Knowledge Representation Exercise 1: Model and Language.
Intro to Discrete Structures
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation Exercise 2: PL, ClassL, Ground ClassL.
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 Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
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,
Logics for Data and Knowledge Representation Languages for Data Representation First version by Alessandro Agostini and Fausto Giunchiglia Second version.
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.
DL Overview Second Pass Ming Fang 06/19/2009. Outlines  Description Languages  Knowledge Representation in DL  Logical Inference in DL.
Logics for Data and Knowledge Representation
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
LDK R Logics for Data and Knowledge Representation ClassL (part 2): Reasoning with a TBox 1.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
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.
Of 29 lecture 15: description logic - introduction.
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,
LDK R Logics for Data and Knowledge Representation Modal Logic: exercises Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Ontology Technology applied to Catalogues Paul Kopp.
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
ece 720 intelligent web: ontology and beyond
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
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
Presentation transcript:

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

SYNTAX 2

Symbols in ClassL 1. Which of the following symbols are used in ClassL? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ 2. Which of the following symbols are in well formed formulas? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ 3

Symbols in ClassL (solution) 1. Which of the following symbols are used in ClassL? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ 2. Which of the following symbols are in well formed formulas? ⊓  ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨ 4

Extended formation rules The basic BNF grammar: ::= A | B |... | P | Q |... | ⊥ | ⊤ ::= | ¬ | ⊓ | ⊔ TBox: ::= ≡ ::= ⊑ ABox: ::= a | b |... | ::= ( ) 5

Formation rules  Which of the following is not a wff in ClassL? 1.  MonkeyLow ⊔ BananaHigh 2.   MonkeyLow ⊓ BananaHigh ⊑  GetBanana 3. MonkeyLow  ⊓ BananaHigh 4. MonkeyLow   GetBanana NUM 2, 3, 4 ! 6

MODELING 7

Formalization of simple sentences Propositional DL (ClassL) has pretty poor expressiveness. For instance, we cannot represent attributes and relations effectively. 8 The set of games which are not legal Game ⊓  Legal Lakes are locations Lake ⊑ Location Lakes are locations made of water Lake ⊑ Location ⊓ MadeofWater Persons can be distinguished into male and female Male ⊑ Person Female ⊑ Person Male and Female are disjoint Male ⊓ Female ⊑ ⊥ Persons have a birthplace Person ⊑ hasBirthDate The set of documents about “programming in Java” are a subset of the documents about “programming languages” and “computer science” JavaProgramming ⊑ ProgrammingLanguage ⊓ ComputerScience

Formalization of a problem in ClassL Unicorns are mythical horses having a horn. Pegasus is a unicorn while Mike is not. Unicorn ⊑ mythical ⊓ horse ⊓ hasHorn Unicorn(Pegasus),  Unicorn(Mike) There are two kinds of students: master students and PhD students. All PhD students do research. Ronald is a master student that does research. MasterStudent ⊑ Student PhDStudent ⊑ Student ⊓ doResearch MasterStudent(Ronald) doResearch(Ronald) 9

Formalization of a semantic network T = {BodyOfWater ⊑ Location, PopulatedPlace ⊑ Location, Lake ⊑ BodyOfWater, City ⊑ PopulatedPlace, Country ⊑ PopulatedPlace} A = {Person(GiorgioNapolitano), Lake(GardaLake), City(Trento), Country(Italy), Part(GardaLake,Trento), Part(Trento, Italy), PresidentOf(GiorgioNapolitano, Italy)} 10

Defining the TBox and ABox: the LDKR Class NameNationalityHair FaustoItalianWhite EnzoItalianBlack RuiChineseBlack BisuIndianBlack 11 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}  Define a TBox and ABox for the following database: LDKR NOTE: ClassL is not expressive enough to represent database constrains such as keys involving two fields.

SEMANTICS 12

Proprieties of the ∧ and ⊓ (I)  Suppose that A and B are satisfiable. Is A ∧ B always satisfiable in PL? We can observe that the fact that A and B are satisfiable (alone) does not necessarily imply that A ∧ B is also satisfiable. It is instead the case when they are satisfiable by the same model. Think for instance to the case B =  A. 13 AB A∧BA∧B TTT TFF FTF FFF MODEL for A MODEL for B

Proprieties of the ∧ and ⊓ (II)  Suppose that A and B are satisfiable. Is A ⊓ B always satisfiable in ClassL? We can easily observe that the fact that A and B are satisfiable does not imply that A ⊓ B is also satisfiable. Think to the case in which their extensions are disjoint. Differently from PL, this might not be the case even when they are satisfiable by the same model. 14 AB A BAB

TBOX REASONING 15

Satisfiability with respect to a TBox T RECALL: Satisfiability in one model 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 Satisfiability in all models (validity) A concept P is satisfiable w.r.t. a terminology T, if for all interpretations I with I ⊨ θ for all θ ∈ T, and such that I ⊨ P, namely I(P) is not empty 16

Satisfiability with respect to a TBox (I)  Given the TBox T={A ⊑ B, B ⊑ A}, is  (A ⊓ B) satisfiable in ClassL? This corresponds to the problem: T ⊨  (A ⊓ B) 17 AB To prove satisfiability in all models we need to prove validity; this can be proved with DPLL: DPLL(RewriteInPL(A ⊑ B)  RewriteInPL(B ⊑ A)  RewriteInPL(  (A ⊓ B) )) DPLL(((A  B)  (B  A))   (A  B)) To prove satisfiability in one model it is enough to find one model; we can use Venn Diagrams.

Satisfiability with respect to a TBox (II)  Given the TBox T={C ⊑ A, C ⊑ B} is  (A ⊓ B) satisfiable in one model? 18 AB C

Satisfiability with respect to a TBox (III)  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 19 YES! Look at the Venn diagram

Satisfiability with respect to a TBox (IV)  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 ? 20 Survive GetBanana MonkeyLow YES! Look at the Venn diagram

Subsumption 21 Suppose we describe the students/attendees in a course: Are assistants undergraduates? T ⊨ Assistant ⊑ Undergraduate Assistant ≡ PhD ⊓ Teach ≡ Master ⊓ Research ⊓ Teach ≡ Student ⊓  Undergraduate ⊓ Research ⊓ Teach Assistants are actually students who are not undergraduate. Undergraduate ⊑  Teach Bachelor ≡ Student ⊓ Undergraduate Master ≡ Student ⊓  Undergraduate PhD ≡ Master ⊓ Research Assistant ≡ PhD ⊓ Teach TBox T

Disjointness 22 Suppose we describe the students/attendees in a course: Are Bachelor and master disjoint? T ⊨ Bachelor ⊓ Master ⊑ ⊥ (Student ⊓ Undergraduate) ⊓ (Student ⊓  Undergraduate) Student ⊓ (Undergraduate ⊓  Undergraduate) ≡ ⊥ Undergraduate ⊑  Teach Bachelor ≡ Student ⊓ Undergraduate Master ≡ Student ⊓  Undergraduate PhD ≡ Master ⊓ Research Assistant ≡ PhD ⊓ Teach TBox T

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. 23

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 Survive GetBanana MonkeyLow ClimbBox Notice that the fact that a monkey climbs the box does not necessarily mean that it survives. 24

ABOX REASONING 25

ABox: Consistency  Check the consistency of A w.r.t. T via expansion. T MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡ Survive A MonkeyLow(Cita)  Survive(Cita) Expansion of A is consistent: MonkeyLow(Cita)  GetBanana(Cita)  ClimbBox(Cita)  Survive(Cita)  GetBanana(Cita) 26

ABox: Instance checking  Given T and A below  Is Cita an instance of MonkeyLow? YES  Is Cita an instance of ClimbBox? NO  Is Cita an instance of GetBanana? NO T MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡ Survive A MonkeyLow(Cita)  Survive(Cita) 27 Expansion of A MonkeyLow(Cita)  GetBanana(Cita)  ClimbBox(Cita)  Survive(Cita)  GetBanana(Cita)

Instance Retrieval. Consider the following expansion… 28 T Undergraduate ⊑  Teach Bachelor ≡ Student ⊓ Undergraduate Master ≡ Student ⊓  Undergraduate PhD ≡ Master ⊓ Research Assistant ≡ PhD ⊓ Teach Assistant(Rui) PhD(Rui) Teach(Rui) Master(Rui) Research(Rui) Student(Rui)  Undergraduate(Rui) A Master(Chen) PhD(Enzo) Assistant(Rui) Master(Chen) Student(Chen)  Undergraduate(Chen) PhD(Enzo) Master(Enzo) Research(Enzo) Student(Enzo)  Undergraduate(Enzo) The expansion of A

Instance Retrieval. … find the instances of Master 29 T Undergraduate ⊑  Teach Bachelor ≡ Student ⊓ Undergraduate Master ≡ Student ⊓  Undergraduate PhD ≡ Master ⊓ Research Assistant ≡ PhD ⊓ Teach Assistant(Rui) PhD(Rui) Teach(Rui) Master(Rui) Research(Rui) Student(Rui)  Undergraduate(Rui) A Master(Chen) PhD(Enzo) Assistant(Rui) Master(Chen) Student(Chen)  Undergraduate(Chen) PhD(Enzo) Master(Enzo) Research(Enzo) Student(Enzo)  Undergraduate(Enzo) The expansion of A

ABox: Concept realization  Find the most specific concept C such that A ⊨ C(Cita) Notice that MonkeyLow directly uses GetBanana and ClimbBox, and it uses Survive. The most specific concept is therefore MonkeyLow. T MonkeyLow ≡  GetBanana ⊓  ClimbBox GetBanana ≡ Survive A MonkeyLow(Cita)  Survive(Cita) 30