l ogics for d ata and k nowledge r epresentation

33
L Logics for D Data and K Knowledge R Representation ClassL (part 2): Reasoning with a TBox 1

Upload: kenley

Post on 07-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

L ogics for D ata and K nowledge R epresentation. ClassL (part 2): Reasoning with a TBox. Outline. Terminology (TBox) Normalization of a TBox Reasoning with the TBox Some definitions Primitive and defined concepts Use and directly use Cyclic and acyclic terminologies - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: L ogics  for  D ata  and  K nowledge  R epresentation

LLogics for DData and KKnowledge RRepresentation

ClassL (part 2): Reasoning with a TBox

1

Page 2: L ogics  for  D ata  and  K nowledge  R epresentation

Outline Terminology (TBox) Normalization of a TBox Reasoning with the TBox

Some definitions Primitive and defined concepts Use and directly use Cyclic and acyclic terminologies Expansion of a TBox

Eliminating the TBox: Reducing to DPLL reasoning

2

Page 3: L ogics  for  D ata  and  K nowledge  R epresentation

Terminological axioms Two new logical symbols

⊑ (subsumption), with σ ⊨ C⊑D iff σ(C)⊆ σ(D)≡ (equivalence), with σ ⊨ C≡D iff σ(C) = σ(D)

Inclusion axioms

C ⊑ D has to be read “C is subsumed by (more specific than / less general than) D”

Equality axioms

C ≡ D has to be read “C is equivalent to D”

NOTE: C ≡ D holds iff both C ⊑ D and D ⊑ C hold

NOTE: ⊑ and ≡ in CLassL are the alter ego of the → and ↔ in PL

NOTE: if C ⊑ D, we can use the symbol ⊒ to say that D ⊒ C to be read “D subsumes (less specific than / more general than) C”

3

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 4: L ogics  for  D ata  and  K nowledge  R epresentation

Semantics: Venn diagrams to represent axioms σ(A ⊑ B)

σ(A ≡ B)

4

B

A

BA

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 5: L ogics  for  D ata  and  K nowledge  R epresentation

Examples of terminological axioms Inclusion Axioms (inclusions)

Master ⊑ StudentWoman ⊑ PersonWoman ⊔ Father ⊑ Person

Equality Axioms (equalities)

Student ≡ PupilParent ≡ Mother ⊔ FatherWoman ≡ Person ⊓ Female

5

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 6: L ogics  for  D ata  and  K nowledge  R epresentation

Definitions and specializations A definition is an equality with an atomic

concept on the left hand

A specialization is an inclusion with an atomic concept on the left hand

6

Bachelor ≡ Student ⊓ UndergraduateWoman ≡ Person ⊓ FemaleParent ≡ Mother ⊔ Father

Student ⊑ Person ⊓ StudyPhD ⊑ Student ⊓ Lecturer

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 7: L ogics  for  D ata  and  K nowledge  R epresentation

Terminology (TBox) A terminology (or TBox) is a set of definitions and

specializations

Terminological axioms express constraints on the concepts of the language, i.e. they limit the possible models

The TBox is the set of all the constraints on the possible models

7

Woman ≡ Person ⊓ FemaleMan ≡ Person ⊓ ¬WomanStudent ⊑ Person ⊓ StudyBachelor ≡ Student ⊓ UndergraduatePhD ⊑ Student ⊓ Lecturer

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 8: L ogics  for  D ata  and  K nowledge  R epresentation

Normalization of a TBox It is always possible to transform a specialization into

a definition by introducing an auxiliary symbol as follows:

If from a TBox we transform all specializations into definitions we say we have normalized the TBox

A TBox with definitions only is called a regular terminology

8

Woman ⊑ Person (the specialization)

Woman ≡ Person ⊓ Female (the normalized specialization)

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 9: L ogics  for  D ata  and  K nowledge  R epresentation

Reasoning with a TBox T Given two class-propositions P and Q, we want to

reason about the following relations between them:

Satisfiability w.r.t. T T ⊨ P ?

Subsumption T ⊨ P ⊑ Q? T ⊨ Q ⊑ P?

Equivalence T ⊨ P ⊑ Q and T ⊨ Q ⊑ P?

