; ======================================================================= ; FILENAME: dour-demo.txt ; Date: 03-21-11 ; PROGRAMMER: Philip Rosebrough ; 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 "dour-demo.txt" :av) ; ; Make sure all necessary files are in the current working directory ; or else use full path names. ; ======================================================================= ; Clear the SNePS network: (resetnet) ; 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: ; ===================== ;For all w,x,y,z, if y is a member of the class "unknown", and w if related to x by "rather_than", and w has property y, and x has property z. Then property y is an antonym of property z. (describe (assert forall ($w $x $y $z) &ant ( (build member *y class (build lex unknown)) (build object1 *w rel (build lex rather_than) object2 *x) (build object *w property *y) (build object *x property *z)) cq (build antonym *y antonym *z))) ;For all x,y,z, if x is an antonym of y, and y is an antonym of z. Then x is a synonym of z. (describe(assert forall($x $y $z) &ant( (build antonym *x antonym *y) (build antonym *y antonym *z)) cq(build synonym *x synonym *z))) ;"dour" is a member of the class "unknown" (describe(add member(build lex dour) class (build lex unknown))) ;"gloomy" is an antonym of "cheerful" (describe(add antonym(build lex gloomy) antonym(build lex cheerful))) ;"sad" is an antonym of "cheerful" (describe(add antonym(build lex sad) antonym(build lex cheerful))) ;"bad" is an antonym of "good" (describe(add antonym(build lex good) antonym(build lex bad))) ; CASSIE READS THE PASSAGE: ; ========================= ; (put annotated SNePSUL code of the passage here) ;The object "mood" has the property of "cheerful" (describe(add object(build lex mood) property(build lex cheerful))) ;"The object "mood" has the property of "good" (describe(add object (build lex mood) property (build lex good))) ;The object "manner" is related to object "mood" by "rather_than" (describe(add rel(build lex rather_than) object1(build lex manner) object2(build lex mood))) ;The object "manner" has the property of "dour" (describe(add object(build lex manner) property(build lex dour))) ;Have Cassie read in the passage inculding the word, which should ;trigger forward inference and process the definition. ;Then, ask what the word means. ;(describe(deduce synonym(build lex gloomy) synonym(build lex dour))) ;(describe(deduce synonym(build lex sad) synonym(build lex dour))) ;(describe(deduce synonym(build lex bad) synonym(build lex dour))) ;Antonyms of Dour; (describe(find antonym ?x antonym(build lex dour))) ;Synonyms of Dour; (describe(find synonym ?x synonym(build lex dour)))