; ======================================================================== ; SNePS representation of: ; ; (1) Anna knows that John bought a dog. ; (2) The dog is a German Shepherd. ; (3) John paid $300 for the dog. ; (4) Anna also knows that Stu sold his dog. ; (5) Anna believes that John bought Stu's dog. ; ; From: Martins, Jo\~{a}o Pav\~{a}o (2002), _Knowledge Representation_ ; ======================================================================== ; First, we define some SNePS relations: (define agent act action object iobject member class lex propername class-mod class-head rel possessor equiv) ; 1. Anna knows that John bought a dog. ; 1a. Something has the proper name "John" (describe (assert object #john propername "John") = someone-is-named-john) ; Show the network: (show *someone-is-named-john) ; unrepresented prior knowledge (UPK): ; "John" is typically the name of a male human. ; Note: I put lexical entries in double-quotes for ; the sake of clarity, but this is not necessary. ; 1b. Something is a dog. (describe (assert member #dog class (build lex "dog") = dog-concept) = something-isa-dog) (show *something-isa-dog) ; UPK: information about dogs. ; 1c. John bought a [i.e., that] dog. (describe (assert agent *john act (build action (build lex "buy") object *dog)) = john-bought-a-dog) (show *john-bought-a-dog) ; UPK: info (a "script") about the act of buying, exchanging money, etc. ; Note: I have ignored the past tense. ; 1d. Something has the proper name "Anna" (describe (assert object #anna propername "Anna") = someone-is-named-anna) (show *someone-is-named-anna) ; UPK: "Anna" is typically the name of a female human. ; 1d. Anna knows that John bought a dog. ; Note: If an agent knows that P, then P is true. ; So, if Cassie believes that someone knows that P, ; then Cassie believes that P. ; Therefore, we *assert* the object of Anna's act of knowing. ; See Rapaport, Shapiro, & Wiebe 1997. (describe (assert agent *anna act (build action (build lex "know") = knows-that object *john-bought-a-dog)) = anna-knows-that-john-bought-a-dog) (show *anna-knows-that-john-bought-a-dog) ; Note: Should we represent that Anna knows that *john is named "John"? ; Etc.? Probably. For discussion of this, see Rapaport et al. 1997. ; UPK: Information about the act of buying. ; 2. The dog is a German Shepherd. (describe (assert member *dog class (build class-mod (build lex "German") class-head (build lex "Shepherd"))) = the-dog-isa-GS) (show *the-dog-isa-GS) ; Possible UPK: Info about German Shepherds. ; For discussion of why this might not be necessary, see ; Johnson-Laird 1987. ; 3. John paid $300 for the dog. (describe (assert agent *john act (build action (build lex "pay") object (build class-mod 300 class-head (build lex "dollars")) iobject *dog)) = john-paid-300) (show *john-paid-300) ; Notes: (a) This is probably better represented as part of a "buying" ; script. ; (b) The semantics for the "iobject" relation needs to be ; given; see end of demo file. ; (c) The notion of "$300" needs to be explicated ; (i.e., an "ontology" for money needs to be developed) ; (d) The representation of numbers needs to be explicated ; (i.e., an "ontology" of numbers is needed) ; 4. Anna also knows that Stu sold his dog. ; ; 4a. Someone is named "Stu". (describe (assert object #stu propername "Stu") = someone-is-named-stu) (show *someone-is-named-stu) ; 4b. Stu possesses a dog. (describe (assert possessor *stu rel *dog-concept object #stus-dog) = stu-owns-a-dog) (show *stu-owns-a-dog) ; UPK: Stu's dog is a dog. ; 4c. Stu sold his dog. (describe (assert agent *stu act (build action (build lex "sell") object *stus-dog)) = stu-sold-his-dog) (show *stu-sold-his-dog) ; UPK: The script for buying and selling, as mentioned above. ; 4d. Anna (also) knows that Stu sold his dog. (describe (assert agent *anna act (build action *knows-that object *stu-sold-his-dog)) = anna-knows-stu-sold-his-dog) (show *anna-knows-stu-sold-his-dog) ; Note: "also" does not need to be represented. ; 5. Anna believes that John bought Stu's dog. ; 5a. John bought Stu's dog. (full-describe (build agent *john act (build action (find lex "buy") object *stus-dog)) = john-bought-stus-dog) (show *john-bought-stus-dog) ; Note: This is "built", not "asserted", since it is merely ; one of Anna's *beliefs*, and it is not made clear ; whether Cassie believes it or not. ; 5b. Anna believes that John bought Stu's dog. (describe (assert agent *anna act (build action (build lex "believe") object *john-bought-stus-dog)) = anna-believes-john-bought-stus-dog) (show *anna-believes-john-bought-stus-dog) ; Note: This is "asserted", not merely "built", since it *is* ; one of Cassie's beliefs that Anna believes that John ; bought Stu's dog. ; Exercise for the reader: Represent (5) using the "equiv-equiv" ; case frame. I.e., represent that Anna believes that the dog ; that John bought is the dog that Stu sold. ; Finally, look at the entire network: (describe *nodes) ; And a dump of the network: (dump *nodes) ; and graphically: (show *nodes) ; Syntax and semantics for the agent-act-action-object-iobject case ; frame: ; ; Syntax: ; ------- ; (build agent AGENT ; act (build action ACTION ; object DIRECT_OBJECT ; iobject INDIRECT_OBJECT)) ; ; builds a well-formed SNePS network, m. ; ; Semantics: ; ---------- ; ; [[m]] is the proposition that [[AGENT]] does [[ACTION]] ; with direct object [[DIRECT_OBJECT]] and indirect object ; [[INDIRECT_OBJECT]] ; ; Example: See above.