; ======================================================================= ; 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) ;using the noun 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") ^(load "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ; 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))) ) ;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)) ) ;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) ) ) ; 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)) ) ;sedum is unknown (describe (add member (build lex "sedum") class (build lex "unknown"))) ;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))) ) ;something is a sedum (describe (add member #asedum class (build lex "sedum"))) ;something is a flame (describe (add member #aflame class (build lex "flame"))) ;something is a plant (describe (add member #aplant class (build lex "plant"))) ;something is a crack (describe (add member #acrack class (build lex "crack"))) ;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")