; FILENAME: aphelion-point.demo\ ; DATE: 12/08/2008\ ; PROGRAMMER: Bill Duncan\ \ ;; this template version: snepsul-template.demo-20061005.txt\ \ ; Lines beginning with a semi-colon are comments.\ ; Lines beginning with "^" are Lisp commands.\ ; All other lines are SNePSUL commands.\ ;\ ; To use this file: run SNePS; at the SNePS prompt (*), type:\ ;\ ; (demo "aphelion-point.demo" :av)\ ; \ ; Make sure all necessary files are in the current working directory\ ; or else use full path names.\ ; =======================================================================\ \ ; Turn off inference tracing.\ ; This is optional; if tracing is desired, then delete this.\ ^(setq snip:*infertrace* nil)\ \ ; Load the appropriate definition algorithm:\ ^(load "/projects/rapaport/CVA/STN2/defun_noun.cl")\ \ ; Clear the SNePS network:\ (resetnet t)\ \ ; OPTIONAL:\ ; UNCOMMENT THE FOLLOWING CODE TO TURN FULL FORWARD INFERENCING ON:\ ;\ ; ;enter the "snip" package:\ ; ^(in-package snip)\ ;\ ; ;turn on full forward inferencing:\ ; ^(defun broadcast-one-report (represent)\ ; (let (anysent)\ ; (do.chset (ch *OUTGOING-CHANNELS* anysent)\ ; (when (isopen.ch ch)\ ; (setq anysent\ ; (or (try-to-send-report represent ch)\ ; anysent)))))\ ; nil)\ ;\ ; ;re-enter the "sneps" package:\ ; ^(in-package sneps)\ \ ; load all pre-defined relations:\ ; NB: If "intext" causes a "nil not of expected type" error,\ ; then comment-out the "intext" command and then\ ; uncomment & use the load command below, instead\ ;^(load "/projects/rapaport/CVA/STN2/demos/rels")\ (intext "/projects/rapaport/CVA/STN2/demos/rels")\ \ ; load all pre-defined path definitions:\ (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths")\ \ ; BACKGROUND KNOWLEDGE:\ ; =====================\ \ ;; The following propositions (PK1 - PK6)\ ;; represent the prior knowledge (abbreviated "PK")\ ;; used for determining the meaning of\ ;; aphelion point (note: PK3 - PK6 are rules\ ;; for inferring new propositions).\ ;; The case frame used to represent the propostion is included\ ;; with each proposition.\ ;; For more information on these case frames see\ ;; http://www.cse.buffalo.edu/~rapaport/CVA/CaseFrames/case-frames/\ ;; http://www.cse.buffalo.edu/sneps/Manuals/manual27.pdf\ ;; http://www.cse.buffalo.edu/sneps/.\ \ ;; *************************************\ ;; PK1. Something is named January\ ;; case frame: object/proper-name\ ;; *************************************\ (describe\ (assert object #january \ proper-name (build lex January)))\ \ ;; *************************************\ ;; PK2. Something is named July\ ;; case frame: object/proper-name\ ;; *************************************\ (describe\ (assert object #july \ proper-name (build lex July)))\ \ ;; ******************************************\ ;; PK3. (Rule):\ ;; if something has proper name "Earth"\ ;; then there is something which has the property "farthest point"\ ;; and "farthest point" is possessed by "Earth"\ ;; via the relationship "distance point"\ ;; case frame: forall/ant/cq\ ;; ******************************************\ (describe\ (assert forall $x\ &ant(build object *x\ proper-name (build lex Earth))\ cq ((build object #farthest-point\ property (build lex farthest-point))\ (build object *farthest-point\ rel (build lex distance-point)\ possessor *x))))\ \ ;; ****************************************\ ;; PK4. (Rule): \ ;; for all points x and y\ ;; if x has property "closest point"\ ;; and y has property "farthest point"\ ;; then point x is the opposite of point y\ ;; case frame: forall/ant/cq\ ;; ****************************************\ (describe\ (assert forall ($x $y)\ &ant(build object *x\ property (build lex closest-point))\ &ant(build object *y\ property (build lex farthest-point))\ cq (build rel (build lex opposite)\ object1 *x\ object2 *y)))\ \ ;; *************************************\ ;; PK5. (Rule):\ ;; for all points x, y, and planets p\ ;; if p reaches point x in January\ ;; and p reaches point y in July\ ;; then point x is the opposite of point y\ ;; case frame: forall/ant/cq\ ;; *************************************\ (describe \ (assert\ forall ($planet $x $y)\ &ant(build time *january\ agent *planet\ act (build action (build lex reaches)\ object *x))\ &ant(build time *july\ agent *planet\ act (build action (build lex reaches)\ object *y))\ cq (build rel (build lex opposite)\ object1 *x\ object2 *y)))\ \ ;; *************************************\ ;; PK6. (Rule):\ ;; for all x, y, and z\ ;; if x is the opposite of y\ ;; and x is the opposite of z\ ;; and z has the property "unknown"\ ;; then y is equiv to z\ ;; case frame: forall/ant/cq\ ;; *************************************\ (describe\ (assert\ forall ($x $y $z)\ &ant(build rel (build lex opposite)\ object1 *x\ object2 *y)\ &ant(build rel (build lex opposite)\ object1 *x\ object2 *z)\ &ant(build object *z\ property (build lex unknown))\ cq (build equiv *y equiv *z)))\ \ \ ; CASSIE READS THE PASSAGE:\ ; =========================\ \ ;; Here is the orignial passage:\ ;; Earth reaches its closest point in January.\ ;; Earth reaches its aphelion point in July.\ \ ;; The above two sentences are broken\ ;; down into the following eight propositions:\ \ ;; FIRST SENTENCE:\ ;; Earth reaches its closest point in January.\ ;; Breakdown:\ ;; P1. There is something named "Earth".\ ;; P2. Something has the property "closest point".\ ;; P3. Earth has (possesses) the thing "closest point"\ ;; via the relationship "distance point"\ ;; P4. Earth reaches the closest point in January.\ \ ;; SECOND SENTENCE:\ ;; Earth reaches its aphelion point in July.\ ;; Breakdown:\ ;; P5. There is something named "Earth".\ ;; P6. Something has the property "aphelion point".\ ;; P7. Earth has (possesses) the thing "aphelion point"\ ;; via the relationship "distance point"\ ;; P8. Eath reaches the aphelion point in July.\ \ ;; These propositions are represented in SNePSUL as follows.\ ;; The case frame used to represent the propostion is included\ ;; with each proposition.\ ;; For more information on case frames see\ ;; http://www.cse.buffalo.edu/~rapaport/CVA/CaseFrames/case-frames/\ ;; http://www.cse.buffalo.edu/sneps/Manuals/manual27.pdf\ ;; http://www.cse.buffalo.edu/sneps/.\ \ ;; *************************************\ ;; P1. There is something named "Earth".\ ;; case frame: object/proper-name\ ;; *************************************\ (describe\ (add object #earth \ proper-name (build lex Earth)))\ \ ;; *************************************\ ;; P2. Something has the property "closest point".\ ;; case frame: object/property\ ;; *************************************\ (describe\ (add object #closest-point \ property (build lex closest-point)))\ \ ;; *************************************\ ;; P3. Earth has (possesses) the thing "closest point"\ ;; via the relationship "distance point"\ ;; case frame: object/rel/possessor\ ;; *************************************\ (describe\ (add object *closest-point\ rel (build lex distance-point)\ possessor *earth))\ \ ;; *************************************\ ;; P4. Earth reaches the closest point in January.\ ;; case frame: agent/act/action/object/time\ ;; note: This is a non-standard case frame.\ ;; The time relation has been added to\ ;; the standard agent/act/action/object\ ;; case frame in order to denote the time\ ;; at which the action occurred.\ ;; *************************************\ (describe\ (add agent *earth\ act (build action (build lex reaches)\ object *closest-point)\ time *january))\ \ ;; *************************************\ ;; P5. There is something named "Earth".\ ;; case frame: object/proper-name\ ;; *************************************\ ;; This does not need to be represented because it\ ;; has already been represented in P1 above.\ \ ;; *************************************\ ;; P6. Something has the property "aphelion point".\ ;; case frame: object/property\ ;; *************************************\ (describe\ (add object #aphelion-point \ property (build lex unknown)))\ \ \ ;; *************************************\ ;; P7. Earth has (possesses) the thing "aphelion point"\ ;; via the relationship "distance point"\ ;; case frame: object/rel/possessor\ ;; *************************************\ (describe\ (add object *aphelion-point\ rel (build lex distance-point)\ possessor *earth))\ \ ;; *************************************\ ;; P8. Eath reaches the aphelion point in July.\ ;; case frame: agent/act/action/object/time\ ;; note: This is a non-standard case frame.\ ;; The time relation has been added to\ ;; the standard agent/act/action/object\ ;; case frame in order to denote the time\ ;; at which the action occurred.\ ;; *************************************\ (describe\ (add agent *earth\ act (build action (build lex reaches)\ object *aphelion-point)\ time *july)) \ \ ; Ask Cassie what "aphelion-point" means:\ ;^(defineNoun "aphelion-point")\ ;; The defineNoun algorithm will not recognize equiv-equiv relationships.\ ;; So, instead find two nodes which stand in equiv-equiv relationhsip.\ ;; That is, the nodes are equivelant to each other.\ (describe (findassert equiv ?x equiv ?x))