; ======================================================================= ; FILENAME: dossiers.demo ; DATE: November 16 2004 ; PROGRAMMER: Pejus Das ;; 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 "dossier.demo" :av) ; ; Make sure all necessary files are in the current working directory ; or else use full path names. The necessary files are "dossier.demo", "defun_noun.cl" ; ======================================================================= ; ; Turn off inference tracing. ; This is optional; if tracing is desired, then delete this. ^(setq snip:*infertrace* nil) ; Load the appropriate definition algorithm: ; the noun algorithm has been modified to include the subclass superclass case frame to ; deduce the meaning of unknown word ^(load "~/public_html/2004fall/cse740/defun_noun.cl") ; Clear the SNePS network: (resetnet t) ; OPTIONAL: ; UNCOMMENT THE FOLLOWING CODE TO TURN FULL FORWARD INFERENCING ON: ; full forward inferencing is turned on. Hence the code has been uncommented. ;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") ; BACKGROUND KNOWLEDGE: ; ===================== ; this section describes the background knowledge necessary to infer the meaning of the unknown word. ; the following is a rule asserting that if x is filled with y then x contains y. (describe (assert forall ($x $y) ant(build object1 *x rel (build lex filled-with) = filled-with-concept object2 *y) cq (build object1 *x rel (build lex contains) = contains-concept object2 *y))) ; the following is a rule asserting that if y contains x and y contains z and z has the property unknown ; then z is subclass of superclass x. one of those weird rules. :). (describe (assert forall ($x $y $z) &ant (build object1 *y rel (build lex contains) = contains-concept object2 *x) &ant (build object1 *y rel *contains-concept object2 *z) &ant (build object *z property (build lex unknown) = unknown-concept) cq (build superclass *x subclass *z))) ; this asserts that there is something (archive) called as Archives (describe (add subclass #archives superclass (build lex archives) = archives-concept)) ; the following rule asserts the background knowledge that archives ; contain documents. This references "archives" defined above (describe (assert object1 *archives rel *contains-concept object2 (build lex documents))) ;asserts the background knowledge that if x details y then x gives information about y. (describe (assert forall ($x $y) ant (build agent *x act (build action (build lex detail) = detail-concept object *y)) cq (build agent *x act (build action (build lex provides\ information\ about) object *y)))) ; CASSIE READS THE PASSAGE: ; ========================= ; the following adds the passage in which the unknown word appears to cassie's knowledge base ; the following adds that there is something (med-dept) called Medical Department (show (add member #med-dept class (build lex Medical\ Department) = med-dept-concept)) ; the following adds that there is something (lourdes) called Lourdes (show (add object #lourdes proper-name lourdes)) ; the following rule adds "the medical department of lourdes" (show (add object *med-dept rel *med-dept-concept possessor *lourdes)) ; the following adds that there is something (dossier) called Dossiers (show (add subclass #dossiers superclass (build lex dossiers) = dossiers-concept)) ; adds that dossier have property unknown (show (add object *dossiers-concept property *unknown-concept)) ; adds dossiers as member of class of dossiers (show (add member *dossiers class (build lex dossier) = dossier-concept)) ; adds that the archive are filled with dossiers (show (add object1 *archives rel *filled-with-concept object2 *dossiers-concept)) ; adds that the archives belong to the medical departments (show (add object *archives rel *archives-concept possessor *med-dept)) ; adds that there is something (#well-auth-cases) called well-auth-cases (show (add subclass #well-auth-cases superclass (build lex well-auth-cases) = well-auth-cases-concept)) ; adds that dossiers detail well-authenticated cases (show (add agent *dossiers act (build action *detail-concept object *well-auth-cases))) ; adds that well authenticated cases are a subclass of cases (show (add subclass *well-auth-cases superclass (build lex cases) = cases-concept)) ; display the entire network (describe *nodes) ; Ask Cassie what "WORD" means: ;============================= ^(defineNoun "dossiers") --------------040102050503060007030808--