Disjointness T ⊨ P ⊓ Q ⊑ ⊥?

9

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 10: L ogics  for  D ata  and  K nowledge  R epresentation

Satisfiability with respect to a TBox T A concept P is satisfiable w.r.t. a terminology T, if there

exists (or for all) an interpretation I with I ⊨ θ for all θ ∈ T, and such that I ⊨ P, namely I(P) is not empty

In this case we also say that I is a model for P

In other words, the interpretation I not only satisfies P, but also complies with all the constraints in T

NOTE: Instead of σ in DL literature the symbol I (interpretation) is preferred. Therefore, from now on we use it instead of σ.

10

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 11: L ogics  for  D ata  and  K nowledge  R epresentation

Satisfiability with respect to a TBox T Suppose we describe the students/listeners in a course:

The TBox is satisfiable. A possible model is:

11

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach TBox T

Student Undergraduate

BachelorMaster

Research PhD

Teach

Assistant

In this model the two concepts Bachelor and Assistant are

satisfiable w.r.t. T, while the

concept Assistant ⊓

Bachelor is not.

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 12: L ogics  for  D ata  and  K nowledge  R epresentation

TBox reasoning: subsumption Let T be a TBox. Subsumption (with respect to T):

T ⊨ P ⊑ Q (P ⊑T Q)

A concept P is subsumed by a concept Q with respect to T if I(P) I(Q) for every model I of T

NOTE: subsumption is a property of all models. Used to implement entailment and validity (when T empty)

12

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 13: L ogics  for  D ata  and  K nowledge  R epresentation

Subsumption with respect to a TBox T (1) Suppose we describe the students/listeners in a course:

T ⊨ PhD ⊑ Student

13

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach TBox T

Student Undergraduate

BachelorMaster

Research PhD

Teach

Assistant

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 14: L ogics  for  D ata  and  K nowledge  R epresentation

Subsumption with respect to a TBox T (2)PhD ⊑ Student

Proof:

PhD

≡ Master ⊓ Research

≡ (Student ⊓ Undergraduate) ⊓ Research

⊑ Student

14

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 15: L ogics  for  D ata  and  K nowledge  R epresentation

TBox reasoning: equivalence Let T be a TBox. Equivalence (with respect to T):

(T ⊨ P ≡ Q) (P ≡T Q)

Two concepts P and Q are equivalent with respect to T if I(P) = I(Q) for every model I of T.

NOTE: equivalence is a property of all models.

15

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 16: L ogics  for  D ata  and  K nowledge  R epresentation

Equivalence with respect to a TBox T (1) Suppose we describe the students/listeners in a course:

T ⊨ Student Bachelor ⊔ Master

16

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach TBox T

Student Undergraduate

BachelorMaster

Research PhD

Teach

Assistant

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 17: L ogics  for  D ata  and  K nowledge  R epresentation

Equivalence with respect to a TBox T (2)Student ≡ Bachelor ⊔ Master

Proof:

Bachelor ⊔ Master

≡ (Student ⊓ Undergraduate) ⊔ Master

≡ (Student ⊓ Undergraduate) ⊔ (Student ⊓ Undergraduate)

≡ Student ⊓ (Undergraduate ⊔ Undergraduate)

≡ Student ⊓⊤

≡ Student

17

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 18: L ogics  for  D ata  and  K nowledge  R epresentation

TBox reasoning: disjointness Let T be a TBox. Disjointness (with respect to T):

T ⊨ P ⊓ Q ⊑ ⊥ (P ⊓ Q ⊑T ⊥)

Two concepts P and Q are disjoint with respect to T if their intersection is empty, I(P) I(Q) = ∅, for every model I of T.

NOTE: disjointness is a property of all models

18

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 19: L ogics  for  D ata  and  K nowledge  R epresentation

Disjointness with respect to a TBox T (1) Suppose we describe the students/listeners in a course:

T ⊨ Undergraduate ⊓ Assistant ⊑ ⊥

19

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach TBox T

Student Undergraduate

BachelorMaster

Research PhD

Teach

Assistant

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 20: L ogics  for  D ata  and  K nowledge  R epresentation

