logics for data and knowledge representation

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

Upload: dewitt

Post on 12-Jan-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Logics for Data and Knowledge Representation. Exercises: ClassL. Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese. Outline. Syntax Symbols and formation rules Reasoning with a TBox Reasoning with an ABox. 2. Symbols in ClassL. SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Logics for Data and Knowledge Representation

Logics for Data and KnowledgeRepresentation

Exercises: ClassL

Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

Page 2: Logics for Data and Knowledge Representation

Outline Syntax

Symbols and formation rules Reasoning with a TBox Reasoning with an ABox

2

Page 3: Logics for Data and Knowledge Representation

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

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 4: Logics for Data and Knowledge Representation

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?

⊓ ⊤ ∨ ≡ ⊔ ⊑ → ↔ ⊥ ∧ ⊨

Remember the BNF grammar: <Atomic Formula> ::= A | B | ... | P | Q | ... | | ⊥ ⊤

<wff> ::= <Atomic Formula> | ¬<wff> | <wff> ⊓ <wff> | <wff> ⊔ <wff> |

<Atomic Formula> ⊑ <wff> | <Atomic Formula> ≡ <wff>

4

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 5: Logics for Data and Knowledge Representation

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 !

5

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 6: Logics for Data and Knowledge Representation

Satisfiability Given the TBox T={A⊑B, B⊑A}, is (A⊓B) satisfiable in ClassL?

6

A B

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

RECALL: to prove satisfiability it is enough to find one model.

We can use Venn Diagrams.

In alternative, this can be proved with entailment + DPLL:

P: A⊑B Q: B⊑A S: (A⊓B)

{P, Q} ⊨ S

DPLL(RewriteInPL(P) RewriteInPL(Q) RewriteInPL(T))

DPLL(((A B) (B A)) (A B))

Page 7: Logics for Data and Knowledge Representation

ClassL Exercises 2 Given the TBox T={C⊑A, C⊑B} is (A⊓B) satisfiable in

ClassL?

7

A BC

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 8: Logics for Data and Knowledge Representation

Proprieties of the and (I)∧ ⊓ Suppose that A and B are satisfiable.

Is A ∧ B always satisfiable in PL?

We can easily observe that the fact that A and B are satisfiable does not necessarily imply that A ∧ B is also satisfiable.

Think for instance to the case B = A.

8

A B A∧B

T T T

T F F

F T F

F F F

MODEL for A

MODEL for A

MODEL for B

MODEL for B

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 9: Logics for Data and Knowledge Representation

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.

9

A BA

B A B

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 10: Logics for Data and Knowledge Representation

Satisfiability with respect to a TBox T

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

10

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 11: Logics for Data and Knowledge Representation

Satisfiability with respect to a TBox T 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 TMonkeyLow ⊑ GetBananaGetBanana ⊑ Survive

Is T satisfiable?

Survive

GetBanana MonkeyLow

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

11

YES! Look at the Venn diagram

Page 12: Logics for Data and Knowledge Representation

Satisfiability with respect to a TBox T Suppose we model the Monkey-Banana problem as follows:

TBox TMonkeyLow ⊑ GetBananaGetBanana ⊑ 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⊓ ?

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

12

Survive

GetBanana MonkeyLow

YES! Look at the Venn diagram

Page 13: Logics for Data and Knowledge Representation

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.

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

13

Page 14: Logics for Data and Knowledge Representation

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

ClimbBoxNotice that the fact that a monkey climbs the box does not necessarily mean that it survives.

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

14

Page 15: Logics for Data and Knowledge Representation

ABox: Consistency Check the consistency of A w.r.t. T via expansion.

TMonkeyLow ≡ GetBanana ⊓ ClimbBoxGetBanana ≡ Survive

AMonkeyLow(Cita)Survive(Cita)

Expansion of A is consistent:MonkeyLow(Cita) GetBanana(Cita) ClimbBox(Cita)

Survive(Cita) GetBanana(Cita)

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

15

Page 16: Logics for Data and Knowledge Representation

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

TMonkeyLow ≡ GetBanana ⊓ ClimbBoxGetBanana ≡ Survive

AMonkeyLow(Cita)Survive(Cita)

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

16

Expansion of A MonkeyLow(Cita) GetBanana(Cita)ClimbBox(Cita)

Survive(Cita)GetBanana(Cita)

Page 17: Logics for Data and Knowledge Representation

Instance Retrieval. Consider the following expansion…

17

TUndergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach

Assistant(Rui) PhD(Rui)Teach(Rui) Master(Rui) Research(Rui)Student(Rui)Undergraduate(Rui)

AMaster(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

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 18: Logics for Data and Knowledge Representation

Instance Retrieval. … find the instances of Master

18

TUndergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach

Assistant(Rui) PhD(Rui)Teach(Rui) Master(Rui) Research(Rui)Student(Rui)Undergraduate(Rui)

AMaster(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

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

Page 19: Logics for Data and Knowledge Representation

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.

TMonkeyLow ≡ GetBanana ⊓ ClimbBoxGetBanana ≡ Survive

AMonkeyLow(Cita)Survive(Cita)

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

19

Page 20: Logics for Data and Knowledge Representation

Defining the TBox and ABox: the LDKR Class

Name Nationality Hair

Fausto Italian White

Enzo Italian Black

Rui Chinese Black

Bisu Indian Black

20

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:

SYNTAX :: REASONING WIN A TBOX :: REASONING WITH AN ABOX

LDKR

NOTE: ClassL is not expressive enough to represent database constrains such as keys involving two fields.