; ======================================================================= ; FILENAME: WORD.demo ; DATE: DATE ; PROGRAMMER: YOUR_NAME ;; NOTE TO PROGRAMMER: GLOBALLY REPLACE "WORD" BY YOUR WORD, ;; March 22, 2004 ;; CARLOS LOLLETT ;; 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 "mykolperv2.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") ; 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") ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") (define-path class (compose class (kstar (compose subclass- ! superclass)))) ; loading visualization tool ^(load "show") ; KOLPER ; SENTENCE 2: ; ========================== ; "He virtually always study in the library, as at home he had to work by artificial light all day because of those kolpers" ; Giving a equivalent meaning but more suitable sentence for translation ; ' He virtually always study in the library, ; because ; at home, all day, he had to work by artificial light ; because ; those kolpers ' ; Two goals(based on van Daalen-Kapteijns and Elshout-Mohr, 1981): ; Goal 1: ; ======== ; Get a reformulation of the sentence to have a initial direct definition ; of kolper ; "kolpers in a house mean having artificial light on all day" ; Goal 2: ; ======== ; Inference from the background knowledge ; "kolpers transmit little light" ; However, this inference is done under the assumption of kolper being a kind of window ; Therefore, it could not be achieve completely ; Informal surveys showed that kolper meaning based only on this sentence was considered a abstract object. ; e.g "It is something that stop natural illumination", "It is an object that cannot receive sunlight" ; means that there are at least two possible interpretations ; Active: kolper is actively stopping natural light ; Pasive: kolper is the reason that natural light shouldn't enter to the room. e.g. Gremlims ; Currently I am working in the Active interpretation ; BACKGROUND KNOWLEDGE: ; ===================== ; (put annotated SNePSUL code of your background knowledge here) ; Establishing the condition that library and home are subclasses of indoors (show (describe (assert subclass (build lex "library") superclass (build lex "indoors")))) (show (describe (assert subclass (build lex "home") superclass (build lex "indoors")))) ; Another Rule-based inference in order to establish a equivalence relationship ; 'If somebody is human and someplace is an indoor then To say somebody(human) is in someplace and it is required to use artificial light all-day is equivalent to say that someplace must be a bad natural iluminated place (show ( describe ( assert forall ($place $person) &ant (build member *place class (build lex "indoors")) &ant (build member *person class (build lex "human")) cq (build equiv ( build object1 (build agent *person act ( build action ( build object (build object (build lex "work" ) location *place ) property ( build lex "all_day") ) ) ) rel (build lex "require") object2 (build lex "artificial light") ) equiv (build object *place property (build lex "badlight") ) ) ))) ; A ruled based to extend the function relationship to equivalent concepts (show (describe (assert forall ($myv1 $myv2 $myk) &ant (build equiv *myv1 equiv *myv2) &ant (build object1 *myk rel (build lex "cause") object2 *myv1) cq (build object1 *myk rel (build lex "cause") object2 *myv2) ) )) ; Rule-based inference. "if a place is a bad natural illuminated place then the light is not entering in that place (show (describe (assert forall $place2 ant (build object *place2 property (build lex "badlight")) cq (build object *place2 property (build lex "ligh_ not_entering_there")) ) ) ) ;(describe (assert forall ($st1 $st2) ant(build object1 *st1 rel (build lex "cause") object2 *st2 ) cq (build mode (build lex "presumably") object (build object1 *st1 rel (build lex "function") object2 *st2)))) ; Establishing the a probable relation between causality and funtion (show (describe (assert forall ($st1 $st2) ant(build object1 *st1 rel (build lex "cause") object2 *st2 ) cq (build object1 *st1 rel (build lex "function") object2 *st2) ) ) ) ; CASSIE READS THE PASSAGE: ; ========================= ; (put annotated SNePSUL code of the passage here) ;Original Sentence: ;"He virtually always studied in the library,as at home he had to work by artificial light all day because of those kolpers" ;Revised Sentence: ;He virtually always studied in the library, because at home, all day, he had to work by artificial light because of those kolpers ;Three sections connected by cause-: ; 1) He virtually always studied in the library ; 2) at home, all day, he had to work by artificial light ; 3) those kolpers ; 1) He virtually always studied in the library ; he is human (show (describe (add member #henry class (build lex "human")))) ; location is a library (show (describe (add member #mylibrary class (build lex "library")))) ; He virtually always studied in the library (show (describe (add object (build object (build agent *henry act (build action (build object (build object (build lex study) location *mylibrary ) property (build lex "virtually always") ) ) ) ) ))) ; Causality relation between 1 and the other two sentence is omitted at this stage ; 2) at home, all day, he had to work by artificial light ; myhome is a home (describe (add member #myhome class (build lex "home"))) ;at home, all day, he had to work by artificial light (show (describe (add object1 (build agent *henry act ( build action ( build object ( build object (build lex "work" ) location *myhome ) property (build lex "all_day") ) ) ) rel (build lex "require") object2 (build lex "artificial light") ))) ; 3) those kolpers (show (describe (add member #mykolper class (build lex "kolper")))) ; Causal relation from 3(cause) and 2(consequence) using function relation, to test noun algorithm(besides function there is no other relation used in noun algorithm) (show (describe (add object1 *mykolper rel (build lex "cause") object2 (build object1 (build agent *henry act ( build action ( build object ( build object (build lex "work" ) location *myhome ) property (build lex "all_day") ) ) ) rel (build lex "require") object2 (build lex "artificial light") ) ))) ; big causal relation from 1 to 2 excluded at this stage (show (describe (add object1 ( build object1 (build agent *henry act ( build action ( build object ( build object (build lex "work" ) location *myhome ) property (build lex "all_day") ) ) ) rel (build lex "require") object2 (build lex "artificial light") ) rel (build lex "cause") object2 (build object (build object (build agent *henry act (build action (build object (build object (build lex study) location *mylibrary ) property (build lex "virtually always") ) ) ) ) ) ))) ;(show m51) ;========== From sentence 1 ============= ; "Kolper is a window" (show (describe (add subclass (build lex "kolper") superclass (build lex "window")))) ; Deductions ; =================== ; ; This information wasn't inferred from passage information (describe (deduce object1 *mykolper rel (build lex "function") object2 $j)) ; Ask Cassie what "KOLPER" means: ;; UNCOMMENT THE ONE YOU *DO* WANT ;; AND DELETE THE OTHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ^(defineNoun "kolper") ; ^(defineVerb "WORD") ;(show *nodes)