; ======================================================================= ; FILENAME: Xeric.demo ; DATE: April 16.2011 ; PROGRAMMER: Yalei Song ;; this template version: snepsul-template.demo-20061005.txt ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; All other lines are SNePSUL commands. ; ; To use this file: run SNePS; at the SNePS prompt (*), type: ; ; (demo "Xeric.demo" :av) ; ; Make sure all necessary files are in the current working directory ; or else use full path names. ; ======================================================================= ; Turn off inference tracing. ; This is optional; if tracing is desired, then delete this. ^(setq snip:*infertrace* nil) ; 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: ; NB: If "intext" causes a "nil not of expected type" error, ; then comment-out the "intext" command and then ; uncomment & use the load command below, instead ;^(load "/projects/rapaport/CVA/STN2/demos/rels") (intext "/projects/rapaport/CVA/STN2/demos/rels") ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ; BACKGROUND KNOWLEDGE: ; ===================== ;If Greg wants a better garden, he wants plants. (describe (assert forall ($p $g $pl) &ant (build agent *p act (build action (build lex wants) object *g)) &ant (build member *g class (build lex "better garden")) &ant (build member *pl class (build lex plants)) cq (build agent *p act (build action (build lex wants) object *pl)))) ;If x is a member of class S, and has property N; If y is a member of class S, and has property X; X is unknown. Then if z is a member of class S, it has property N xor X. (describe (assert forall ($x $N $y $X $S) &ant (build member *x class *S) &ant (build object *x property *N) &ant (build member *y class *S) &ant (build object *y property *X) &ant (build object *X property (build lex unknown)) cq (build forall $z ant (build member *z class *S) cq (build min 1 max 1 arg ((build object *z property *N) (build object *z property *X)))))) ;If that if z is a member of class plants, then z is native xor xeric; then that if z is xeric, then it's not the case that it is native. (describe (assert ant (build forall ($z) ant (build member *z class (build lex plants)) cq (build min 1 max 1 arg (build object *z property (build lex native)) arg (build object *z property (build lex xeric)))) cq (build forall ($z) ant (build object *z property (build lex xeric)) cq (build min 0 max 0 arg (build object *z property (build lex native)))))) ; CASSIE READS THE PASSAGE: ; ========================= ; Greg wants a better garden. (describe (add agent #greg act (build action (build lex wants) object #bg))) ;*greg is Greg (describe (add object *greg proper-name (build lex Greg))) ;*bg is a better garden (describe (add member *bg class (build lex "better garden"))) ;There are native plants. ;1. It's native. (describe (add object #nplant property (build lex native))) ;2. It's plant. (describe (add member *nplant class (build lex plants))) ;There are xeric plants. ;1. It's xeric. (describe (add object #xplant property (build lex xeric))) ;2. It's plant. (describe (add member *xplant class (build lex plants))) ;Xeric plants is unknown. (describe (add object (build lex xeric) property (build lex unknown))) ; Ask Cassie what "WORD" means: