: demo "term_project_demo.txt" File /home/unmdue/zhaomoya/term_project_demo.txt is now the source of input. CPU time : 0.01 : ; ======================================================================= ; FILENAME: zhaomo-comport-demo.txt ; DATE: March 2 ; PROGRAMMER: Zhaomo Yang CPU time : 0.00 : ;; this template version: ;; http://www.cse.buffalo.edu/~rapaport/CVA/snepslog-template-2006114.demo CPU time : 0.00 : ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; Lines beginning with "%" are SNePSUL commands. ; All other lines are SNePSLOG commands. ; ; To use this file: run SNePSLOG; at the SNePSLOG prompt (:), type: ; ; demo "term_project_demo.txt" av ; ; Make sure all necessary files are in the current working directory ; or else use full path names. ; ======================================================================= CPU time : 0.00 : ; Set SNePSLOG mode = 3 set-mode-3 Net reset In SNePSLOG Mode 3. Use define-frame . achieve(x1) will be represented by {, } ActPlan(x1, x2) will be represented by {, } believe(x1) will be represented by {, } disbelieve(x1) will be represented by {, } adopt(x1) will be represented by {, } unadopt(x1) will be represented by {, } do-all(x1) will be represented by {, } do-one(x1) will be represented by {, } Effect(x1, x2) will be represented by {, } else(x1) will be represented by {} GoalPlan(x1, x2) will be represented by {, } if(x1, x2) will be represented by {, } ifdo(x1, x2) will be represented by {, } Precondition(x1, x2) will be represented by {, } snif(x1) will be represented by {, } sniterate(x1) will be represented by {, } snsequence(x1, x2) will be represented by {, , } whendo(x1, x2) will be represented by {, } wheneverdo(x1, x2) will be represented by {, } withall(x1, x2, x3, x4) will be represented by {, , , , } withsome(x1, x2, x3, x4) will be represented by {, , , , } CPU time : 0.00 : CPU time : 0.00 : ; Turn off inference tracing; this is optional. ; If tracing is desired, enter "trace" instead of "untrace": untrace inference Untracing inference. CPU time : 0.00 : CPU time : 0.00 : ; Load the appropriate definition algorithm: ^(cl:load "~/defun_verb_chris_modified.cl") ; Loading /home/unmdue/zhaomoya/defun_verb_chris_modified.cl t CPU time : 0.00 : ^(cl:load "~/DataProcessing_modified.cl") ; Loading /home/unmdue/zhaomoya/DataProcessing_modified.cl t CPU time : 0.01 : ^(cl:load "~/DataCollection_modified.cl") ; Loading /home/unmdue/zhaomoya/DataCollection_modified.cl t CPU time : 0.00 : CPU time : 0.00 : ; Clear the SNePS network: clearkb Knowledge Base Cleared CPU time : 0.00 : CPU time : 0.00 : ; OPTIONAL: ; UNCOMMENT THE FOLLOWING CODE TO TURN FULL FORWARD INFERENCING ON: ; ^(cl:load "/projects/rapaport/CVA/STN2/ff.cl") ; Loading /projects/rapaport/CVA/STN2/ff.cl Warning: broadcast-one-report, :operator was defined in /projects/snwiz/Install/Sneps-2.7.2/snip/fns/nrn-reports.lisp and is now being defined in /projects/rapaport/CVA/STN2/ff.cl t CPU time : 0.01 : CPU time : 0.00 : CPU time : 0.00 : ^(in-package snip) # CPU time : 0.00 : CPU time : 0.00 : ^(defun broadcast-one-report (rep) (let (anysent) (do.chset (ch *OUTGOING-CHANNELS* anysent) (when (isopen.ch ch) (setq anysent (or (try-to-send-report rep ch) anysent))))) nil) snepslog::broadcast-one-report CPU time : 0.00 : CPU time : 0.00 : ^(in-package snepslog) # CPU time : 0.00 : CPU time : 0.00 : ; Load all pre-defined relations: ^(sneps:intext "/projects/rapaport/CVA/verbalgorithm3.1/rels") Loading file /projects/rapaport/CVA/verbalgorithm3.1/rels. act is already defined. action is already defined. object1 is already defined. object2 is already defined. effect is already defined. nil CPU time : 0.02 : CPU time : 0.00 : ; Load all pre-defined path definitions: ^(sneps:intext "/projects/rapaport/CVA/verbalgorithm3.1/paths") Loading file /projects/rapaport/CVA/verbalgorithm3.1/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-) nil CPU time : 0.00 : CPU time : 0.00 : CPU time : 0.00 : ; define frames here: ; ===================== ; (put annotated SNePSLOG code of your defined frames here; ; be sure to include both syntax and semantics) ; (also: be sure to define frames for any paths that you ; will need below!) ; (1) thing-called define-frame thing-called (nil lex) "[lex] is the word of the name of the node" thing-called(x1) will be represented by {} CPU time : 0.00 : ; (2) Named define-frame Named (nil proper-name object) "[proper-name] is the name of [object]" Named(x1, x2) will be represented by {, } CPU time : 0.00 : ; (3) act-wrt define-frame act-wrt (nil action object) "it is an act whose action is [action] and whose object is [object]" act-wrt(x1, x2) will be represented by {, } CPU time : 0.00 : ; (4) the-action define-frame the-action (nil action) the-action(x1) will be represented by {} CPU time : 0.00 : ; (5) Does define-frame Does (nil act agent) "[agent] does [act]" Does(x1, x2) will be represented by {, } CPU time : 0.00 : ; (6) Isa-Part-Of define-frame Isa-Part-Of (nil part whole) "[part] is a part of [whole]" Isa-Part-Of(x1, x2) will be represented by {, } CPU time : 0.00 : ; (7) AKO define-frame AKO (nil subclass superclass) "[subclass] is a kind of [superclass]" AKO(x1, x2) will be represented by {, } CPU time : 0.00 : ; (8) Isa define-frame Isa (nil member class) "[member] is a member of [class]" Isa(x1, x2) will be represented by {, } CPU time : 0.00 : ; (9) Is define-frame Is (nil property object) "[object] is [property]" Is(x1, x2) will be represented by {, } CPU time : 0.00 : ; (11) Status define-frame Status (nil object status) "[object] is in [status] now" Status(x1, x2) will be represented by {, } CPU time : 0.00 : ; (12) skolem1 define-frame skolem1 (func arg1 arg2 arg3) "[func] is an action whose arguments are [arg1], [arg2] and [arg3]" skolem1(x1, x2, x3) will be represented by {, , , } CPU time : 0.00 : ; (13) skolem2 define-frame skolem2 (func arg1 arg2 arg3) "[func] is an action whose arguments are [arg1], [arg2] and [arg3]" skolem2(x1, x2, x3) will be represented by {, , , } CPU time : 0.00 : ; (14) skolem3 define-frame skolem3 (func arg1 arg2) "[func] is an action whose arguments are [arg1] and [arg2]" skolem3(x1, x2) will be represented by {, , } CPU time : 0.00 : ; (15) skolem4 define-frame skolem4 (func arg1 arg2) "[func] is an action whose arguments are [arg1] and [arg2]" skolem4(x1, x2) will be represented by {, , } CPU time : 0.00 : CPU time : 0.00 : ; define paths here: ; ===================== ; (put annotated SNePSLOG code for your paths here; ; be sure to include both syntax and semantics; ; consult "/projects/rapaport/CVA/mkb3.CVA/paths/snepslog-paths" ; for the proper syntax and some suggested paths; ; be sure to define frames above for any paths that you need here!) ;;; (1) If a has b as a superclass, and b has c as a superclass, then a has c as a superclass. define-path superclass (or superclass (compose ! superclass (kstar (compose subclass- ! superclass)))) superclass implied by the path (or superclass (compose ! superclass (kstar (compose subclass- ! superclass)))) superclass- implied by the path (or superclass- (compose (kstar (compose superclass- ! subclass)) superclass- !)) CPU time : 0.00 : CPU time : 0.00 : ;;; (2) If a has b as a subclass, and b has c as a subclass, then a has c as a subclass. define-path subclass (or subclass (compose ! subclass (kstar (compose superclass- ! subclass)))) subclass implied by the path (or subclass (compose ! subclass (kstar (compose superclass- ! subclass)))) subclass- implied by the path (or subclass- (compose (kstar (compose subclass- ! superclass)) subclass- !)) CPU time : 0.00 : CPU time : 0.00 : ; BACKGROUND KNOWLEDGE: ; ===================== ; (1) Killing is a kind of doing harm. AKO(thing-called(kill), thing-called("do harm")). wff3!: AKO(thing-called(kill),thing-called(do harm)) CPU time : 0.00 : CPU time : 0.00 : ; (2) If someone blows his brains out, then he kills himself. all(p, a, b)({Does(act-wrt(a, b), p), Isa(a, thing-called("blow out")), Isa(b, thing-called(brain)), Isa-Part-Of(b, p)} &=> {Does(act-wrt(skolem1(p, a, b), p), p), Isa(skolem1(p, a, b), thing-called(kill))}). wff6!: all(b,a,p)({Isa-Part-Of(b,p),Isa(b,thing-called(brain)),Isa(a,thing-called(blow out)),Does(act-wrt(a,b),p)} &=> {Isa(skolem1(p,a,b),thing-called(kill)),Does(act-wrt(skolem1(p,a,b),p),p)}) CPU time : 0.00 : CPU time : 0.00 : ; (3) Tearing is a kind of killing. AKO(thing-called(tear), thing-called("kill")). wff8!: AKO(thing-called(tear),thing-called(kill)) CPU time : 0.00 : CPU time : 0.00 : ; (4) Devouring is a kind of killing. AKO(thing-called(devour), thing-called("kill")). wff10!: AKO(thing-called(devour),thing-called(kill)) CPU time : 0.00 : CPU time : 0.00 : ; (5) If someone sets off on a expedition, then he moves. all(p, a)({Does(the-action(a), p), Isa(a, thing-called("set off expedition"))} &=> {Does(the-action(skolem4(p, a)), p), Isa(skolem4(p, a), thing-called(move))}). wff13!: all(a,p)({Isa(a,thing-called(set off expedition)),Does(the-action(a),p)} &=> {Isa(skolem4(p,a),thing-called(move)),Does(the-action(skolem4(p,a)),p)}) CPU time : 0.00 : CPU time : 0.00 : ; (6) For someone, if one of following three events happens: w1 does a1 to him; w2 does a2 to him; w3 does a3 to him. And a1 is an instance of v1, and a2 is an instance of v1, and a3 is an instance of v2, and v1 is a kind of "kill", v2 is a kind of "kill", then he is in danger. all(w1, w2, w3, a1, a2, a3, p, v1, v2, l)({andor(1, 1){Does(act-wrt(a1, p), w1), Does(act-wrt(a2, p), w2), Does(act-wrt(a3, p), w3)}, Isa(a1, v1), Isa(a2, v1), Isa(a3, v2), AKO(v1, thing-called(kill)), AKO(v2, thing-called(kill))} &=> Status(p, thing-called("in danger"))). wff15!: all(l,v2,v1,p,a3,a2,a1,w3,w2,w1)({AKO(v2,thing-called(kill)),AKO(v1,thing-called(kill)),Isa(a3,v2),Isa(a2,v1),Isa(a1,v1),andor(1,1){Does(act-wrt(a3,p),w3),Does(act-wrt(a2,p),w2),Does(act-wrt(a1,p),w1)}} &=> {Status(p,thing-called(in danger))}) CPU time : 0.00 : CPU time : 0.00 : ; (7) If someone moves and he is in danger now, then he does harm to him self. all(p, a)({Does(the-action(a), p), Isa(a, thing-called(move)), Status(p, thing-called("in danger"))} &=> {Does(act-wrt(skolem3(p, a), p), p), Isa(skolem3(p, a), thing-called("do harm"))}). wff16!: all(a,p)({Status(p,thing-called(in danger)),Isa(a,thing-called(move)),Does(the-action(a),p)} &=> {Isa(skolem3(p,a),thing-called(do harm)),Does(act-wrt(skolem3(p,a),p),p)}) CPU time : 0.00 : CPU time : 0.00 : ; (8) If someone does something which is unworthy, then he does harm to himself. all(p, a, o)({Does(act-wrt(a, o), p), Is(thing-called(unworthy), Does(act-wrt(a, o), p))} &=> {Does(act-wrt(skolem2(p, a, o), p), p), Isa(skolem2(p, a, o), thing-called("do harm"))}). wff18!: all(o,a,p)({Is(thing-called(unworthy),Does(act-wrt(a,o),p)),Does(act-wrt(a,o),p)} &=> {Isa(skolem2(p,a,o),thing-called(do harm)),Does(act-wrt(skolem2(p,a,o),p),p)}) CPU time : 0.00 : CPU time : 0.00 : ; (9) If someone does a1 which is an instance of v1, and he also does a2 which is an instance of v2, and v1 is unknown, then v1 is a kind of v2. all(p, a1, a2, v1, v2)({Does(act-wrt(a1, p), p), Does(act-wrt(a2, p), p), Isa(a1, v1), Isa(a2, v2), Is(thing-called(unknown), v1)} &=> {AKO(v1, v2)}). wff20!: all(v2,v1,a2,a1,p)({Is(thing-called(unknown),v1),Isa(a2,v2),Isa(a1,v1),Does(act-wrt(a2,p),p),Does(act-wrt(a1,p),p)} &=> {AKO(v1,v2)}) CPU time : 0.00 : CPU time : 0.00 : CPU time : 0.00 : ; CASSIE READS THE PASSAGE: ; ========================= ; (1) Bellew comports himself under his disappointment. Named(Bellew, bellew)! wff21!: Named(Bellew,bellew) CPU time : 0.00 : Does(act-wrt(a1, bellew), bellew)! wff25!: Does(the-action(a1),bellew) wff23!: Does(act-wrt(a1,bellew),bellew) wff10!: AKO(thing-called(devour),thing-called(kill)) wff8!: AKO(thing-called(tear),thing-called(kill)) CPU time : 0.10 : Isa(a1, thing-called(comport))! wff37!: Isa(a1,thing-called(comport)) CPU time : 0.01 : Is(thing-called(unknown), thing-called(comport))! wff38!: Is(thing-called(unknown),thing-called(comport)) CPU time : 0.01 : CPU time : 0.00 : ; (2) Bellew blows his brains out. Isa(b, thing-called(brain))! wff39!: Isa(b,thing-called(brain)) CPU time : 0.01 : Isa-Part-Of(b, bellew)! wff40!: Isa-Part-Of(b,bellew) CPU time : 0.01 : Does(act-wrt(a2, b), bellew)! wff44!: Does(the-action(a2),bellew) wff42!: Does(act-wrt(a2,b),bellew) CPU time : 0.01 : Isa(a2, thing-called("blow out"))! wff52!: AKO(thing-called(comport),thing-called(kill)) wff51!: Does(the-action(skolem1(bellew,a2,b)),bellew) wff49!: Isa(skolem1(bellew,a2,b),thing-called(kill)) wff48!: Does(act-wrt(skolem1(bellew,a2,b),bellew),bellew) wff45!: Isa(a2,thing-called(blow out)) CPU time : 0.07 : CPU time : 0.00 : ; (3) Bellew sets off on another of his exploring expeditions, and get himself torn to pieces by lions and tigers, or devoured by alligators Does(the-action(a3), bellew)! wff55!: Does(the-action(a3),bellew) CPU time : 0.01 : Isa(a3, thing-called("set off expedition"))! wff60!: Does(the-action(skolem4(bellew,a3)),bellew) wff58!: Isa(skolem4(bellew,a3),thing-called(move)) wff56!: Isa(a3,thing-called(set off expedition)) CPU time : 0.03 : andor(1, 1){Does(act-wrt(a4, bellew), tiger), Does(act-wrt(a5, bellew), lion), Does(act-wrt(a6, bellew), aligator)}! wff67!: andor(1,1){Does(act-wrt(a6,bellew),aligator),Does(act-wrt(a5,bellew),lion),Does(act-wrt(a4,bellew),tiger)} CPU time : 0.07 : Isa(a4, thing-called(tear))! wff71!: Isa(a4,thing-called(tear)) CPU time : 0.01 : Isa(a5, thing-called(tear))! wff72!: Isa(a5,thing-called(tear)) CPU time : 0.01 : Isa(a6, thing-called(devour))! wff79!: Does(the-action(skolem3(bellew,skolem4(bellew,a3))),bellew) wff77!: Isa(skolem3(bellew,skolem4(bellew,a3)),thing-called(do harm)) wff76!: Does(act-wrt(skolem3(bellew,skolem4(bellew,a3)),bellew),bellew) wff73!: Isa(a6,thing-called(devour)) wff53!: AKO(thing-called(comport),thing-called(do harm)) wff28!: Status(bellew,thing-called(in danger)) CPU time : 0.08 : Isa(tiger, thing-called(tiger))! wff81!: Isa(tiger,thing-called(tiger)) CPU time : 0.01 : Isa(lion, thing-called(lion))! wff83!: Isa(lion,thing-called(lion)) CPU time : 0.02 : Isa(aligator, thing-called(aligator))! wff85!: Isa(aligator,thing-called(aligator)) CPU time : 0.03 : CPU time : 0.00 : ; (4) Bellew marries a young person who is unknown, which is unworthy Does(act-wrt(a7, p1), bellew)! wff89!: Does(the-action(a7),bellew) wff87!: Does(act-wrt(a7,p1),bellew) CPU time : 0.02 : Isa(a7, thing-called(marry))! wff91!: Isa(a7,thing-called(marry)) CPU time : 0.01 : Isa(p1, thing-called(person))! wff93!: Isa(p1,thing-called(person)) CPU time : 0.01 : Is(thing-called(young), p1)! wff95!: Is(thing-called(young),p1) CPU time : 0.01 : Is(thing-called(unknown), p1)! wff96!: Is(thing-called(unknown),p1) CPU time : 0.01 : Is(thing-called(unworthy), Does(act-wrt(a7, p1), bellew))! wff103!: Does(the-action(skolem2(bellew,a7,p1)),bellew) wff101!: Isa(skolem2(bellew,a7,p1),thing-called(do harm)) wff100!: Does(act-wrt(skolem2(bellew,a7,p1),bellew),bellew) wff97!: Is(thing-called(unworthy),Does(act-wrt(a7,p1),bellew)) wff53!: AKO(thing-called(comport),thing-called(do harm)) CPU time : 0.06 : CPU time : 0.00 : ; Ask Cassie what "comport" means: ^(defineVerb 'comport) verb: lex: comport; superclass: do harm; kill; property: unknown; transitivity: (transitive) nil CPU time : 0.04 : End of /home/unmdue/zhaomoya/term_project_demo.txt demonstration. CPU time : 0.73