Transcript
Page 1: OpenHPI 4.6 - Canonical Form

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 I06: Canonical Form

Page 2: OpenHPI 4.6 - Canonical Form

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.6 - Canonical Form

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

3

06 Canonical FormOpen HPI - Course: Semantic Web Technologies - Lecture 4: Knowledge Representations I

Page 4: OpenHPI 4.6 - Canonical Form

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

430

■ For every formula there exist infinitely many logically equivalent formulas.

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ FF ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

Logical Equivalences

Page 5: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Logical Equivalences

Page 6: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Logical Equivalences

Page 7: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Logical Equivalences

Page 8: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 9: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 10: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 11: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 12: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 13: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 14: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 15: OpenHPI 4.6 - Canonical Form

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

530

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ F

F → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)

¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G

¬¬F ≡ F

F ∧ t ≡ F F ∧ f ≡ f F ∨ t ≡ t F ∨ f ≡ F

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

F ∧ ¬F = f F ∨ ¬F = t

Augustus De Morgan(1806-1871)

Logical Equivalences

Page 16: OpenHPI 4.6 - Canonical Form

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

630

Commutativity and Quantifiers

(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F

■Quantifiers (of the same sort) are commutative

■But

■Example:

■ (∃x)(∀y): loves(x,y)„There exists somebody, who loves everybody.“

■ (∀y)(∃x): loves(x,y)„Everybody is loved by somebody.“

(∃X)(∀Y) F ≢ (∀Y)(∃X) F

Page 17: OpenHPI 4.6 - Canonical Form

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

730

■ For all of these Equivalence Classes one designates a most simple and unique representative.

■ These representatives are called Canonical Forms or Normal Forms.

■Simple example:

□we write ¬F instead of ¬¬¬¬¬F

F ∧ G ≡ G ∧ FF ∨ G ≡ G ∨ FF → G ≡ ¬F ∨ GF ↔ G ≡ (F → G) ∧ (G → F)¬(F ∧ G) ≡ ¬F ∨ ¬G¬(F ∨ G) ≡ ¬F ∧ ¬G¬¬F ≡ FF ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

¬(∀X) F ≡ (∃X) ¬F¬(∃X) F ≡ (∀X) ¬F(∀X)(∀Y) F ≡ (∀Y)(∀X) F(∃X)(∃Y) F ≡ (∃Y)(∃X) F(∀X) (F ∧ G) ≡ (∀X) F ∧ (∀X) G(∃X) (F ∨ G) ≡ (∃X) F ∨ (∃X) G

Canonical Form (Normal Form)

Page 18: OpenHPI 4.6 - Canonical Form

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

830■ Goal: Transformation of formulas into Clausal Form.

■ (a∧(b∨¬c)∧(a∨d)) {a,{b,¬c},{a,d}}

■ A Clause is a finite disjunction of literals

■ b1∨b2∨...∨bn

■ a simple clause can also written as {b1,b2,...,bn}

■ A Conjunctive Normal Form (CNF) is a conjunction of clauses

■ A Clausal Normal Form corresponds to a Conjunctive Normal Form

■ {{b1,b2,...,bn},...,{c1,c2,...,cm}}

(Conjunctive Normal Form) (Clausal Form)

Canonical Form (Normal Forms)

Page 19: OpenHPI 4.6 - Canonical Form

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

930■ Goal: Transformation of formulas into Clausal Form.

■ (a∧(b∨¬c)∧(a∨d)) {a,{b,¬c},{a,d}}

■ Required Steps:

1.Negation Normal Form□ move all negations inwards

2.Prenex Normal Form□ move all quantifiers in front

3.Skolem Normal Form□ remove existential quantifiers

4.Conjunctive Normal Form (CNF) = Clausal Form□ Representation as Conjunction of Disjunctions

(Conjunctive Normal Form) (Clausal Form)

Canonical Form (Normal Forms)

Page 20: OpenHPI 4.6 - Canonical Form

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

10

1. Negation Normal Form

30 ■ All negations are moved inwards via the following logical equivalences:

F ↔ G ≡ (F → G)∧(G → F) ¬(F ∧ G) ≡ ¬F ∨ ¬G

F → G ≡ ¬F ∨ G ¬(F ∨ G) ≡ ¬F ∧ ¬G

¬(∀X) F ≡ (∃X) ¬F ¬¬F ≡ F¬(∃X) F ≡ (∀X) ¬F

■ Result:

□ implications and equivalences are removed

□ multiple negations are removed

□ all negations are placed directly in front of atoms

Page 21: OpenHPI 4.6 - Canonical Form

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

1130 ■ Example

( (∀X)( penguin(X) → blackandwhite(X) )

∧ (∃X)( oldTVshow(X) ∧ blackandwhite(X) )

) → (∃X)( penguin(X) ∧ oldTVshow(X) )

is transformed into

1. Negation Normal Form

Page 22: OpenHPI 4.6 - Canonical Form

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

1130 ■ Example

( (∀X)( penguin(X) → blackandwhite(X) )

∧ (∃X)( oldTVshow(X) ∧ blackandwhite(X) )

) → (∃X)( penguin(X) ∧ oldTVshow(X) )

is transformed into

¬( (∀X)( ¬penguin(X) ∨ blackandwhite(X) )

∧ (∃X)( oldTVshow(X) ∧ blackandwhite(X) )

) ∨ (∃X)( penguin(X) ∧ oldTVshow(X) )

1. Negation Normal Form

Page 23: OpenHPI 4.6 - Canonical Form

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

1130 ■ Example

( (∀X)( penguin(X) → blackandwhite(X) )

∧ (∃X)( oldTVshow(X) ∧ blackandwhite(X) )

) → (∃X)( penguin(X) ∧ oldTVshow(X) )

is transformed into

¬( (∀X)( ¬penguin(X) ∨ blackandwhite(X) )

∧ (∃X)( oldTVshow(X) ∧ blackandwhite(X) )

) ∨ (∃X)( penguin(X) ∧ oldTVshow(X) )

is transformed into

( (∃X)( penguin(X) ∧ ¬blackandwhite(X) )

∨ (∀X)(¬oldTVshow(X) ∨ ¬blackandwhite(X) )

) ∨ (∃X)( penguin(X) ∧ oldTVshow(X) )

1. Negation Normal Form

Page 24: OpenHPI 4.6 - Canonical Form

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

1230 ■ Clean up formulas (Quantifiers are bound to different variables).

( (∃X)( penguin(X) ∧ ¬blackandwhite(X) )

∨ (∀X)( ¬oldTVshow(X) ∨ ¬blackandwhite(X) )

) ∨ (∃X)( penguin(X) ∧ oldTVshow(X) )

is transformed into

( (∃X)( penguin(X) ∧ ¬blackandwhite(X) )

∨ (∀Y)( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) )

) ∨ (∃Z)( penguin(Z) ∧ oldTVshow(Z) )

