NLP: Knowledge Representation, Conceptualization, Syntax & Semantics of First-Order Predicate Calculus, Interpretation, Variable Assignment, Satisfaction

497 views
413 views

Published on

Knowledge Representation, Conceptualization, Syntax & Semantics of First-Order Predicate Calculus, Interpretation, Variable Assignment, Satisfaction

Published in: Science, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
497
On SlideShare
0
From Embeds
0
Number of Embeds
128
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

NLP: Knowledge Representation, Conceptualization, Syntax & Semantics of First-Order Predicate Calculus, Interpretation, Variable Assignment, Satisfaction

  1. 1. Natural Language Processing www.vkedco.blogspot.com Knowledge Representation Conceptualization, Syntax & Semantics of First-Order Predicate Calculus, Interpretation, Variable Assignment, Satisfaction Vladimir Kulyukin
  2. 2. Outline ● Conceptualization ● First-Order Predicate Calculus – Syntax – Semantics: Interpretation, Variable Assignment, Satisfaction ● Natural Language Examples
  3. 3. Introduction ● Intelligent behavior depends on an agent’s knowledge about its world ● This knowledge is, to a great extent, descriptive (declarative) ● If this knowledge is to be used by a computer, this descriptive knowledge must be formalized ● Knowledge representation is an area of AI the studies methods to formalize the existing bodies of knowledge
  4. 4. What Does this Agent Need to Act in the World? World Agent
  5. 5. Agent Needs Conceptualization. What Else? Conceptualization World Some ideas about how the world works Agent
  6. 6. The Agent Needs Some Place to Store Knowledge Conceptualization World Knowledge Repository Some accessible place to store knowledge Agent Some ideas about how the world works
  7. 7. The Agent Needs a Way to Write Knowledge Down Conceptualization World Knowledge Repository Some accessible place to store knowledge Agent Some ideas about how the world works
  8. 8. Agents Need Formalisms to Encode & Manipulate Knowledge about the World Fundamental Tenet of Symbolic AI
  9. 9. Conceptualization
  10. 10. Objects & Relations ● Knowledge formalization begins with a conceptualization of the world ● Conceptualization, generally speaking, analyzes the world in terms of objects and relations ● Functions are also relations ● Objects can be concrete (book, pen, block) or abstract (number 2, honesty, love) ● Objects can be primitive (number 2) or abstract (algebraic expression)
  11. 11. Universe of Discourse ● It is impossible for any conceptualization to include all objects in the world ● Conceptualizations reside inside observers (human or mechanical) and include only those objects that present some interest to the observers ● Beekeepers conceptualize the world in terms bees, swarms, beehives, honey extractors, bee disease treatments, etc ● Number theorists conceptualize the world in terms of numbers, sets, properties of numbers, etc. ● The set of objects covered by a conceptualization is called the universe of discourse
  12. 12. Functions & Relations ● Once a conceptualization has objects, the observer must establish relations among those objects ● There are two types of relations most conceptualizations contain: functions and relations ● A set of functions in the conceptualization is called functional basis ● A set of relations in the conceptualization is called relational basis
  13. 13. Blocks World A A A A A A c b a d e Which objects do you conceptualize in this world?
  14. 14. Blocks World: Objects A A A A A A c b a d e Many human observers conceptualize five blocks {a, b, c, d, e} }and the table t
  15. 15. Blocks World: Objects A A A A A A c b a d e One can conceptualize five blocks {a, b, c, d, e} and the table t
  16. 16. Blocks World: Functions & Relations A A A A A A c b a d e What functions & relations do you see in this world?
  17. 17. Blocks World: Functions & Relations A A A A A A c b a d e We can define the partial function hat that maps a block into the block on top of it. Formally, hat consists of the following tuples: hat: {<b, a>, <c, b>, <e, d>}
  18. 18. Blocks World: Functions & Relations A A A A A A c b a d e We can define the relations on or above with the obvious interpretations. Formally, these relations consist of the following tuples: on: {<a, b>, <b, c>, <d, e>} above: {<a, b>, <b, c>, <a, c>, <d, e>}
  19. 19. Blocks World: Functions & Relations A A A A A A c b a d e We can define the relation clear or above that holds for a block if and only if there is no block on top of it: clear: {a, d}
  20. 20. Blocks World: A Conceptualization A A A A A A c b a d e    .,,,,,,,, clearaboveonhatedcba
  21. 21. Upper Bound on Number of N-ary Relations   subsets.possible2areTheretuples.-theseofsubseta isrelationary-Everytuples.-distinctareThere objects.containsDiscourseofUniversetheSuppose n O n n nnO O
  22. 22. Notes on Conceptualizations ● Conceptualizations, although they are written down, consists of the objects and relations the observer actually sees in the world ● The same world may have multiple conceptualizations (e.g., blocks world can be conceptualized in terms of line segments, curves, and their relations) ● Different conceptualizations allow/inhibit certain kinds of knowledge (light as a wave vs. light as a particle; geocentric vs. heliocentric universe)
  23. 23. Realism vs. Nominalism ● Realism takes a stand that objects & relations in one’s conceptualization really exist in the world ● Nominalism takes a stand that objects & relations in one’s conceptualization do not necessarily exist in the world ● AI takes a standpoint that conceptualizations are justified by their utility to the system (this is, strictly speaking, neither realism nor nominalism)
  24. 24. First-Order Predicate Calculus
  25. 25. FOPC Syntax
  26. 26. Alphabets & Symbols ● Since FOPC is a formal language, it must start with an alphabet ● Chapter 2 in Logical Foundations of AI contains one such alphabet (typically it consists of the standard ASCII augmented with specific mathematical symbols) ● FOPC has two types of symbols: variables and constants ● Constants consists of object constants, function constants, and relation constants
  27. 27. Variables & Constants ● A variable is a sequence of lowercase alphanumeric characters and numeric characters such that the first character is lowercase alphabetic ● An object constant names a specific element in the universe of discourse and is a sequence of alphabetic characters or digits such that the first character is either uppercase alphabetic or digit ● A function constant names a function on the members of the universe of discourse and is a mathematical operator or a sequence of alphabetic characters or digits in which the first character is uppercase alphabetic ● A relation constant names a relation on the members of the universe of discourse and is a mathematical operator or a sequence of alphabetic characters or digits in which the first character is uppercase alphabetic
  28. 28. Variables & Constants: Examples ● Variables: x, y, z, x10, y15, z500 ● Object constants: Logan, Aristotle, Hallway100 ● Function constants: Age, Cosine, Tangent, +, -, * ● Relation constants: Above, Clear, Below
  29. 29. Terms ● A term is an object’s name ● A term can be a variable, an object constant, or a functional expression ● A functional expression is an expression of the form f(t1, t2, …, tn) , where f is an n-ary function constant and are t1, t2, …, tn terms (this is a recursive definition)
  30. 30. Terms: Examples ● A, B, C, D, E are object constants and, therefore, terms ● Hat is a function constant ● Hat(C) is a term (functional expression) ● Hat(Hat(C)) is a term (functional expression) ● Hat(x) is a term (functional expression) ● Hat(Hat(x)) is a term (functional expression)
  31. 31. Well-Formed Formulas (WFFs) ● In FOPC, facts are stated in sentences (aka well-formed formulas or wffs) ● Three types of sentences: atomic sentences (aka atoms), logical , and quantified
  32. 32. Atoms   at(C))Above(A, H Hat(C))On(Hat(B), On(A, B) tttt nn :Examples termsare,...,andconstantrelationaiswhere,,..., 11 
  33. 33. Atoms 21 21 21 :Examplesatoms.aresexpression subsetes,inequaliti,equalitiesalmathematicAll tt tt tt   
  34. 34. Logical Sentences       atomsorsentenceslogicalare,where,:eequivalenc6. atomsorsentenceslogicalare,where,:nimplicatioreverse5. atomsorsentenceslogicalare,where,:nimplicatio4. atomorsentencelogicalais,...:ndisjunctio3. atomorsentencelogicalais,...:nconjunctio2. sentencelogicalaiswhere:negation1. sentences.logicalotheror atomstooperatorslogicalapplyingbyformedaresentencesLogical 11 11               nin nin
  35. 35. Logical Sentences: Examples                                     AEOnADOnACOnABOnAClear yxOnyxAbove yxAboveyxOn xxHatAbovexxHatAbove EDAboveBAOn BAOn ,,,,6. ,,5. ,,4. ,,3. ,,2. ,1. sentences.logicalotheroratomsto operatorslogicalapplyingbyformedaresentencesLogical      
  36. 36. Quantified Sentences                            vTablevBlockv vBlockvBluev vBlockvBluev xBlockxBluex vv vv       :Examples sentenceaisand variableaiswhere:tionquantificalexistentia2. sentenceaisand variableaiswhere:tionquantificauniversal1. s.quantifierlexistentiaoruniversalthe withsentencesotherprefixingbyformedaresentencesQuantified    
  37. 37. More Examples of Quantified Sentences                     yxyx yxyx yxyx yxLovesyx yxLovesyx yxLovesyx       , , ,
  38. 38. FOPC Semantics
  39. 39. How Does the Agent Know What is True? Conceptualization World Knowledge Repository Agent
  40. 40. Worlds, Conceptualizations, Knowledge Repositories, & Agents ● Sentences are written in a knowledge repository (book, smartphone, database, etc.) ● Conceptualizations of the world exist in the agent’s head (some true, some false, some partially true) ● Truth of each sentence is evaluated with respect to a specific conceptualization ● As the agent acts in the world, the agent may modify or abandon conceptualizations or adopt new ones
  41. 41. Interpretation as a Function ● Interpretation is a mapping b/w the elements of a formal language (FOPC in our case) and the elements of a conceptualization ● Formally, an interpretation is the function I(σ) where σ is an element of the language ● The value of I(σ) is an element of a given conceptualization ● The universe of discourse is denoted |I|
  42. 42. Formal Properties of Interpretation       constantrelationaisif, constantfunctionaisif,: constantobjectanisif    n n II III II   
  43. 43. Blocks World Interpretation I                          daClearI edcacbbaAboveI edcbbaOnI debcabHatI eEIdDIcCIbBIaAI , ,,,,,,, ,,,,, ,,,,, ;;;;;     
  44. 44. Blocks World Interpretation J                          daClearI deacbcabAboveI debcabOnJ debcabHatJ eEJdDJcCJbBJaAJ Above OnClear HatIJ , ,,,,,,, ,,,,, ,,,,, ;;;;; :below''as andunder''asinterpretsbut,relationunary and,functionconstants,objectonwithagrees     
  45. 45. Variable Assignment       CzUByUAxU U  ;;:Example constants.object tovariablesmappingfunctionaisassignmentVariable symbols.otherfromseparatelydinterpreteareVariables
  46. 46. Term Interpretation                  nIUii n IU IU IU xxftTxtI fIttt tUtTt tItTt T UI ,...,then, ,and,...,formtheoftermaisIf.3 thenvariable,aisIf.2 thenconstant,objectanisIf.1 :followsasdefined objectstotermsmappingassignmenttermaisthe ,assignmentvariableaisandtion,interpretaanisIf 1 1     
  47. 47. Term Interpretation: Example             then,let and,previouslydefinedtioninterpretatheisIf bCHatwUHatIwHatT CwU I IU  
  48. 48. Satisfaction
  49. 49. General Notation      U IU U IU I I assignmentvariablea andtioninterpretaanundersatisfiednotisSentence:| assignmentvariablea andtioninterpretaanundersatisfiedisSentence:|    
  50. 50. Case 1       2121 iff| tTtTUtt IUIUI 
  51. 51. Case 2                            edcacbbaAboveIcaCTAT UCAAbove edcacbbaAboveI cCIaAI ItTtTUtt IUIU I nIUnIUI ,,,,,,,,, becausesatisfiedis,| ,,,,,,, ;; :Example ,...,iff,...,| 21      
  52. 52. Case 3         UttUtt II 2121 ,...,|iff,...,|  
  53. 53. Case 4      niUU iInI ,...,1,|iff...| 1  
  54. 54. Case 5      niUU iInI ,...,1somefor,|iff...| 1  
  55. 55. Case 6         UUU III 2121 ||iff|  
  56. 56. Case 7           UUU III 122121 ||iff|  
  57. 57. Case 8     .|,inwith replacedisafter|,|allforiff| Ud vIdUv I I    
  58. 58. Case 9     Udv IdUv I I     |,inwithreplacedisafter |,|someforiff|
  59. 59. Examples            xPoisonousxMushroomxPurplex xPoisonousxMushroomxPurplex   poisonous.aremushroomspurpleAll
  60. 60. Examples      xPurplexPoisonousxMushroomx  purple.isitifonlypoisonousismushroomA
  61. 61. Examples              xPoisonousxMushroomxPurplex xPoisonousxMushroomxPurplex   poisonous.ismushroompurpleNo
  62. 62. References ● Ch 02, M. Genesereth & N. Nilsson. Logical Foundations of AI, Morgan Kaufmann

×