;; CSE 663: Advanced Knowledge Representation ;; Term Project ;; Contextual Vocabulary Acquisition ;; Verb: 'proliferate' ;; ;; Ananthakrishnan Ugrasenan Santha ;; ;;; ***************************** ;;; PREPARE THE SNePS ENVIRONMENT ;;; ***************************** ; Turn off inference tracing. ; This is optional; if tracing is desired, then delete this. ^(setq snip:*infertrace* nil) ; Load the verb definition algorithm: ^(load "/projects/rapaport/CVA/STN2/defun_verb.cl") ; Clear the SNePS network: (resetnet t) ; 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 (define-path class (compose class (kstar (compose subclass- superclass)))) ;;; ;;; **************************************************** ;;; PASSAGE REPRESENTATION & BACKGROUND KNOWLEDGE/RULES ;;; **************************************************** ;;; ;; Passage for representation: ;; Post-farm food processing, storage, and improper handling and cooking are ;; major contributors to the chain of events that allows the pathogen to ;; contaminate the product, proliferate on or in the food, and attain the ;; large numbers that cause disease. ;; Passage re-written: ;; Post-farm food processing, storage, and improper handling and cooking ;; cause the chain of events that allows the pathogen to ;; contaminate the product, proliferate in the food, and attain the ;; large numbers that cause disease. ;; Define relations ;; object3 is not defined in the default set. (define object3) ;; ******************** ;; ;; BACKGROUND KNOWLEDGE ;; ;; ******************** ;; ;; There is a chain of events called #thecoe that is a member ;; of the class chain of events (describe (assert member #thecoe class (build lex "chain of event") = coes)) ;; There is a product called the product that is a member of the ;; class 'products' (describe (assert member #theproduct class (build lex "product") = products)) ;; There is a food called #thefood that is a member of the ;; class 'foods' (describe (assert member #thefood class (build lex "food") = foods)) ;; "The food" and "the product" refer to the same thing here. (describe (assert equiv #thefood equiv #theproduct)) ;; There is a pathogen called #thepathogen that is a member of the ;; class 'pathogens' (describe (assert member #thepathogen class (build lex "pathogen") = pathogens)) ;; The class 'pathogens' is a sub-class of 'micro-organisms' (describe (assert subclass *pathogens superclass (build lex "micro-organism") = micro-organisms)) ;; ***************** ;; ;; BACKGROUND RULES ;; ;; ***************** ;; ;; "Micro-organisms attain large numbers by multiplying." ;; -> ;; If agent agentX is a member of the class "micro-organisms" ;; and an action of an act agentX performs causes agentX to ;; "attain large numbers", then, ;; that action is equivalent to 'multiply' (describe (assert forall ($agentX $actionA) &ant(build member *agentX class *micro-organisms) &ant (build cause (build agent *agentX act (build action *actionA)) effect (build agent *agentX act (build action (build lex "attain") = attain object (build lex "large numbers")) = attainlargenums)) cq (build equiv *actionA equiv (build lex "multiply") = multiply))) ;; If an agent agentA has performed a sequence of actions, ;; it has performed all of the actions in that sequence. ;; That is, if agentA performs an act where the action is a ;; 'snsequence', then, agentA performs all the actions that ;; make up that sequence and consecutive acts have a ;; cause-effect relation. (describe (assert forall ($agentA $act1 $act2 $act3) ant (build agent *agentA act (build action snsequence object1 (build act *act1) object2 (build act *act2) object3 (build act *act3))) cq (build agent *agentA act *act1) = firstAct cq (build agent *agentA act *act2) = secondAct cq (build agent *agentA act *act3) = thirdAct cq (build cause *firstAct effect *secondAct) cq (build cause *secondAct effect *thirdAct))) ;; *********************** ;; ;; THE PASSAGE REPRESENTED ;; ;; *********************** ;; ;; Post-farm food processing, storage, and improper handling and cooking ;; cause "the chain of events". (describe (add cause ((build lex "post-farm food processing") = fproc (build lex "storage") = storage (build lex "improper handling") = handling (build lex "cooking") = cooking) effect *thecoe)) ;; Assert the lex's for contaminate & proliferate (describe (add lex "contaminate") = contaminate) (describe (add lex "proliferate") = proliferate) ;; "The chain of events" allows the pathogen to contaminate ;; the product, proliferate in the food, and attain the ;; large numbers that cause disease. (describe (add agent *thepathogen act (build action snsequence object1 (build act (build action *contaminate object *theproduct)) object2 (build act (build action *proliferate)) object3 (build act *attainlargenums))) = thesequence) (describe (add cause *thecoe effect *thesequence)) ;; ;; ;; *************************************************************************************** ;; ;; ;; ;; Call the verb definition algorithm ^(defineVerb "proliferate")