2. Prenex Normal Form

Page 25: OpenHPI 4.6 - Canonical Form

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

1330 ■ Then put all Quantifiers from Negation Normal Form in front

( (∃X)( penguin(X) ∧ ¬blackandwhite(X) )

∨ (∀Y)( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) )

) ∨ (∃Z)( penguin(Z) ∧ oldTVshow(Z) )

is transformed into

(∃X)(∀Y)(∃Z)( ( penguin(X) ∧ ¬blackandwhite(X) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin(Z) ∧ oldTVshow(Z) )

2. Prenex Normal Form

Page 26: OpenHPI 4.6 - Canonical Form

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

1430

■ remove existential quantifiers

(∃X) (∀Y) (∃Z) ( ( penguin(X) ∧ ¬blackandwhite(X) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin(Z) ∧ oldTVshow(Z) )

3. Skolem Normal Form

Page 27: OpenHPI 4.6 - Canonical Form

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

1430

■ remove existential quantifiers

(∃X) (∀Y) (∃Z) ( ( penguin(X) ∧ ¬blackandwhite(X) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin(Z) ∧ oldTVshow(Z) )

is transformed into

(∀Y)( ( penguin(a) ∧ ¬blackandwhite(a) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin( f(Y) ) ∧ oldTVshow( f(Y) ) )

■ where a and f are new symbols (so called Skolem Constant or Skolem Function).

3. Skolem Normal Form

Page 28: OpenHPI 4.6 - Canonical Form

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

1530

■ How To:

1.Remove Existential Quantifiers from left to right.

2. If there is no Universal Quantifier left of the existential quantifier to be removed, then the according variable is substituted by a new Constant Symbol.

3. If there are n Universal Quantifiers left of the existential quantifier to be removed, then the according variable is substituted with a new Function Symbol with arity n, whose arguments are exactely the Variables of the n Universal Quantifiers.

3. Skolem Normal Form

Page 29: OpenHPI 4.6 - Canonical Form

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

1630■ remove existential quantifiers

(∃X) (∀Y) (∃Z) ( ( penguin(X) ∧ ¬blackandwhite(X) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin(Z) ∧ oldTVshow(Z) )

is transformed into

(∀Y)( ( penguin(a) ∧ ¬blackandwhite(a) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin( f(Y) ) ∧ oldTVshow( f(Y) ) )

■ where a and f are new symbols (so called Skolem Constant or Skolem Function).

3. Skolem Normal Form

Page 30: OpenHPI 4.6 - Canonical Form

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

1730

4. Conjunctive Normal Form (Clausal Form)

■ There are only Universal Quantifiers, therefore we can remove them:

( penguin(a) ∧ ¬blackandwhite(a) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) ) )

∨ ( penguin(f(Y)) ∧ oldTVshow(f(Y))

■ With the help of logical equivalences the formula is now transfomed into a Conjunction of Disjunctions.

F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H)F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H)

Page 31: OpenHPI 4.6 - Canonical Form

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

1830

( (penguin(a) ∧ ¬blackandwhite(a) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) )

∨ ( penguin(f(Y)) ∧ oldTVshow(f(Y))

is transformed into

( penguin(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨penguin(f(Y)) )

∧ ( penguin(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨oldTVshow(f(Y)) )

∧ ( ¬blackandwhite(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨penguin(f(Y)) )

∧ ( ¬blackandwhite(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨oldTVshow(f(Y)) )

4. Conjunctive Normal Form (Clausal Form)

Page 32: OpenHPI 4.6 - Canonical Form

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

1830

( (penguin(a) ∧ ¬blackandwhite(a) )

∨ ( ¬oldTVshow(Y) ∨ ¬blackandwhite(Y) )

∨ ( penguin(f(Y)) ∧ oldTVshow(f(Y))

is transformed into

( penguin(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨penguin(f(Y)) )

∧ ( penguin(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨oldTVshow(f(Y)) )

∧ ( ¬blackandwhite(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨penguin(f(Y)) )

∧ ( ¬blackandwhite(a)∨¬oldTVshow(Y)∨¬blackandwhite(Y)∨oldTVshow(f(Y)) )

is transformed into

{ {penguin(a),¬oldTVshow(Y),¬blackandwhite(Y),penguin(f(Y))}, {penguin(a),¬oldTVshow(Y),¬blackandwhite(Y),oldTVshow(f(Y))}, { ¬blackandwhite(a),¬oldTVshow(Y),¬blackandwhite(Y),penguin(f(Y))}, {¬blackandwhite(a),¬oldTVshow(Y),¬blackandwhite(Y),oldTVshow(f(Y))} }

4. Conjunctive Normal Form (Clausal Form)

Page 33: OpenHPI 4.6 - Canonical Form

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

1930

Properties of Canonical Forms

■ Let F be a formula,

■ G is the Prenex Normal Form of F,

■ H is the Skolem Normal Form of G,

■ K is the Clausal Form of H.

■ Then F ≡ G and H ≡ K but usually F ≢ K.

■ Nevertheless it holds, that

□ F is not satisfiable (a contradiction), if K is a contradiction.(Foundation of the Resolution)

Page 34: OpenHPI 4.6 - Canonical Form

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

20

07 ResolutionOpen HPI - Course: Semantic Web Technologies - Lecture 4: Knowledge Representations I


Top Related