; ======================================================================= ; FILENAME: kolper.demo ; DATE: April 30, 2004 ; PROGRAMMER: Timaporn Chotvinijchai ;; this template version: template.demo.2003.11.17.txt ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; All other lines are SNePS commands. ; ; To use this file: run SNePS; at the SNePS prompt (*), type: ; ; (demo "kolper.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: ;; UNCOMMENT THE ONE YOU *DO* WANT ;; AND DELETE THE OTHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ^(load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; ^(load "/projects/rapaport/CVA/STN2/defun_verb.cl") ; load show utility ^ (load "show") ; 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: (intext "/projects/rapaport/CVA/STN2/demos/rels") (define mod head) ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ;; BACKGROUND KNOWLEDGE: ;; ===================== ;; #window is a window (describe (assert member #window class (build lex "window"))) ;; #room is a room (describe (assert member #room class (build lex "room"))) ;; window is part of a room (describe (assert object *window rel (build lex "part of") possessor *room)) ;; if part of room front some place, then it make view of that place (describe (assert forall ($por $place) ant (build agent *por act (build action (build lex "front") object *place)) cq (build agent *por act (build action (build lex "make view") object *place)))) ;; if part of room make view of place, then it is window (describe (assert forall (*por *place) ant (build agent *por act (build action (build lex "make view") object *place)) cq (build member *por class *window))) ;; if people "used to something" then peolple "live with that thing for long time" ;; here is the rule that has to put temporal representation for representing "for long time" ;; the case frame that will be used here should be "build stime #time1 etime #time2 dur #dur" (describe (assert forall ($people $thing) ant (build object1 *people rel (build lex "used to") object2 *thing) cq (build agent *people act (build action (build lex "live with") object *thing) ) )) ;; CASSIE READS THE PASSAGE: ;; ========================= ;; the sentence is ;; "when you are used to a broad view, it is quiet depressing when you come to live in a room with one or two ;; kolpers fronting on a courtyard" ;; the comment in the rule was the first version that represent the sentence directly but it ;; is not infer to any background knowledge. If remove the comment, and then run the noun algorithm ;; the result will be nil (describe (add forall ($u $v) &ant (build object1 *u rel (build lex "used to") object2 *v) &ant (build member *v class (build mod (build lex "broad") head (build lex "view"))) cq (build forall ($w $x $y) &ant (build agent *u act (build action (build lex "live with") object *w)) &ant (build subclass *w superclass (build lex "room")) &ant (build object *x rel (build lex "part of") possessor *w) ; &ant (build member *x class (build lex "kolper")) ; &ant (build agent *x ; act (build action (build lex "front") ; object *y)) ; &ant (build member *y class (build lex "courtyard")) ; &ant (build subclass (build lex "courtyard") superclass (build lex "place")) cq (build object *u property (build lex "depressed")) ) )) ;; this representation are used instead of the comment rule above ;; ;; kolper is part of room (describe (add object #kolper rel (build lex "part of") possessor *room)) ;; kolper is a kolper (describe (add member *kolper class (build lex "kolper"))) ;; kolper front courtyard (describe (add agent *kolper act (build action (build lex "front") object (build lex "courtyard")))) ;; courtyard is subclass of place (describe (add subclass (build lex "courtyard") superclass (build lex "place"))) ; Ask Cassie what "WORD" means: ;; UNCOMMENT THE ONE YOU *DO* WANT ;; AND DELETE THE OTHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ; it should show that kolper also make a view of courtyard from the rule ; also kolper is part of kroom or kolper is part of room from the inference ^(defineNoun "kolper") ; ^(defineVerb "WORD") ; it should show that kolper is part of room too .. ; maybe because of the definition of window & room ...