* ; ======================================================================= ; 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) nil CPU time : 0.00 * ; Clear the SNePS network: (resetnet t) Net reset CPU time : 0.00 * ; 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") Loading file /projects/rapaport/CVA/STN2/demos/rels. CPU time : 0.01 * ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") Loading file /projects/rapaport/CVA/mkb3.CVA/paths/paths. before implied by the path (compose before (kstar (compose after- ! before))) before- implied by the path (compose (kstar (compose before- ! after)) before-) after implied by the path (compose after (kstar (compose before- ! after))) after- implied by the path (compose (kstar (compose after- ! before)) after-) sub1 implied by the path (compose object1- superclass- ! subclass superclass- ! subclass) sub1- implied by the path (compose subclass- ! superclass subclass- ! superclass object1) super1 implied by the path (compose superclass subclass- ! superclass object1- ! object2) super1- implied by the path (compose object2- ! object1 superclass- ! subclass superclass-) superclass implied by the path (or superclass super1) superclass- implied by the path (or superclass- super1-) CPU time : 0.00 * ; 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)))) (m4! (forall v3 v2 v1) (&ant (p4 (class (m3 (lex plants))) (member v3)) (p3 (class (m2 (lex better garden))) (member v2)) (p2 (act (p1 (action (m1 (lex wants))) (object v2))) (agent v1))) (cq (p6 (act (p5 (action (m1)) (object v3))) (agent v1)))) (m4!) CPU time : 0.00 * ;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)))))) (m6! (forall v8 v7 v6 v5 v4) (&ant (p11 (object v7) (property (m5 (lex unknown)))) (p10 (object v6) (property v7)) (p9 (class v8) (member v6)) (p8 (object v4) (property v5)) (p7 (class v8) (member v4))) (cq (p16 (forall v9) (ant (p12 (class v8) (member v9))) (cq (p15 (min 1) (max 1) (arg (p14 (object v9) (property v7)) (p13 (object v9) (property v5)))))))) (m6!) CPU time : 0.00 * ;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)))))) (m11! (ant (m9 (forall v10) (ant (p17 (class (m3 (lex plants))) (member v10))) (cq (p20 (min 1) (max 1) (arg (p19 (object v10) (property (m8 (lex xeric)))) (p18 (object v10) (property (m7 (lex native))))))))) (cq (m10 (forall v11) (ant (p21 (object v11) (property (m8)))) (cq (p23 (min 0) (max 0) (arg (p22 (object v11) (property (m7))))))))) (m11!) CPU time : 0.00 * ; CASSIE READS THE PASSAGE: ; ========================= ; Greg wants a better garden. (describe (add agent #greg act (build action (build lex wants) object #bg))) (m13! (act (m12 (action (m1 (lex wants))) (object b2))) (agent b1)) (m13!) CPU time : 0.00 * ;*greg is Greg (describe (add object *greg proper-name (build lex Greg))) (m17! (object b1) (proper-name (m16 (lex Greg)))) (m17!) CPU time : 0.00 * ;*bg is a better garden (describe (add member *bg class (build lex "better garden"))) (m14! (class (m2 (lex better garden))) (member b2)) (m14!) CPU time : 0.00 * ;There are native plants. ;1. It's native. (describe (add object #nplant property (build lex native))) (m18! (object b3) (property (m7 (lex native)))) (m14! (class (m2 (lex better garden))) (member b2)) (m18! m14!) CPU time : 0.03 * ;2. It's plant. (describe (add member *nplant class (build lex plants))) (m31! (act (m30 (action (m1 (lex wants))) (object b3))) (agent b1)) (m23! (class (m3 (lex plants))) (member b3)) (m31! m23!) CPU time : 0.00 * ;There are xeric plants. ;1. It's xeric. (describe (add object #xplant property (build lex xeric))) (m32! (object b4) (property (m8 (lex xeric)))) (m32!) CPU time : 0.00 * ;2. It's plant. (describe (add member *xplant class (build lex plants))) (m35! (act (m34 (action (m1 (lex wants))) (object b4))) (agent b1)) (m33! (class (m3 (lex plants))) (member b4)) (m35! m33!) CPU time : 0.01 * ;Xeric plants is unknown. (describe (add object (build lex xeric) property (build lex unknown))) (m43! (min 0) (max 0) (arg (m40 (object b3) (property (m8 (lex xeric)))))) (m42! (min 0) (max 0) (arg (m38 (object b4) (property (m7 (lex native)))))) (m41! (min 1) (max 1) (arg (m40) (m18! (object b3) (property (m7))))) (m39! (min 1) (max 1) (arg (m38) (m32! (object b4) (property (m8))))) (m33! (class (m3 (lex plants))) (member b4)) (m28! (object (m8)) (property (m5 (lex unknown)))) (m26! (forall v9) (ant (p26 (class (m3)) (member v9))) (cq (p35 (min 1) (max 1) (arg (p34 (object v9) (property (m8))) (p33 (object v9) (property (m7))))))) (m23! (class (m3)) (member b3)) (m10! (forall v11) (ant (p21 (object v11) (property (m8)))) (cq (p23 (min 0) (max 0) (arg (p22 (object v11) (property (m7))))))) (m43! m42! m41! m39! m33! m32! m28! m26! m23! m18! m10!) CPU time : 0.03 * ; Ask Cassie what "WORD" means: End of /home/cendue/song4/cva/X2.demo demonstration. CPU time : 0.08