Welcome to SNePS-2.7 [PL:1 2008/02/12 17:19:45]\ \ Copyright (C) 1984--2007 by Research Foundation of\ State University of New York. SNePS comes with ABSOLUTELY NO WARRANTY!\ Type `(copyright)' for detailed copyright information.\ Type `(demo)' for a list of example applications.\ \ 12/2/2008 14:04:45\ \ * (demo "aphelion-point.demo")\ \ File /home/phigrad/wdduncan/ubcourses/adv_knowledge_rep/aphelion-point.demo is now the source of input.\ \ \ CPU time : 0.01 \ \ * ; =======================================================================\ ; 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)\ nil\ \ \ \ CPU time : 0.00 \ \ * \ \ ; Load the appropriate definition algorithm:\ ^(\ --> load "/projects/rapaport/CVA/STN2/defun_noun.cl")\ ; Loading /projects/rapaport/CVA/STN2/defun_noun.cl\ t\ \ \ \ CPU time : 0.03 \ \ * \ \ ; Clear the SNePS network:\ (resetnet t)\ \ Net reset\ \ \ CPU time : 0.00 \ \ * \ \ ; 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")\ Loading file /projects/rapaport/CVA/STN2/demos/rels.\ \ \ CPU time : 0.00 \ \ * \ \ ; load all pre-defined path definitions:\ (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths")\ Loading file /projects/rapaport/CVA/mkb3.CVA/paths/paths.\ before implied by the path (compose before\ (kstar (compose after- ! before)))\ before- implied by the path (compose (kstar (compose before- ! after))\ before-)\ after implied by the path (compose after\ (kstar (compose before- ! after)))\ after- implied by the path (compose (kstar (compose after- ! before))\ after-)\ sub1 implied by the path (compose object1- superclass- ! subclass\ superclass- ! subclass)\ sub1- implied by the path (compose subclass- ! superclass subclass- !\ superclass object1)\ super1 implied by the path (compose superclass subclass- ! superclass\ object1- ! object2)\ super1- implied by the path (compose object2- ! object1 superclass- !\ subclass superclass-)\ superclass implied by the path (or superclass super1)\ superclass- implied by the path (or superclass- super1-)\ \ \ CPU time : 0.00 \ \ * \ \ ; 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)))\ (m2! (object b1) (proper-name (m1 (lex January))))\ \ (m2!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; PK2. Something is named July\ ;; case frame: object/proper-name\ ;; *************************************\ (describe\ (assert object #july \ proper-name (build lex July)))\ (m4! (object b2) (proper-name (m3 (lex July))))\ \ (m4!)\ \ CPU time : 0.00 \ \ * \ \ ;; ******************************************\ ;; 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))))\ (m9! (forall v1) (ant (p1 (object v1) (proper-name (m5 (lex Earth)))))\ (cq (p2 (object b3) (possessor v1) (rel (m8 (lex distance-point))))\ (m7 (object b3) (property (m6 (lex farthest-point))))))\ \ (m9!)\ \ CPU time : 0.00 \ \ * \ \ ;; ****************************************\ ;; 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)))\ (m12! (forall v3 v2)\ (&ant (p4 (object v3) (property (m6 (lex farthest-point))))\ (p3 (object v2) (property (m10 (lex closest-point)))))\ (cq (p5 (object1 v2) (object2 v3) (rel (m11 (lex opposite))))))\ \ (m12!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; 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)))\ (m14! (forall v6 v5 v4)\ (&ant\ (p9 (act (p8 (action (m13 (lex reaches))) (object v6))) (agent v4)\ (time b2))\ (p7 (act (p6 (action (m13)) (object v5))) (agent v4) (time b1)))\ (cq (p10 (object1 v5) (object2 v6) (rel (m11 (lex opposite))))))\ \ (m14!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; 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)))\ (m16! (forall v9 v8 v7)\ (&ant (p13 (object v9) (property (m15 (lex unknown))))\ (p12 (object1 v7) (object2 v9) (rel (m11 (lex opposite))))\ (p11 (object1 v7) (object2 v8) (rel (m11))))\ (cq (p14 (equiv v9 v8))))\ \ (m16!)\ \ CPU time : 0.00 \ \ * \ \ \ ; 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)))\ (m18! (object b3) (possessor b4) (rel (m8 (lex distance-point))))\ (m17! (object b4) (proper-name (m5 (lex Earth))))\ (m7! (object b3) (property (m6 (lex farthest-point))))\ \ (m18! m17! m7!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; P2. Something has the property "closest point".\ ;; case frame: object/property\ ;; *************************************\ (describe\ (add object #closest-point \ property (build lex closest-point)))\ (m20! (object1 b5) (object2 b3) (rel (m11 (lex opposite))))\ (m19! (object b5) (property (m10 (lex closest-point))))\ \ (m20! m19!)\ \ CPU time : 0.01 \ \ * \ \ ;; *************************************\ ;; 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))\ (m23! (object b5) (possessor b4) (rel (m8 (lex distance-point))))\ \ (m23!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; 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 indicate the time\ ;; at which the action occurred.\ ;; *************************************\ (describe\ (add agent *earth\ act (build action (build lex reaches)\ object *closest-point)\ time *january))\ (m24! (act (m22 (action (m13 (lex reaches))) (object b5))) (agent b4)\ (time b1))\ \ (m24!)\ \ CPU time : 0.01 \ \ * \ \ ;; *************************************\ ;; 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)))\ (m25! (object b6) (property (m15 (lex unknown))))\ \ (m25!)\ \ CPU time : 0.00 \ \ * \ \ \ ;; *************************************\ ;; 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))\ (m26! (object b6) (possessor b4) (rel (m8 (lex distance-point))))\ \ (m26!)\ \ CPU time : 0.00 \ \ * \ \ ;; *************************************\ ;; 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 indicate the time\ ;; at which the action occurred.\ ;; *************************************\ (describe\ (add agent *earth\ act (build action (build lex reaches)\ object *aphelion-point)\ time *july)) \ (m30! (equiv b6 b3))\ (m29! (object1 b5) (object2 b6) (rel (m11 (lex opposite))))\ (m28! (act (m27 (action (m13 (lex reaches))) (object b6))) (agent b4)\ (time b2))\ \ (m30! m29! m28!)\ \ CPU time : 0.00 \ \ * \ \ ; 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))\ (m30! (equiv b6 b3))\ \ (m30!)\ \ CPU time : 0.00 \ \ * \ \ End of /home/phigrad/wdduncan/ubcourses/adv_knowledge_rep/aphelion-point.demo demonstration.}