OpenHPI 4.8 - Resolution (FOL)

21
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 08: Resolution (FOL)

description

 

Transcript of OpenHPI 4.8 - Resolution (FOL)

Page 1: OpenHPI 4.8 - Resolution (FOL)

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 I08: Resolution (FOL)

Page 2: OpenHPI 4.8 - Resolution (FOL)

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.8 - Resolution (FOL)

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

3

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

Page 4: OpenHPI 4.8 - Resolution (FOL)

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

430 ■ For resolution in First Order Logic additional variable bindings have to be considered with the help of Substitutions

■ e.g. (p(X,f(Y)) ∨ q( f(X),Y)) (¬p(a,Z) ∨ r(Z) )

Resolution (First Order Logic)

Page 5: OpenHPI 4.8 - Resolution (FOL)

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

430 ■ For resolution in First Order Logic additional variable bindings have to be considered with the help of Substitutions

■ e.g. (p(X,f(Y)) ∨ q( f(X),Y)) (¬p(a,Z) ∨ r(Z) )

Resolution (First Order Logic)

Resolution with [X/a, Z/f(Y)] results in

(q( f(a),Y) ∨ r(f(Y))).

Page 6: OpenHPI 4.8 - Resolution (FOL)

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

430 ■ For resolution in First Order Logic additional variable bindings have to be considered with the help of Substitutions

■ e.g. (p(X,f(Y)) ∨ q( f(X),Y)) (¬p(a,Z) ∨ r(Z) )

Resolution (First Order Logic)

Substitutions

Resolution with [X/a, Z/f(Y)] results in

(q( f(a),Y) ∨ r(f(Y))).

Page 7: OpenHPI 4.8 - Resolution (FOL)

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

530 ■ Unification of Terms

■ Given: Literals L1, L2

■ Wanted: Variable substitution σ applied on L1 and L2 results in: L1σ = L2σ

■ If there is such a variable substiution σ, then σ is called Unifier of L1 und L2.

Resolution (First Order Logic)

Page 8: OpenHPI 4.8 - Resolution (FOL)

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

630 Unification Algorithm■ Given: Literals L1, L2

■ Wanted: Unifier σ of L1 and L2.

1. L1 and L2 are Constants: only unifiable, if L1 = L2 .

2. L1 is Variable and L2 arbitrary Term: unifiable, if for Variable L1 the Term L2 can be substituted and Variable L1 does not occur in L2.

3. L1 and L2 are Predicates or Functions PL1(s1,...,sm) and PL2(t1,...,tn):unifiable, if

1. PL1 = PL2 or

2. n=m and all terms si are unifiable with a term ti

Resolution (First Order Logic)

Page 9: OpenHPI 4.8 - Resolution (FOL)

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

730 Examples for Unification

L1 L2 σp(X,X) p(a,a) [X/a]p(X,X) p(a,b) n.a.p(X,Y) p(a,b) [X/a, Y/b]p(X,Y) p(a,a) [X/a, Y/a]

p(f(X),b) p(f(c),Z) [X/c, Z/b]p(X,f(X)) p(Y,Z) [X/Y, Z/f(Y)]p(X,f(X)) p(Y,Y) n.a.

Resolution (First Order Logic)

Page 10: OpenHPI 4.8 - Resolution (FOL)

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

830

Resolution (First Order Logic)

■ For resolution in First Order Logic additional variable bindings have to be considered with the help of Substitutions

■ e.g. (p(X,f(Y)) ∨ q( f(X),Y)) (¬p(a,Z) ∨ r(Z) )

(q( f(a),Y) ∨ r(f(Y))).

Resolution with [X/a, Z/f(Y)] results in

Page 11: OpenHPI 4.8 - Resolution (FOL)

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

930Example for FOL Resolution:

■ Terminological Knowledge (TBox):

(∀X) ( human(X) → (∃Y) parent_of(Y,X) )

