OpenHPI 4.6 - Canonical Form

Download OpenHPI 4.6 - Canonical Form

Post on 16-Jan-2015

328 views

Category:

Education

3 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

<ul><li> 1. Semantic WebTechnologiesLecture 4: Knowledge Representations I 06: Canonical FormDr. Harald Sack Hasso Plattner Institute for IT Systems Engineering University of Potsdam Spring 2013 This le is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)</li></ul> <p> 2. 2Lecture 4: Knowledge Representations IOpen HPI - Course: Semantic Web TechnologiesSemantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 3. 3 06 Canonical FormOpen HPI - Course: Semantic Web Technologies - Lecture PotsdamVorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt4: Knowledge Representations I 4. Logical Equivalences For every formula there exist innitely many logically304equivalent formulas. FGGF FGGFF G F GF G (F G) (G F) (F G) F G (F G) F G 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 Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 5. Logical Equivalences305 FGGF (X) F (X) F FGGF (X) F (X) F F G F G(X)(Y) F (Y)(X) F F G (F G) (G F) (X)(Y) F (Y)(X) F (F G) F G(X) (F G) (X) F (X) G (F G) F G(X) (F G) (X) F (X) G F F FtFFffF F = f F F = t FttFfF F (G H) (F G) (F H) F (G H) (F G) (F H) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 6. Logical Equivalences305 FGGF (X) F (X) F FGGF (X) F (X) F F G F G(X)(Y) F (Y)(X) F F G (F G) (G F) (X)(Y) F (Y)(X) F (F G) F G(X) (F G) (X) F (X) G (F G) F G(X) (F G) (X) F (X) G F F FtFFffF F = f F F = t FttFfF F (G H) (F G) (F H) F (G H) (F G) (F H) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 7. Logical Equivalences305 FGGF (X) F (X) F FGGF (X) F (X) F F G F G(X)(Y) F (Y)(X) F F G (F G) (G F) (X)(Y) F (Y)(X) F (F G) F G(X) (F G) (X) F (X) G (F G) F G(X) (F G) (X) F (X) G F F FtFFffF F = f F F = t FttFfF F (G H) (F G) (F H) F (G H) (F G) (F H) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 8. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 9. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 10. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 11. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 12. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 13. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 14. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 15. Logical Equivalences305FGGF (X) F (X) FFGGF (X) F (X) FF G F G(X)(Y) F (Y)(X) F Augustus De Morgan (X)(Y) F (Y)(X) F(1806-1871)F G (F G) (G F)(F G) F G(X) (F G) (X) F (X) G(F G) F G(X) (F G) (X) F (X) GF FFtFFffF F = f F F = tFttFfFF (G H) (F G) (F H)F (G H) (F G) (F H)Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 16. Commutativity and Quantiers306 Quantiers (of the same sort) are commutative (X)(Y) F (Y)(X) F (X)(Y) F (Y)(X) F But (X)(Y) F (Y)(X) F Example: (x)(y): loves(x,y) There exists somebody, who loves everybody. (y)(x): loves(x,y) Everybody is loved by somebody. Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 17. Canonical Form (Normal Form)307FGGF FGGF (X) F (X) F F G F G(X) F (X) F F G (F G) (G F) (X)(Y) F (Y)(X) F (F G) F G(X)(Y) F (Y)(X) F (F G) F G(X) (F G) (X) F (X) G F F (X) (F G) (X) F (X) G F (G H) (F G) (F H) F (G H) (F G) (F H) 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 Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 18. Canonical Form (Normal Forms)30 Goal: Transformation of formulas into Clausal Form.8 (a(bc)(ad)){a,{b,c},{a,d}} (Conjunctive Normal Form) (Clausal Form) A Clause is a nite disjunction of literals b1b2...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}} Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 19. Canonical Form (Normal Forms)30 Goal: Transformation of formulas into Clausal Form.9 (a(bc)(ad)){a,{b,c},{a,d}} (Conjunctive Normal Form) (Clausal Form) Required Steps: 1. Negation Normal Form move all negations inwards 2. Prenex Normal Form move all quantiers in front 3. Skolem Normal Form remove existential quantiers 4. Conjunctive Normal Form (CNF) = Clausal Form Representation as Conjunction of Disjunctions Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 20. 1. Negation Normal Form3010 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 Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 21. 1. Negation Normal Form3011 Example( (X)( penguin(X) blackandwhite(X) ) (X)( oldTVshow(X) blackandwhite(X) )) (X)( penguin(X) oldTVshow(X) )is transformed into Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 22. 1. Negation Normal Form3011 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) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 23. 1. Negation Normal Form3011 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) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 24. 2. Prenex Normal Form3012 Clean up formulas (Quantiers 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) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 25. 2. Prenex Normal Form3013 Then put all Quantiers 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) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 26. 3. Skolem Normal Form3014 remove existential quantiers (X) (Y) (Z) ( ( penguin(X) blackandwhite(X) ) ( oldTVshow(Y) blackandwhite(Y) ) ) ( penguin(Z) oldTVshow(Z) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 27. 3. Skolem Normal Form3014 remove existential quantiers (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). Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 28. 3. Skolem Normal Form3015 How To:1. Remove Existential Quantiers from left to right.2. If there is no Universal Quantier left of the existential quantier to be removed, then the according variable is substituted by a new Constant Symbol.3. If there are n Universal Quantiers left of the existential quantier 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 Quantiers. Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 29. 3. Skolem Normal Form3016 remove existential quantiers (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). Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 30. 4. Conjunctive Normal Form(Clausal Form)3017 There are only Universal Quantiers, therefore we can removethem:( penguin(a) blackandwhite(a) ) ( oldTVshow(Y) blackandwhite(Y) ) ) ( penguin(f(Y)) oldTVshow(f(Y)) With the help of logical equivalences the formula is nowtransfomed into a Conjunction of Disjunctions.F (G H) (F G) (F H)F (G H) (F G) (F H) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 31. 4. Conjunctive Normal Form(Clausal Form)3018 ( (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)) ) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 32. 4. Conjunctive Normal Form(Clausal Form)3018 ( (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))} } Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 33. Properties of Canonical Forms3019 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 satisable (a contradiction),if K is a contradiction.(Foundation of the Resolution) Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt Potsdam 34. 20 07 ResolutionOpen HPI - Course: Semantic Web Technologies - Lecture PotsdamVorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universitt4: Knowledge Representations I </p>