timberlake {~} > mlisp International Allegro CL Enterprise Edition 8.2 [Linux (x86)] (Jul 9, 2010 16:05) Copyright (C) 1985-2010, 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): cl-user(1): :ld /projects/snwiz/bin/sneps ; Loading /projects/snwiz/bin/sneps.lisp ;;; Installing streamc patch, version 2. Loading system SNePS...10% 20% 30% 40% 50% 60% 70% 80% 90% 100% SNePS-2.7 [PL:2 2011/04/19 17:07:58] loaded. Type `(sneps)' or `(snepslog)' to get started. cl-user(2): (sneps) Welcome to SNePS-2.7 [PL:2 2011/04/19 17:07:58] Copyright (C) 1984--2010 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. 5/12/2011 11:39:49 * (demo "bethanyg-SEDUM-demo.txt") File /home/eedue/bethanyg/bethanyg-SEDUM-demo.txt is now the source of input. CPU time : 0.01 * ; ======================================================================= ; FILENAME: sedum-demo.txt ; 2_22_11: 03-21-11 ; PROGRAMMER: bethanyg ; 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 "bethanyg-SEDUM-demo.txt" :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 * ;using the noun algorithm ^( --> load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; Loading /projects/rapaport/CVA/STN2/defun_noun.cl t CPU time : 0.05 * ; 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) # CPU time : 0.00 * ;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) # CPU time : 0.00 * ; 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") ; Loading /projects/rapaport/CVA/STN2/demos/rels t CPU time : 0.01 * ;(intext "/projects/rapaport/CVA/STN2/demos/rels") ; load all pre-defined path definitions: ;(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ^( --> load "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ; Loading /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-) t CPU time : 0.00 * ; BACKGROUND KNOWLEDGE: ; ===================== ;builds the outside knowledge "all plants grow from all cracks" (describe ;forall x and forall y (assert forall($x $y) &ant ;if x is a plant ((build member *x class (build lex "plant")) ;if y is a crack (build member *y class (build lex "crack"))) cq ;then x grows from y (build agent *x act (build action (build lex "grow from") object *y))) ) (m4! (forall v2 v1) (&ant (p2 (class (m2 (lex crack))) (member v2)) (p1 (class (m1 (lex plant))) (member v1))) (cq (p4 (act (p3 (action (m3 (lex grow from))) (object v2))) (agent v1)))) (m4!) CPU time : 0.00 * ;builds the inference rule that if w is unknown, and x is ;like w, and x performs action y, then w performs action y (describe ;forall w,x,y, and z (assert forall ($w $x $y $z) ;if object1 is like object 2 &ant ((build object1 *x rel (build lex "is like") object2 *w) ;and w is a member of the class z (build member *w class *z) ;and z is unknown (build member *z class (build lex "unknown")) ;and x does the act y (build agent *x act *y)) cq ;the unknown word performs act y (build agent *w act *y)) ) (m7! (forall v6 v5 v4 v3) (&ant (p8 (act v5) (agent v4)) (p7 (class (m6 (lex unknown))) (member v6)) (p6 (class v6) (member v3)) (p5 (object1 v4) (object2 v3) (rel (m5 (lex is like))))) (cq (p9 (act v5) (agent v3)))) (m7!) CPU time : 0.00 * ;builds the inference rule that if x is unknown, and x performs action y, ;and z performs action y, then x is a subclass of z. (describe ;forall x, y, z, q, and c (assert forall ($x $y $z $q $c) &ant( ;if x is part of the class q (build member *x class *q) ;if q is part of the class of unknowns (build member *q class (build lex "unknown")) ;and x performs y (build agent *x act *y) ;and z perfroms y (build agent *z act *y) ;and z is a member of some class c (build member *z class *c) ) cq ;then q is a subclass of c (build subclass *q superclass *c) ) ) (m8! (forall v11 v10 v9 v8 v7) (&ant (p14 (class v11) (member v9)) (p13 (act v8) (agent v9)) (p12 (act v8) (agent v7)) (p11 (class (m6 (lex unknown))) (member v10)) (p10 (class v10) (member v7))) (cq (p15 (subclass v10) (superclass v11)))) (m8!) CPU time : 0.00 * ; CASSIE READS THE PASSAGE: ; ========================= ; (put annotated SNePSUL code of the passage here) ;Passage: "But now I'm up, and little flames are growing like sedums from the ;cracks in today's log wall, and I still have a little while before I have to ;drive Phoebe to school." ;builds the part "all flames are like all sedums" (describe ;forall x and all y (add forall($x $y) ;if x is a flame and y is a sedum &ant ((build member *x class (build lex "flame")) (build member *y class (build lex "sedum")) ) ;then x is like y. cq (build object1 *x rel (build lex "is like") object2 *y)) ) (m11! (forall v13 v12) (&ant (p17 (class (m10 (lex sedum))) (member v13)) (p16 (class (m9 (lex flame))) (member v12))) (cq (p18 (object1 v12) (object2 v13) (rel (m5 (lex is like)))))) (m11!) CPU time : 0.00 * ;sedum is unknown (describe (add member (build lex "sedum") class (build lex "unknown"))) (m12! (class (m6 (lex unknown))) (member (m10 (lex sedum)))) (m12!) CPU time : 0.04 * ;builds the part "flames grow from cracks" (describe ;forall x and all y (add forall($x $y) ;if x is a flame and y is a crack &ant ((build member *x class (build lex "flame")) (build member *y class (build lex "crack"))) ;then x grows from y cq (build agent *x act (build action (build lex "grow from") object *y))) ) (m21! (forall v15 v14) (&ant (p43 (class (m2 (lex crack))) (member v15)) (p42 (class (m9 (lex flame))) (member v14))) (cq (p45 (act (p44 (action (m3 (lex grow from))) (object v15))) (agent v14)))) (m21!) CPU time : 0.00 * ;something is a sedum (describe (add member #asedum class (build lex "sedum"))) (m22! (class (m10 (lex sedum))) (member b1)) (m22!) CPU time : 0.01 * ;something is a flame (describe (add member #aflame class (build lex "flame"))) (m32! (object1 b2) (object2 b1) (rel (m5 (lex is like)))) (m31! (class (m9 (lex flame))) (member b2)) (m32! m31!) CPU time : 0.01 * ;something is a plant (describe (add member #aplant class (build lex "plant"))) (m33! (class (m1 (lex plant))) (member b3)) (m33!) CPU time : 0.00 * ;something is a crack (describe (add member #acrack class (build lex "crack"))) (m40! (subclass (m10 (lex sedum))) (superclass (m1 (lex plant)))) (m39! (subclass (m10)) (superclass (m9 (lex flame)))) (m38! (act (m35 (action (m3 (lex grow from))) (object b4))) (agent b1)) (m37! (act (m35)) (agent b2)) (m36! (act (m35)) (agent b3)) (m34! (class (m2 (lex crack))) (member b4)) (m40! m39! m38! m37! m36! m34!) CPU time : 0.02 * ;Have Cassie read in the passage inculding the word, which should ; trigger forward inference and process the definition. ;Then, ask what the word means. ^( --> defineNoun "sedum") Definition of sedum: Class Inclusions: plant, flame, Possible Actions: grow from crack, nil CPU time : 0.02 * End of /home/eedue/bethanyg/bethanyg-SEDUM-demo.txt demonstration. CPU time: 0.16