(∀X) ( orphan(X) ↔

(human(X) ∧ ¬(∃Y) (parent_of(Y,X) ∧ alive(Y)))

■ Assertional Knowledge (ABox):

orphan(harrypotter)

parent_of(jamespotter,harrypotter)

■ Can we deduce: ¬alive(jamespotter)?

Resolution (First Order Logic)

Page 12: OpenHPI 4.8 - Resolution (FOL)

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

1030Example for FOL Resolution:

We have to proof that:

((∀X) ( human(X) → (∃Y) parent_of(Y,X) )

∧ (∀X) (orphan(X) ↔

(human(X) ∧ ¬(∃Y) (parent_of(Y,X) ∧ alive(Y)))

∧ orphan(harrypotter)

∧ parent_of(jamespotter,harrypotter))

→ ¬alive(jamespotter))

is a tautology.

Resolution (First Order Logic)

Page 13: OpenHPI 4.8 - Resolution (FOL)

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

1130 Example for FOL Resolution:We have to proof that:

¬((∀X) ( human(X) → (∃Y) parent_of(Y,X) )

∧ (∀X) (orphan(X) ↔

(human(X) ∧ ¬(∃Y) (parent_of(Y,X) ∧ alive(Y)))

∧ orphan(harrypotter)

∧ parent_of(jamespotter,harrypotter))

→ ¬alive(jamespotter))

ist a contradiction.

Resolution (First Order Logic)

Page 14: OpenHPI 4.8 - Resolution (FOL)

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

1230 Example for FOL Resolution:

■ Prenex Normal Form:

(∀X)(∃Y)(∀X1)(∀Y1)(∀X2)(∃Y2)

(( ¬human(X) ∨ parent_of(Y,X) )

∧ (¬orphan(X1)∨ (human(X1) ∧ (¬parent_of(Y1,X1) ∨ ¬alive(Y1)))

∧ (orphan(X2) ∨ (¬human(X2) ∨ (parent_of(Y2,X2) ∧ alive(Y2)))

∧ orphan(harrypotter)

∧ parent_of(jamespotter,harrypotter))

∧ alive(jamespotter))

Resolution (First Order Logic)

Page 15: OpenHPI 4.8 - Resolution (FOL)

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

1330

( ¬human(X) ∨ parent_of(f(X),X) )

∧ (¬orphan(X1) ∨ human(X1))

∧ (¬orphan(X1) ∨ ¬parent_of(Y1,X1) ∨ ¬alive(Y1))

∧ (orphan(X2) ∨ ¬human(X2) ∨ parent_of(g(X,X1,Y1,X2),X2))

∧ (orphan(X2) ∨ ¬human(X2) ∨ alive(g(X,X1,Y1,X2)))

∧ orphan(harrypotter)

∧ parent_of(jamespotter,harrypotter))

∧ alive(jamespotter)

Example for FOL Resolution:

■ Clausal Form (CNF):

Resolution (First Order Logic)

Page 16: OpenHPI 4.8 - Resolution (FOL)

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

1430

{ {¬human(X), parent_of(f(X),X)},

{¬orphan(X1), human(X1)},

{¬orphan(X1),¬parent_of(Y1,X1),¬alive(Y1)},

{orphan(X2),¬human(X2),parent_of(g(X,X1,Y1,X2),X2)},

{orphan(X2) ,¬human(X2),alive(g(X,X1,Y1,X2))},

{orphan(harrypotter)},

{parent_of(jamespotter,harrypotter)},

{alive(jamespotter)} }

Resolution (First Order Logic)

Example for FOL Resolution:

■ Clausal Form (CNF):

Page 17: OpenHPI 4.8 - Resolution (FOL)

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

1530

1. {¬human(X), parent_of(f(X),X)}2. {(¬orphan(X1), human(X1)}3. {¬orphan(X1), ¬parent_of(Y1,X1),¬alive(Y1))}4. {(orphan(X2), ¬human(X2), parent_of(g(X,X1,Y1,X2),X2)}5. {orphan(X2), ¬human(X2), alive(g(X,X1,Y1,X2))}6. {orphan(harrypotter)}7. {parent_of(jamespotter,harrypotter)}8. {alive(jamespotter)}

9. {¬orphan(harrypotter), ¬alive(jamespotter)} (3,7) [X1/harrypotter, Y1/jamespotter]

Knowledge Base:

Entailed Clauses:

Resolution (First Order Logic)

Example for FOL Resolution:

Page 18: OpenHPI 4.8 - Resolution (FOL)

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

1630

Knowledge Base:

Entailed Clauses:

1. {¬human(X), parent_of(f(X),X)}2. {(¬orphan(X1), human(X1)}3. {¬orphan(X1), ¬parent_of(Y1,X1),¬alive(Y1))}4. {(orphan(X2), ¬human(X2), parent_of(g(X,X1,Y1,X2),X2)}5. {orphan(X2), ¬human(X2), alive(g(X,X1,Y1,X2))}6. {orphan(harrypotter)}7. {parent_of(jamespotter,harrypotter)}8. {alive(jamespotter)}

9. {¬orphan(harrypotter), ¬alive(jamespotter)} (3,7)10. {¬orphan(harrypotter)} (8,9)

Resolution (First Order Logic)

Example for FOL Resolution:

Page 19: OpenHPI 4.8 - Resolution (FOL)

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

1730

Knowledge Base:

Entailed Clauses:

1. {¬human(X), parent_of(f(X),X)}2. {(¬orphan(X1), human(X1)}3. {¬orphan(X1), ¬parent_of(Y1,X1),¬alive(Y1))}4. {(orphan(X2), ¬human(X2), parent_of(g(X,X1,Y1,X2),X2)}5. {orphan(X2), ¬human(X2), alive(g(X,X1,Y1,X2))}6. {orphan(harrypotter)}7. {parent_of(jamespotter,harrypotter)}8. {alive(jamespotter)}

9. {¬orphan(harrypotter), ¬alive(jamespotter)} (3,7)10. {¬orphan(harrypotter)} (8,9)11. ⊥ (6,10)

Resolution (First Order Logic)

Example for FOL Resolution:

Page 20: OpenHPI 4.8 - Resolution (FOL)

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

1830 Properties of FOL Resolution■ Completeness of Refutation

□ If resolution is applied to a contradictory set of clauses, then there exists a finite number of resolution steps to detect the contradiction.

□ The number n of necessary steps can be very large (not efficient)

□ Resolution in FOL is undecidable

□ If the set of clauses is not contradictory, then the termination of the resolution is not guaranteed.

Resolution (First Order Logic)

Page 21: OpenHPI 4.8 - Resolution (FOL)

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

19

09 Tableaux AlgorithmOpen HPI - Course: Semantic Web Technologies - Lecture 4: Knowledge Representations I