Disjointness with respect to a TBox T (2) It can be proved showing that:

T ⊨ Undergraduate ⊓ Assistant ⊑ ⊥

Proof:

Undergraduate ⊓ Assistant

⊑ Teach ⊓ Assistant

≡ Teach ⊓ PhD ⊓ Teach

≡ ⊥ ⊓ PhD

≡ ⊥

20

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 21: L ogics  for  D ata  and  K nowledge  R epresentation

Exercise

21

Suppose we describe the students/attendees in a course:

Is Bachelor ⊓ PhD satisfiable?

NO! Consider the following propositions:

Assistant, Student, Bachelor, Teach, PhD, Master ⊓ Teach1. Which pairs are subsumed/supersumed?2. Which pairs are disjoint?

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ Teach TBox T

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 22: L ogics  for  D ata  and  K nowledge  R epresentation

TBox: primitive and defined concepts In a TBox there are two kinds of concepts (symbols):

Primitive concepts (or base symbols), which occur only on the right hand of axioms

Defined concepts (or name symbols) which occur on the left hand of axioms

22

A ⊑ B ⊓ (C ⊔ D)

B, C and D are primitive concepts. A is a defined concept

Undergraduate ⊑ TeachBachelor ≡ Student ⊓ UndergraduateMaster ≡ Student ⊓ UndergraduatePhD ≡ Master ⊓ ResearchAssistant ≡ PhD ⊓ TeachTeach, Student and Research are primitive concepts. Undergraduate, Bachelor, Master, PhD and Assistant are defined.

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 23: L ogics  for  D ata  and  K nowledge  R epresentation

Use and direct useLet A and B be atomic concepts in a terminology T. We say that A directly uses B in T if B appears in the

right hand of the defintion of A.

We say that A uses B in T if B appears in the right hand after the definition of A has been “unfolded” so that there are only primitive concepts in the left hand side of the definition of A

23

A ⊑ B ⊓ (C ⊔ D)

A directly uses B, C, D

A ⊑ B ⊓ (C ⊔ D) ---> A ⊑ (C ⊔ E) ⊓ (C ⊔ D)

B ⊑ C ⊔ E

A directly uses B; A uses E (because B is defined in terms of E)

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 24: L ogics  for  D ata  and  K nowledge  R epresentation

Cyclic and acyclic terminologies A terminology T contains a cycle (is cyclic) if it contains a

concept which uses itself.

A terminilogy is acyclic otherwise

24

Parent ≡ Father ⊔ Mother

Father ⊑ Male

Mother ⊑ Female

Male ≡ Person ⊓ Female

Is acyclic

Father ≡ Male ⊓ hasChild

hasChild ≡ Father ⊔ Mother

Is cyclic

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 25: L ogics  for  D ata  and  K nowledge  R epresentation

Expansion and equivalent terminologies The expansion T’ of an acyclic terminology T is a terminology

obtained from T by unfolding all definitions until all concepts occurring on the right hand side of definitions are primitive

T and T’ are equivalent when they have the same expansion. Reasoning with T’ will yield the same results as reasoning with

T. If T’ is the expansion of T then they are equivalent.

NOTE: it is possible to expand also a cyclic TBox.

In some cases some models exist even if the TBox is cyclic. These models are called fixpoints and there are some methods to find them and break the recursion (we will not see them).

25

T T’

A ⊑ B ⊓ (C ⊔ D) A ⊑ (C ⊔ E) ⊓ (C ⊔ D)

B ⊑ (C ⊔ E) B ⊑ (C ⊔ E)

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 26: L ogics  for  D ata  and  K nowledge  R epresentation

Expansion requires normalization To expand a terminology we should first normalize it.

Otherwise, if we use a specialization to expand a definition, the definition reduces to a specialization

From now on we deal with regular terminologies only

(see next slide for the regular version of the terminology T above)

26

T

Parent ≡ Father ⊔ MotherFather ⊑ MaleMother ⊑ FemaleMale ≡ Person ⊓ Female

T’

Parent ⊑ (Person ⊓ Female) ⊔ FemaleFather ⊑ Person ⊓ Female Mother ⊑ FemaleMale ≡ Person ⊓ Female

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 27: L ogics  for  D ata  and  K nowledge  R epresentation

