* (demo "sedative2.demo") File /scratch/tutorial/project/sedative2.demo is now the source of input. CPU time : 0.01 * ; ======================================================================= ; FILENAME: sedative2.demo ; PROGRAMMER: Kompalli Suryaprakash ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; All other lines are SNePS commands. ;:ld /projects/snwiz/bin/sneps ; To use this file: run SNePS; at the SNePS prompt (*), type: ; ; (demo "sedative2.demo" :av) ; ; Make sure all necessary files are in the current working directory ; or else use full path names. ; ======================================================================= ; Clear the SNePS network: (resetnet t) Net reset CPU time : 0.01 * ; Turn off inference tracing. ; This is optional; if tracing is desired, then delete this. ;^(setq snip:*infertrace* nil) ; Load the appropriate definition algorithm: ^( --> load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; Loading /projects/rapaport/CVA/STN2/defun_noun.cl t CPU time : 0.15 * ;re-enter the "sneps" package: ^( --> in-package sneps) # CPU time : 0.00 * ; load all pre-defined relations: (intext "/projects/rapaport/CVA/STN2/demos/rels") File /projects/rapaport/CVA/STN2/demos/rels is now the source of input. CPU time : 0.00 * (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) CPU time : 0.02 * End of file /projects/rapaport/CVA/STN2/demos/rels CPU time : 0.02 * ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") File /projects/rapaport/CVA/mkb3.CVA/paths/paths is now the source of input. CPU time : 0.00 * before implied by the path (compose before (kstar (compose after- ! before))) before- implied by the path (compose (kstar (compose before- ! after)) before-) CPU time : 0.00 * after implied by the path (compose after (kstar (compose before- ! after))) after- implied by the path (compose (kstar (compose after- ! before)) after-) CPU time : 0.00 * sub1 implied by the path (compose object1- superclass- ! subclass superclass- ! subclass) sub1- implied by the path (compose subclass- ! superclass subclass- ! superclass object1) CPU time : 0.01 * super1 implied by the path (compose superclass subclass- ! superclass object1- ! object2) super1- implied by the path (compose object2- ! object1 superclass- ! subclass superclass-) CPU time : 0.00 * superclass implied by the path (or superclass super1) superclass- implied by the path (or superclass- super1-) CPU time : 0.00 * End of file /projects/rapaport/CVA/mkb3.CVA/paths/paths CPU time : 0.02 * ; BACKGROUND KNOWLEDGE: ; ===================== ;; Background knowledge suggested by Kompalli ;; (BK01) If FDA grants that people use something x, then x must be either food or drug. ;; Change it to "If object X gets clearance from FDA so that it may be used in people, then object X is food or drug" (assert forall ($x) ant ((build agent *x act (build action (build lex "gets FDA clearance") object (build agent (build lex "Human Being") act (build action (build lex "Use") object *x))))) cq (build min 1 max 2 arg ((build member *x class (build lex "Food")) (build member *x class (build lex "Drug"))))) (m6!) CPU time : 0.01 * ;; (BK02) Child is a subclass of human_being. (assert subclass (build lex "Child") superclass (build lex "Human Being")) (m8!) CPU time : 0.00 * ;; (BK10) Alleviate is equivalent to relieve. ;(describe (assert equiv((build lex "Alleviate") (build lex "Relieve")))) (describe (assert forall(#anAgent1 #anObject1) ant (build agent *anAgent1 act (build lex "Alleviate") object *anObject1) cq (build agent *anAgent1 act (build lex "Relieve") object *anObject1))) (m13! (forall b2 b1) (ant (m10 (act (m9 (lex Alleviate))) (agent b1) (object b2))) (cq (m12 (act (m11 (lex Relieve))) (agent b1) (object b2)))) (m13!) CPU time : 0.00 * ; CASSIE READS THE PASSAGE: ; ========================= ;; Alternate content proposed by Kompalli: ;; (a) Relief is available for the anxiety children suffer when ;; undergoing difficult medical procedures or facing surgery. ;; The fact that Versed relieves emotion is given as a separate clasue since ;; Versed also relieves emotion when children are not being operated on. (describe (assert forall (#some_emotion #a_child) &ant (build member *a_child class (build lex "Child")) &ant (build member *some_emotion class (build lex "Anxiety")) ant ((build agent *a_child act (build action (build lex "Face") object (build lex "Surgery"))) (build agent *a_child act (build action (build lex "Face") object (build lex "Difficult Medical Procedure")))) cq ((build agent *a_child act (build action (build lex "Suffer") object (*some_emotion)))))) (m27! (forall b4 b3) (ant (m23 (act (m22 (action (m17 (lex Face))) (object (m21 (lex Difficult Medical Procedure))))) (agent b4)) (m20 (act (m19 (action (m17)) (object (m18 (lex Surgery))))) (agent b4))) (&ant (m16 (class (m15 (lex Anxiety))) (member b3)) (m14 (class (m7 (lex Child))) (member b4))) (cq (m26 (act (m25 (action (m24 (lex Suffer))) (object b3))) (agent b4)))) (m27!) CPU time : 0.01 * (describe (assert agent (build lex "Versed") act (build action (build lex "Relieve") object (*some_emotion)))) (m30! (act (m29 (action (m11 (lex Relieve))) (object b3))) (agent (m28 (lex Versed)))) (m30!) CPU time : 0.00 * ;; (a) The medication, Versed(R) (midazolam HCl), can be used to calm and sedate children who must ;; undergo procedures such as bone-marrow aspiration or spinal tap. (describe (build member #operating_child class (build lex "Child")) (assert agent (build lex "Versed") act (build action (build lex "Calm") object *operating_child)) (assert agent *operating_child act (build action (build lex "Undergo") object (build lex "Bone Marrow Aspiration")))) (m38! (act (m37 (action (m35 (lex Undergo))) (object (m36 (lex Bone Marrow Aspiration))))) (agent b5)) (m34! (act (m33 (action (m32 (lex Calm))) (object b5))) (agent (m28 (lex Versed)))) (m38! m34!) CPU time : 0.01 * ;; (b) The U.S. Food and Drug Administration (FDA) granted marketing ;; clearance today to a sedative for use in children. (describe (assert agent (build lex "Versed") act (build action (build lex "gets FDA clearance") object (build agent (build lex "Child") act (build action (build lex "Use") object (build lex "Versed")))))) (m42! (act (m41 (action (m1 (lex gets FDA clearance))) (object (m40 (act (m39 (action (m3 (lex Use))) (object (m28 (lex Versed))))) (agent (m7 (lex Child))))))) (agent (m28))) (m42!) CPU time : 0.00 * ; as well as to allow the child to forget what happened during the period of sedation; ; Not the best way to represent this. (describe (assert agent (build lex "Versed") act (build action (build lex "Allows") object (build agent (build lex "Child") act (build action (build lex "Forget") object (build lex "Sedation")))))) (m49! (act (m48 (action (m43 (lex Allows))) (object (m47 (act (m46 (action (m44 (lex Forget))) (object (m45 (lex Sedation))))) (agent (m7 (lex Child))))))) (agent (m28 (lex Versed)))) (m49!) CPU time : 0.01 * ;; (o) Versed is a drug. (describe (assert member (build lex "Versed") class (build lex "Drug"))) (m50! (class (m5 (lex Drug))) (member (m28 (lex Versed)))) (m50!) CPU time : 0.00 * ;; (q) Versed is a sedative. (describe (assert member (build lex "Versed") class (build lex "Sedative"))) (m52! (class (m51 (lex Sedative))) (member (m28 (lex Versed)))) (m52!) CPU time : 0.00 * ;; (r1) It can be used as a light sedative to help alleviate a child's anxiety. (describe (assert agent (build lex "Versed") act (build action (build lex "Alleviate") object (build lex "Anxiety")))) (m54! (act (m53 (action (m9 (lex Alleviate))) (object (m15 (lex Anxiety))))) (agent (m28 (lex Versed)))) (m54!) CPU time : 0.00 * ^( --> defineNoun "Sedative") Definition of Sedative: Possible Class Inclusions: Drug, Possible Actions: Allows m47, Calm b5, Relieve b3, Alleviate Anxiety, gets FDA clearance m40, nil