OpenHPI 4.7 - Resolution

17
This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0 ) Dr. Harald Sack Hasso Plattner Institute for IT Systems Engineering University of Potsdam Spring 2013 Semantic Web Technologies Lecture 4: Knowledge Representations I 07: Resolution

description

 

Transcript of OpenHPI 4.7 - Resolution

Page 1: OpenHPI 4.7 - Resolution

This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)

Dr. Harald Sack

Hasso Plattner Institute for IT Systems Engineering

University of Potsdam

Spring 2013

Semantic Web Technologies

Lecture 4: Knowledge Representations I07: Resolution

Page 2: OpenHPI 4.7 - Resolution

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

2

Lecture 4: Knowledge Representations I

Open HPI - Course: Semantic Web Technologies

Page 3: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

3

07 Resolution (PL)Open HPI - Course: Semantic Web Technologies - Lecture 4: Knowledge Representations I

Page 4: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

430

A Calculator Machine for Logic

■Recall:

■A formula F is a logical consequence of a theory (knowledge base) T,

i.e., T ⊨ F, iff

all models of T are also models of F

■Problem:

■We have to consider all possible interpretations.

■How do we do this in practice?

Page 5: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

530

A Calculator Machine for Logic

■Problem:

■We have to consider all possible interpretations.

■How do we do this in practice?

■Therefore, logical consequence is implemented via syntactical methods (= Calculus).

■For the logical calculus, there must be proven:

■Correctness: every syntactic entailment is also a semantic entailment, if T ⊢ F then T ⊨ F

■Completeness: all semantic entailments are also syntactic entailments, if T ⊨ F then T ⊢ F

Gottfried Wilhelm Leibniz (1646-1716)

Page 6: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

630

Resolution

{F1,…,Fn} with F0 as logical Consequence

{F1,…,Fn} ⊨ F0

F1 ∧… ∧ Fn → F0 is a tautology

¬(F1 ∧… ∧ Fn → F0) is a contradiction

G1 ∧ …∧ Gk is a contradiction

□ The resolution procedure allows the entailment of a contradictionfrom G1 ∧ …∧ Gk.

Theory

equi

vale

nt a

sser

tions

John Alan Robinson, "A Machine-Oriented Logic Based on the Resolution Principle", Communications of the ACM, 5:23–41, 1965.

John Alan Robinson

□ Resolution is based on simple deduction rules and is a special form of enumeration

□ Instead of proofing that a formula is a tautology, it deducts a logical contradiction from its negation

Page 7: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

730

Resolution (Propositional Logic)

■ If (p1∨…∨pk∨p∨¬q1∨…∨¬ql)∧(r1∨…∨rm∨¬p∨¬s1∨…∨¬sn) is true, then:

■ One of both p, ¬p has to be wrong.

■ Therefore: One of the other Literals must be true, i.e.

p1∨…∨pk∨¬q1∨…∨¬ql∨r1∨…∨rm∨¬s1∨…∨¬sn

must be true.

■ Therefore: If p1∨…∨pk∨¬q1∨…∨¬ql∨r1∨…∨rm∨¬s1∨…∨¬sn is a

contradiction, then(p1∨…∨pk∨p∨¬q1∨…∨¬ql)∧(r1∨…∨rm∨¬p∨¬s1∨…∨¬sn)is also a contradiction.

Page 8: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

830 (p1∨…∨pk∨p∨¬q1∨…∨¬ql) (r1∨…∨rm∨¬p∨¬s1∨…∨¬sn)

p1∨…∨pk∨¬q1∨…∨¬ql∨r1∨…∨rm∨¬s1∨…∨¬sn

■ two clauses K1 and K2 are transformed into a new one K3

■ End of the resolution procedure:

■ If clauses are resolved that consist only of an atom and the negated atom, then a new „empty clause“ ⊥ can be resolved.

K2

K3

{K1,K 2} ⊨ K3Resolution step

K1

Resolution (Propositional Logic)

Page 9: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

930 • How to deduce a contradiction from a set M of clauses:

1.Select two clauses from M and create a new clause K via a

resolution step.

2. If K =⊥ , then a contradiction has been found.

3. If K ≠⊥ , K is added to the set M, continue with step 1.

Resolution (Propositional Logic)

• The Resolution Calculus (for propositional logic)is correct and complete

Page 10: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1030 • How to proof that a formula ψ is a logical consequence of a Knowledge Base (Theory) Φ of clauses, i.e. Φ ⊨ ψ ?

1.Compute the negation of Φ → ψ, which is a contradiction:¬(Φ → ψ) ≣ Φ ∧ ¬ ψ

2.Determine the clausal form of Φ ∧ ¬ ψ

3.Select two clauses from Φ ∧ ¬ ψ and create a new clause K via a resolution step.

4. If K =⊥ , then a contradiction has been found.It holds that Φ ⊨ ψ. q.e.d.

5. If K ≠⊥ , K is added to the set Φ ∧¬ ψ, continue with step 3.

Resolution (Propositional Logic)

Page 11: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1130 • If it rains, Jane brings her umbrella r ! u

• If Jane has an umbrella, she doesn't get wet u ! ¬w

• If it doesn't rain, Jane doesn't get wet ¬r ! ¬w

• Now, prove that Jane doesn't get wet ¬w

Example

Φ

knowledgebase

formula

ψ

Page 12: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1230 • r ! u = ¬r ∨ u = {¬r,u}• u ! ¬w = ¬u ∨ ¬w = {¬u,¬w}• ¬r ! ¬w = r ∨ ¬w = {r,¬w}

Example

Φ

knowledgebase

formula

ψ

1. Transform knowledge base into clausal form

2. Add negated formula to knowledge base

• ¬¬w = w

1.{¬r,u}

2.{¬u,¬w}

3.{r,¬w}

4. {w}Φ∧¬ψ

new knowledge

base

Page 13: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1330

Example3. Start Resolution

1.{¬r,u}

2.{¬u,¬w}

3.{r,¬w}

4.{w}

(3,4) {r,¬w}

{w}

5. {r}

Φ∧¬ψ

new knowledge

base

Page 14: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1430

Example3. Continue Resolution

1.{¬r,u}

2.{¬u,¬w}

3.{r,¬w}

4.{w}

5.{r}

(2,4) {¬u,¬w}

{w}

6. {¬u}

Φ∧¬ψ

new knowledge

base

Page 15: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1530

Example

1.{¬r,u}

2.{¬u,¬w}

3.{r,¬w}

4.{w}

5.{r}

6.{¬u}

(1,5) {¬r,u}

{r}

7. {u}

Φ∧¬ψ

new knowledge

base

3. Continue Resolution

Page 16: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

1630

Example

1.{¬r,u}

2.{¬u,¬w}

3.{r,¬w}

4.{w}

5.{r}

6.{¬u}

7.{u}

(6,7) {¬u}

{u}

{⊥}

Φ∧¬ψ

new knowledge

base

4. We have found a contradiction in Φ∧¬ψ, therefore it holds that Φ ⊨ ψ , q.e.d.

3. Continue Resolution

Page 17: OpenHPI 4.7 - Resolution

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

17

08 Resolution (FOL)Open HPI - Course: Semantic Web Technologies - Lecture 4: Knowledge Representations I