Concept expansion For each concept C we define the expansion of C with

respect to T as the concept C’ that is obtained from C by replacing each occurrence of a name symbol A in C by the concept D, where A≡D is the definition of A in T’, the expansion of T

27

TParent ≡ Mother ⊔ FatherFather ≡ Male ⊓ hasChildMother ≡ Female ⊓ hasChildMale ≡ Person ⊓ Female

The expansion of Parent w.r.t. T is: (Female ⊓ hasChild) ⊔ (Person ⊓ Female ⊓ hasChild)

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 28: L ogics  for  D ata  and  K nowledge  R epresentation

Expansion, final considerations As we are going to see, expanding a TBox is an

important step to reason on it.

The expansion of T to T’ or C to C’ can be costly:

In the worst case T’ is exponential in the size of T, and this propagates to single concepts.

28

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 29: L ogics  for  D ata  and  K nowledge  R epresentation

PL and ClassL: table of the symbols

PL ClassL

Syntax ∧ ⊓

∨ ⊔

⊤ ⊤

⊥ ⊥

→ ⊑

↔ ≡

P, Q... P, Q...

Semantics ∆={true, false} ∆={o, …} (compare models)

29

RECALL: A proposition P is true iff it is satisfiable

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 30: L ogics  for  D ata  and  K nowledge  R epresentation

PL and ClassL are notational variants Theorem: P is satisfiable w.r.t. an intensional

interpretation ν if and only if P is satifisfiable w.r.t. an extensional interpretation σ

(already seen in ClassL without the TBox)

30

INTRODUCTION :: SYNTAX :: SEMANTICS :: PL AND CLASSL :: CLASSL REASONINGTBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 31: L ogics  for  D ata  and  K nowledge  R epresentation

Reduction to subsumption and unsatisfiability Reduction to subsumption. Given two concepts C and D,

C is unsatisfiable ⇔ C ⊑ ⊥ C ≡ D ⇔ C ⊑ D and D ⊑ C C ⊥ D ⇔ C ⊓ D ⊑ ⊥

Reduction to unsatisfiability. Given two concepts C and D, C ⊑ D ⇔ C ⊓ D is unsatisfiable C ≡ D ⇔ both (C ⊓ D) and (C ⊓ D) are unsatisfiable C ⊥ D ⇔ C ⊓ D is unsatisfiable

31

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 32: L ogics  for  D ata  and  K nowledge  R epresentation

Eliminating the TBox using expansionAssume C’ expansion of C w.r.t. T.

For all σ satisfying all the axioms in T we have: T ⊨ C iff σ ⊨ C’ (Satisfiability) T ⊨ C ⊑ D iff σ ⊨ C’ ⊑ D’ (Subsumption,

Equivalence) T ⊨ C ⊓ D ⊑ ⊥ iff σ ⊨ C’ ⊓ D’ ⊑ ⊥ (Disjointness)

32

TPerson ≡ Male ⊓ FemaleMale ≡ Person ⊓ Female

Is Person satisfiable? NO!

The expansion of Person w.r.t. T is: (Person ⊓ Female) ⊓ Femalewhich is equivalent to ⊥ and therefore unsatisfiable

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Page 33: L ogics  for  D ata  and  K nowledge  R epresentation

Eliminating the TBox: the algorithm With acyclic TBoxes T it is always possible to reduce reasoning

problems w.r.t. T to problems without T. See for instance the algorithm for subsumption (all the others can be reduced to it).

Input: a TBox T, the two concepts C and D Output: true if C ⊑ D holds or false otherwise

boolean function IsSubsumedBy(T, C, D) {

T’ = Normalize(T);

C’ = Expand(C, T’);

D’ = Expand(D, T’);

C’ = RewriteInPL(C’);

D’ = RewriteInPL(D’);

return DPLL(C’ → D’);

}

33

Normalization

Expansion, TBox elimination

DPLL Reasoning

TBOX :: NORMALIZATION :: REASONING WITH A TBOX :: DEFINITIONS :: ELIMINATING THE TBOX

Conversion in PL