; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; All other lines are SNePSUL commands. ; ======================================================================= ; FILENAME: HYDROPHONE.demo ; DATE: 1-May-2007 ; PROGRAMMER: Ahmed Mohammed Hassan ; ; To use this file: run SNePS; at the SNePS prompt (*), type: ; ; (demo "HYDROPHONE.demo" :av) ; ; Make sure all necessary files are in the current working directory or else use full path names. ; ======================================================================= ; Turn off inference tracing. ^(setq snip:*infertrace* nil) ; Load the noun definition algorithm: ^(load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; Clear the SNePS network: (resetnet t) ; 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") ; DEFINING RELATIONS ; ===================== (define object class property member lex) (define location mod action-mod action-head) (define possessor rel agent) (define as-obj1 as-obj2 as-property quality equiv proposition) ; BACKGROUND KNOWLEDGE: ; ===================== ; Annotated SNePSUL codes of background knowledge ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% {Prior knowledge representations:} ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;% Voices on the surface are strong and clear to the best degree: (assert forall $x &ant (build member *x class (build lex "VOICE")) &ant (build object *x location (build lex "SURFACE")) cq (build object *x property ((build lex "STRONG") (build lex "CLEAR")) quality (build lex "maximum")) )=pk-voices ;% If a human is at some location, then (the source of) his voice is at that same location: (assert forall ($someone $somewhere $prop) &ant (build object *someone location *somewhere) &ant (build object *prop possessor *someone rel (build lex "VOICE")) cq (build object *prop location *somewhere) )=pk-humanloc ;% {If a human is NOT on the surface, then that human is PROBABLY underwater:} (assert forall $human &ant (build member *human class (build lex "HUMAN")) &ant (build min 0 max 0 arg (build object *human location *theSurface) ) cq (build mod (build lex "probably") proposition (build object *human location (build lex "UNDERWATER")) ) )=pk-notsurface ;% {If x is as p as y, then if x has property p to degree q1 and y has property p to degree q2, then q1 is equivalent to q2:} (assert forall ($x $y $p $q1 $q2) &ant(build as-obj1 *x as-obj2 *y as-property *p) &ant(build object *x property *p quality *q1) &ant(build object *y property *p quality *q2) cq (build equiv *q1 equiv *q2) )=pk-aspropas ;%% {The meaning of the act of ``{going through}''} ;%1%% {If SOMETHING $x$ goes through $y$ then:} ;% {$y$ has an entry point $npt$,} ;% {$y$ has an exit point $xpt$,} ;% {$x$ enters $npt$,} and ;% {$x$ leaves $xpt$:} (assert forall ($x $y $npt $xpt) ant (build agent *x act (build object *y action (build lex "through"))) cq (build member (*npt *xpt) class (build lex "Thing")) cq (build possessor *y object *npt rel (build lex "Entry Point")) cq (build possessor *y object *xpt rel (build lex "Exit Point")) cq (build agent *x act (build object *npt action (build lex "enter"))) cq (build agent *x act (build object *xpt action (build lex "exit"))) )=pk-actGT ;%2%% {If a VOICE goes through $y$ then:} ;% {$y$ is used for talking,} ;% {$y$ is a physical object ;% {In fact, this should be another PK rule that infers that: ;% whatever is used for talking is a device and hence a physical object.},} (assert forall ($y) ant (build agent (build lex "VOICE") act (build object *y action (build lex "through"))) cq (build member *y class "physical object") ; future modifications: cq (build ANYTHING_ELSE...) )=pk-last ; CASSIE READS THE PASSAGE: ; ========================= ; Annotated SNePSUL codes of the passage ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% {SNePS Text representations:} ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;% {There is a human who has voice: ;%% {({``his voice ... ''})}} ;%%% {Someone is human:} ;;; the following "add" makes some kind of problems with SNePS ;;; (add member #theHero class (build lex "HUMAN")) ;;; so I used: (assert member #theHero class (build lex "HUMAN")) ;%%% {Something is a voice:} (add member #theVoice class (build lex "VOICE")) ;%%% {The human has that voice:} ;;; the following "add" makes some kind of problems with SNePS ;;; (add object *theVoice possessor *theHero rel (build lex "VOICE")) ;;; so I used: (assert object *theVoice possessor *theHero rel (build lex "VOICE")) ;% {The human voice crackled briskly through the hydrophone: ;%% {({`` ... voice crackled briskly through the hydrophone ... ''})}} ;%%% {Something is hydrophone:} (add member #theWord class (build lex "HYDROPHONE")) ;%%% {The human voice did the actions: ``\ashmagenta{crackled briskly}'' ... :} ;;; the following "add" makes some kind of problems with SNePS ;;; (add agent *theVoice act (build object *theWord action (build lex "crackle briskly" lex "through"))) ;;; so I used: (assert agent *theVoice act (build object *theWord action (build lex "crackle briskly" lex "through"))) ;%%% {... and also went ``\ashmagenta{through}`` that hydrophone:} (add agent *theVoice act (build object *theWord action (build lex "through"))) ;% {The output voice is as strong and clear as the input voice on the surface:\\ ;%% {({``his voice crackled ... AS strong and clear AS IF he had been on the surface ... ''})}} ;%%% {Something is surface:} (add member #theSurface class (build lex "SURFACE")) ;%%% {IT IS NOT THE CASE THAT the human has been on the surface:} ;;; the following "add" makes some kind of problems with SNePS ;;; (add min 0 max 0 arg (build object *theHero location *theSurface)) ;;; so I used: (assert min 0 max 0 arg (build object *theHero location *theSurface)) ;%%% {Something is a voice ... :} (add member #aSurVoice class (build lex "VOICE")) ;%%% { ... on the surface:} ;;; the following "add" makes some kind of problems with SNePS ;;; (add object *aSurVoice location (build lex "SURFACE")) ;;; so I used: (assert object *aSurVoice location (build lex "SURFACE")) ;%%% {The voice is AS strong (AND) clear AS that voice on surface:} (add as-obj1 *theVoice as-obj2 *aSurVoice as-property ((build lex "strong")(build lex "clear")) ) ; ================================================== ; Ask Cassie what "HYDROPHONE" means: ^(defineNoun "HYDROPHONE")