* ; ======================================================================= ; 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) Net reset - Relations and paths are still defined 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) broadcast-one-report CPU time : 0.00 * ; ;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.00 * ;(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.01 * ; 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))) (m3! (forall v4 v3 v2 v1) (&ant (p4 (object v2) (property v4)) (p3 (object v1) (property v3)) (p2 (object1 v1) (object2 v2) (rel (m2 (lex rather_than)))) (p1 (class (m1 (lex unknown))) (member v3))) (cq (p5 (antonym v4 v3)))) (m3!) CPU time : 0.00 * ;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))) (m4! (forall v7 v6 v5) (&ant (p7 (antonym v7 v6)) (p6 (antonym v6 v5))) (cq (p8 (synonym v7 v5)))) (m4!) CPU time : 0.00 * ;"dour" is a member of the class "unknown" (describe(add member(build lex dour) class (build lex unknown))) (m6! (class (m1 (lex unknown))) (member (m5 (lex dour)))) (m6!) CPU time : 0.00 * ;"gloomy" is an antonym of "cheerful" (describe(add antonym(build lex gloomy) antonym(build lex cheerful))) (m9! (antonym (m8 (lex cheerful)) (m7 (lex gloomy)))) (m9!) CPU time : 0.01 * ;"sad" is an antonym of "cheerful" (describe(add antonym(build lex sad) antonym(build lex cheerful))) (m14! (synonym (m12 (lex sad)) (m7 (lex gloomy)))) (m13! (antonym (m12) (m8 (lex cheerful)))) (m14! m13!) CPU time : 0.02 * ;"bad" is an antonym of "good" (describe(add antonym(build lex good) antonym(build lex bad))) (m18! (antonym (m17 (lex bad)) (m16 (lex good)))) (m18!) CPU time : 0.00 * ; 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))) (m22! (object (m21 (lex mood))) (property (m8 (lex cheerful)))) (m22!) CPU time : 0.01 * ;"The object "mood" has the property of "good" (describe(add object (build lex mood) property (build lex good))) (m23! (object (m21 (lex mood))) (property (m16 (lex good)))) (m23!) CPU time : 0.00 * ;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))) (m25! (object1 (m24 (lex manner))) (object2 (m21 (lex mood))) (rel (m2 (lex rather_than)))) (m25!) CPU time : 0.00 * ;The object "manner" has the property of "dour" (describe(add object(build lex manner) property(build lex dour))) (m30! (synonym (m17 (lex bad)) (m5 (lex dour)))) (m29! (synonym (m7 (lex gloomy)) (m5))) (m28! (antonym (m16 (lex good)) (m5))) (m27! (antonym (m8 (lex cheerful)) (m5))) (m26! (object (m24 (lex manner))) (property (m5))) (m30! m29! m28! m27! m26!) CPU time : 0.00 * ;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))) (m27! (antonym (m8 (lex cheerful)) (m5 (lex dour)))) (m28! (antonym (m16 (lex good)) (m5))) (m27! m28!) CPU time : 0.00 * ;Synonyms of Dour; (describe(find synonym ?x synonym(build lex dour))) (m29! (synonym (m7 (lex gloomy)) (m5 (lex dour)))) (m30! (synonym (m17 (lex bad)) (m5))) (m29! m30!) CPU time : 0.00 * End of /home/medue/psr2/Desktop/dour-demo.txt demonstration.