; ======================================================================= ; FILENAME: cantora.demo ; DATE: 12/12/06 ; PROGRAMMER: Mark Zorn ;sentence ;"Then we came to a very neat like cantora with typewriters and flowers on ;the desks, and at the like chief desk the top millicent was sitting." ;From "A Clockwork Orange" by Anthony Burgess ;; this template version: ;; http://www.cse.buffalo.edu/~rapaport/CVA/snepslog-template-2006114.demo ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; Lines beginning with "%" are SNePSUL commands. ; All other lines are SNePSLOG commands. ; ; To use this file: run SNePSLOG; at the SNePSLOG prompt (:), type: ; ; demo "cantora.demo" av ; ; Make sure all necessary files are in the current working directory ; or else use full path names. ; ======================================================================= ; Set SNePSLOG mode = 3 set-mode-3 ; Turn off inference tracing; this is optional. ; If tracing is desired, enter "trace" instead of "untrace": untrace inference ; Load the appropriate definition algorithm: ^(cl:load "/home/unmdue/mrzorn/CSE663/CVA/defun_noun") ; Clear the SNePS network: clearkb ; OPTIONAL: ; UNCOMMENT THE FOLLOWING CODE TO TURN FULL FORWARD INFERENCING ON: ; ^(cl:load "/projects/rapaport/CVA/STN2/ff") ; define frames here: ; ===================== ;define lex case frame define-frame thing-called(nil lex) ;define object property case frame ;[[object-property(x,y)]] = x has the property y define-frame object-property(nil object property) ;define member class case frame ;[[member-class(x,y)]] = x is a member of the class y define-frame member-class(nil member class) ;define agent act case frame ;[[agent-act(x,y)]] = x does the action y define-frame agent-act(nil agent act) ;define object1 rel object2 case frame ;[[obj1-rel-obj2(x,y,z)]] = x is related to z by the relation y define-frame obj1-rel-obj2(nil object1 rel object2) ;define action object case frame ;[[action-object(x,y)]] = x is done on/to y define-frame action-object(nil action object) ;define subclass superclass case frame ;[[subclass-superclass(x,y)]] = x is a subclass of the superclass y define-frame subclass-superclass(nil subclass superclass) ;define unused arc labels for the defineNoun function to work %(define a1 a2 a3 a4 after agent against antonym associated before cause class direction equiv etime event from in indobj instr into lex location manner member mode object on onto part place possessor proper-name property rel skf sp-rel stime subclass superclass subset superset synonym time to whole kn_cat) ; define paths here: ; ===================== ; (put annotated SNePSLOG code for your paths here; ; be sure to include both syntax and semantics; ; consult "/projects/rapaport/CVA/mkb3.CVA/paths/snepslog-paths" ; for the proper syntax and some suggested paths; ; be sure to define frames above for any paths that you need here!) define-path class (compose class (kstar (compose subclass- ! superclass))) ; BACKGROUND KNOWLEDGE: ; ===================== ;if x contains y and z is sitting at y then x contains z all(x,y,z)( { obj1-rel-obj2(x,thing-called(contains),y), agent-act(z,action-object(thing-called(sitting),y)), } &=> obj1-rel-obj2(x,thing-called(contains),z) )! ;if x contains z and z is sitting at y then x contains y all(x,y,z)( { obj1-rel-obj2(x,thing-called(contains),z), agent-act(z,action-object(thing-called(sitting),y)), } &=> obj1-rel-obj2(x,thing-called(contains),y) )! ;if x contains y and z is ontop of y then x contains z all(x,y,z)( { obj1-rel-obj2(x,thing-called(contains),y), obj1-rel-obj2(z,thing-called(on),y) } &=> obj1-rel-obj2(x,thing-called(contains),z) )! ;millicents are people subclass-superclass(thing-called(millicent),thing-called(people))! ;if x is a person and y is a desk and x is sitting at y then x is working. all(x,y,z)( { member-class(x,thing-called(person)), agent-act(x,action-object(thing-called(sitting),y)), member-class(y,thing-called(desk)) } &=> agent-act(x,action-object(thing-called(work),y)) )! ;if x is working at y and y is a desk and x is a millicent ;and z contains y, then z is a policestation all(x,y,z)( { agent-act(x,action-object(thing-called(work),y)), member-class(y,thing-called(desk)), member-class(x,thing-called(millicent)), obj1-rel-obj2(z,thing-called(contains),y) } &=> member-class(z,thing-called(policestation)) )! ;police stations are offices subclass-superclass(thing-called(policestation),thing-called(office))! ;if x contains a desk and there is a typewriter on the desk ;then the class that x is a member of, is a subclass of office all(x,y,z,w)( { obj1-rel-obj2(x,thing-called(contains),y), member-class(y, thing-called(desk)), member-class(z, thing-called(typewriter)), obj1-rel-obj2(z,thing-called(on),y), member-class(x,w) } &=> subclass-superclass(w, thing-called(office)) )! ; CASSIE READS THE PASSAGE: ; ========================= ;we came to a cantora agent-act(thing-called(we),action-object(thing-called(come), cantora1))! ;cantora1 is a cantora member-class(cantora1,thing-called(cantora))! ;the cantora is neat object-property(cantora1,thing-called(neat))! ;desk1 is a member of class desks member-class(desk1, thing-called(desk))! ;desk2 is a member of class desks member-class(desk2, thing-called(desk))! ;cantora contains desk 1 obj1-rel-obj2(cantora1,thing-called(contains),desk1)! ;cantora contains desk 2 obj1-rel-obj2(cantora1,thing-called(contains),desk2)! ;typewrite1 is a member of class typewriter member-class(typewriter1, thing-called(typewriter))! ;typewrite2 is a member of class typewriter member-class(typewriter2, thing-called(typewriter))! ;typewriter1 is on desk1 obj1-rel-obj2(typewriter1,thing-called(on),desk1)! ;typewriter2 is on desk2 obj1-rel-obj2(typewriter2,thing-called(on),desk2)! ;flowers1 is a member of class flowers member-class(flowers1, thing-called(flowers))! ;flowers2 is a member of class flowers member-class(flowers2, thing-called(flowers))! ;flowers1 is on desk1 obj1-rel-obj2(flowers1,thing-called(on),desk1)! ;flowers2 is on desk2 obj1-rel-obj2(flowers2,thing-called(on),desk2)! ;the specific chief desk member-class(chiefdesk1,thing-called(desk))! ;chiefdesk1 has the property of being the chief desk object-property(chiefdesk1,thing-called(chiefdesk))! ;the cantora contains the chief desk obj1-rel-obj2(cantora1,thing-called(contains),chiefdesk1)! ;top millicent member-class(topmillicent1,thing-called(millicent))! ;topmillicent1 has the property of being the top millicent object-property(topmillicent1,thing-called(topmillicent))! ;the top millicent was sitting at the chief desk agent-act(topmillicent1,action-object( thing-called(sitting),chiefdesk1))! ; Ask Cassie what "cantora" means: ^(snepsul::defineNoun "cantora") ;;Ask if Cassie knows if cantora is a subclass of anything. - snepsul find %(snepsul::find (compose superclass- ! subclass lex) cantora) ;;Ask if Cassie knows if cantora is a subclass of anything. - snepslog find subclass-superclass(thing-called(cantora),?x)?