From: JD Hede Date: December 8, 2008 11:59:34 AM EST To: "William J. Rapaport" Subject: CVA project files Please see attached files. /Jesper D Hede ; ============================================================= ========== ; FILENAME: pondokkie.demo ; DATE: 11/01/08 ; PROGRAMMER: Jesper Dybdahl Hede ;; NOTE TO PROGRAMMER: GLOBALLY REPLACE "WORD" BY YOUR WORD, ;; "DATE" BY TODAY'S DATE, ;; "YOUR_NAME" BY YOUR NAME, ;; AND THEN DELETE THIS COMMENT (TO MAKE IT LOOK GOOD!) ;; 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 "pondokkie.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) ; load all pre-defined relations: (intext "/projects/rapaport/CVA/STN2/demos/rels") ; Definitions: (define loc propername dur ) ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ; BACKGROUND KNOWLEDGE: ; ===================== ; Low Veld and Crocodile River are places in nature. (describe (assert forall ($x) ant (build object *x loc *lveld) ant (build object *x loc *criver) cq (build object *x loc (build lex "nature")))) ; If an action has duration "A WEEK OR TWO" ; then it also has the duration "OVERNIGHT" (describe (assert forall ($a $v $w $u) ant (build agent *a act (build action *v object *w dur (build lex "a\ week\ or\ two") time *u)) cq (build agent *a act (build action *v object *w dur (build lex "overnight") time *u)))) ; If x stays at place y overnight, and y is in nature, ; then y is a shelter of some kind. (describe (assert forall ($x $y) &ant ( build agent *x act (build action (build lex "stay") object *y dur (build lex "overnight")) ) &ant (build object *y loc (build lex "nature")) cq (build member *y class (build lex "shelter")))) ; If x stays at place y overnight in winter, ; then y is a warm place. (describe (assert forall ($x $y) ant ( build agent *x act (build action (build lex "stay") object *y dur (build lex "overnight") time (build lex "winter")) ) cq (build object *y property (build lex "warm")))) ; A warm shelter is some kind of house. (describe (assert forall ($x) &ant (build member *x class (build lex "shelter")) &ant(build object *x property (build lex "warm")) cq (build member *x class (build lex "house")))) ; CASSIE READS THE PASSAGE: ; ========================= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; REPRESENTATION OF THE SENTENSE ; ; She had a pondokkie down in the Low Veld, on ; the Crocodile River, where she went sometimes ; in the winter to stay for a week or two. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SENTENSE 1: She has a pondokkie ; First: Something is a pondokkie (describe (add member #pondokkie class (build lex "pondokkie"))) ; Second: Create this "She" (describe (add object #she propername "She")) ; Third: She owns this pondokkie (describe (add possessor *she object *pondokkie rel (find lex "pondokkie"))) ; SENTENSE 2: The pondokkie is at "Crocodile River" ; There is a place called "Crocodile River" (describe (add object #criver propername "Crocodile\ River")) (describe (add object *pondokkie loc *criver)) ; SENTENSE 3: The pondokkie is at "Low Veld" ; There is a place called "Low Veld" (describe (add object #lveld propername "Low\ Veld")) (describe (add object *pondokkie loc *lveld)) ; SENTENSE 4: She stays at pondokkie in winter for a week or two. (describe (add agent *she act (build action (build lex "stay") object *pondokkie dur (build lex "a\ week\ or\ two") time (build lex "winter")))) ; Ask Cassie what "pondokkie" means: ^(defineNoun "pondokkie") ============================================================= = Starting image `/util/acl/composer' with no arguments in directory `/home/unmgrad/jdhede/' on machine `localhost'. ;;; Installing locale patch, version 1. International Allegro CL Enterprise Edition 8.1 [Linux (x86)] (Oct 27, 2008 11:52) Copyright (C) 1985-2007, Franz Inc., Oakland, CA, USA. All Rights Reserved. This development copy of Allegro CL is licensed to: [4549] University at Buffalo ;; Optimization settings: safety 1, space 1, speed 1, debug 2. ;; For a complete description of all compiler switches given the current ;; optimization settings evaluate (explain-compiler-settings). ;;--- ;; Current reader case mode: :case-sensitive-lower cl-user(1): ;; Setting (stream-external-format *terminal-io*) to :utf-8. cl-user(2): :ld /projects/snwiz/bin/sneps ; Loading /projects/snwiz/bin/sneps.lisp ;;; Installing jlinker patch, version 1. ;;; Installing regexp2-s patch, version 1. Loading system SNePS...10% 20% 30% 40% 50% 60% 70% 80% 90% 100% SNePS-2.7 [PL:1 2008/02/12 17:19:45] loaded. Type `(sneps)' or `(snepslog)' to get started. cl-user(3): (sneps) 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/8/2008 11:20:54 * (demo "pondokkie.demo") File /home/unmgrad/jdhede/pondokkie.demo is now the source of input. CPU time : 0.01 * ; ============================================================= ========== ; FILENAME: pondokkie.demo ; DATE: 11/01/08 ; PROGRAMMER: Jesper Dybdahl Hede ;; NOTE TO PROGRAMMER: GLOBALLY REPLACE "WORD" BY YOUR WORD, ;; "DATE" BY TODAY'S DATE, ;; "YOUR_NAME" BY YOUR NAME, ;; AND THEN DELETE THIS COMMENT (TO MAKE IT LOOK GOOD!) ;; 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 "pondokkie.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.02 * ; Clear the SNePS network: (resetnet) Net reset - Relations and paths are still defined CPU time : 0.00 * ; load all pre-defined relations: (intext "/projects/rapaport/CVA/STN2/demos/rels") Loading file /projects/rapaport/CVA/STN2/demos/rels. CPU time : 0.00 * ; Definitions: (define loc propername dur ) (loc propername dur) 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: ; ===================== ; Low Veld and Crocodile River are places in nature. (describe (assert forall ($x) ant (build object *x loc *lveld) ant (build object *x loc *criver) cq (build object *x loc (build lex "nature")))) (m2! (forall v1) (ant (p1 (object v1))) (cq (p2 (loc (m1 (lex nature))) (object v1)))) (m2!) CPU time : 0.00 * ; If an action has duration "A WEEK OR TWO" ; then it also has the duration "OVERNIGHT" (describe (assert forall ($a $v $w $u) ant (build agent *a act (build action *v object *w dur (build lex "a\ week\ or\ two") time *u)) cq (build agent *a act (build action *v object *w dur (build lex "overnight") time *u)))) (m5! (forall v5 v4 v3 v2) (ant (p4 (act (p3 (action v3) (dur (m3 (lex a week or two))) (object v4) (time v5))) (agent v2))) (cq (p6 (act (p5 (action v3) (dur (m4 (lex overnight))) (object v4) (time v5))) (agent v2)))) (m5!) CPU time : 0.00 * ; If x stays at place y overnight, and y is in nature, ; then y is a shelter of some kind. (describe (assert forall ($x $y) &ant ( build agent *x act (build action (build lex "stay") object *y dur (build lex "overnight")) ) &ant (build object *y loc (build lex "nature")) cq (build member *y class (build lex "shelter")))) (m8! (forall v7 v6) (&ant (p9 (loc (m1 (lex nature))) (object v7)) (p8 (act (p7 (action (m6 (lex stay))) (dur (m4 (lex overnight))) (object v7))) (agent v6))) (cq (p10 (class (m7 (lex shelter))) (member v7)))) (m8!) CPU time : 0.01 * ; If x stays at place y overnight in winter, ; then y is a warm place. (describe (assert forall ($x $y) ant ( build agent *x act (build action (build lex "stay") object *y dur (build lex "overnight") time (build lex "winter")) ) cq (build object *y property (build lex "warm")))) (m11! (forall v9 v8) (ant (p12 (act (p11 (action (m6 (lex stay))) (dur (m4 (lex overnight))) (object v9) (time (m9 (lex winter))))) (agent v8))) (cq (p13 (object v9) (property (m10 (lex warm)))))) (m11!) CPU time : 0.00 * ; A warm shelter is some kind of house. (describe (assert forall ($x) &ant (build member *x class (build lex "shelter")) &ant(build object *x property (build lex "warm")) cq (build member *x class (build lex "house")))) (m13! (forall v10) (&ant (p15 (object v10) (property (m10 (lex warm)))) (p14 (class (m7 (lex shelter))) (member v10))) (cq (p16 (class (m12 (lex house))) (member v10)))) (m13!) CPU time : 0.00 * ; CASSIE READS THE PASSAGE: ; ========================= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; REPRESENTATION OF THE SENTENSE ; ; She had a pondokkie down in the Low Veld, on ; the Crocodile River, where she went sometimes ; in the winter to stay for a week or two. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SENTENSE 1: She has a pondokkie ; First: Something is a pondokkie (describe (add member #pondokkie class (build lex "pondokkie"))) (m15! (class (m14 (lex pondokkie))) (member b1)) (m15!) CPU time : 0.00 * ; Second: Create this "She" (describe (add object #she propername "She")) (m18! (loc (m1 (lex nature))) (object b2)) (m17! (object b2)) (m16! (object b2) (propername She)) (m18! m17! m16!) CPU time : 0.00 * ; Third: She owns this pondokkie (describe (add possessor *she object *pondokkie rel (find lex "pondokkie"))) (m23! (loc (m1 (lex nature))) (object b1)) (m22! (object b1)) (m21! (object b1) (possessor b2) (rel (m14 (lex pondokkie)))) (m23! m22! m21!) CPU time : 0.00 * ; SENTENSE 2: The pondokkie is at "Crocodile River" ; There is a place called "Crocodile River" (describe (add object #criver propername "Crocodile\ River")) (m28! (loc (m1 (lex nature))) (object b3)) (m27! (object b3)) (m26! (object b3) (propername Crocodile River)) (m28! m27! m26!) CPU time : 0.00 * (describe (add object *pondokkie loc *criver)) (m31! (loc b3) (object b1)) (m22! (object b1)) (m31! m22!) CPU time : 0.00 * ; SENTENSE 3: The pondokkie is at "Low Veld" ; There is a place called "Low Veld" (describe (add object #lveld propername "Low\ Veld")) (m34! (loc (m1 (lex nature))) (object b4)) (m33! (object b4)) (m32! (object b4) (propername Low Veld)) (m34! m33! m32!) CPU time : 0.01 * (describe (add object *pondokkie loc *lveld)) (m37! (loc b4) (object b1)) (m22! (object b1)) (m37! m22!) CPU time : 0.00 * ; SENTENSE 4: She stays at pondokkie in winter for a week or two. (describe (add agent *she act (build action (build lex "stay") object *pondokkie dur (build lex "a\ week\ or\ two") time (build lex "winter")))) (m45! (class (m12 (lex house))) (member b1)) (m43! (object b1) (property (m10 (lex warm)))) (m42! (class (m7 (lex shelter))) (member b1)) (m41! (act (m24 (action (m6 (lex stay))) (dur (m4 (lex overnight))) (object b1))) (agent b2)) (m40! (act (m25 (action (m6)) (dur (m4)) (object b1) (time (m9 (lex winter))))) (agent b2)) (m39! (act (m38 (action (m6)) (dur (m3 (lex a week or two))) (object b1) (time (m9)))) (agent b2)) (m45! m43! m42! m41! m40! m39!) CPU time : 0.00 * ; Ask Cassie what "pondokkie" means: ^( --> defineNoun "pondokkie") Definition of pondokkie: Possible Class Inclusions: shelter, house, Actions performed on a pondokkie: b2 stay, Possible Properties: warm, nil CPU time : 0.03 * End of /home/unmgrad/jdhede/pondokkie.demo demonstration. CPU time : 0.07 *