/Sneps-Linux-Exe-2.7.1$ ./sneps.sh International Allegro CL Enterprise Edition 8.2 [Linux (x86)] (Sep 16, 2010 13:53) Copyright (C) 1985-2010, Franz Inc., Oakland, CA, USA. All Rights Reserved. This standard runtime copy of Allegro CL was built by: [4549] University at Buffalo ;;--- ;; Current reader case mode: :case-sensitive-lower SNePS-2.7 [PL:1 2009/03/24 14:53:32] loaded. Type `(sneps)' or `(snepslog)' to get started. cl-user(1): (sneps) Welcome to SNePS-2.7 [PL:1 2009/03/24 14:53:32] Copyright (C) 1984--2007 by Research Foundation of State University of New York. SNePS comes with ABSOLUTELY NO WARRANTY! Type `(copyright)' for detailed copyright information. Type `(demo)' for a list of example applications. 5/12/2011 13:13:46 * (demo "demo/CVA/rfdoell-GNOMIC-demo.txt") File CVA/rfdoell-GNOMIC-demo.txt is now the source of input. CPU time : 0.00 * ; ======================================================================= ; FILENAME: gnomic-demo.txt ; DATE: 5_12_11 ; PROGRAMMER: Richard Doell ; 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 "rdfoell-GNOMIC-demo.txt" :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 * ;Using a custom 'algorithm' for adjective ; 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) # CPU time : 0.00 * ; Leave ffi off ; ^(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) # CPU time : 0.00 * ; 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") t CPU time : 0.01 * ;(intext "/projects/rapaport/CVA/STN2/demos/rels") ; load all pre-defined path definitions: ;(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ^( --> load "/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-) t CPU time : 0.00 * ; Define a 'similar' arc to avoid problems with synonym semantics (define similar) (similar) CPU time : 0.00 * ;this should define a path between asserted similar arcs (define-path (similar- ! similar)) CPU time : 0.00 * ; BACKGROUND KNOWLEDGE: ; ===================== ; (put annotated SNePSUL code of your background knowledge here) ;Putting in some of the similars for enigmatic, using thesaurus.com and ; the Merriam-Webster online thesaurus (describe (assert similar (build lex "enigmatic") similar (build lex "ambiguous") similar (build lex "arcane") similar (build lex "cryptic") similar (build lex "dark") similar (build lex "incomprehensible") similar (build lex "obscure") similar (build lex "occult") similar (build lex "perplexing") similar (build lex "puzzling") similar (build lex "mysterious"))) (m12! (similar (m11 (lex mysterious)) (m10 (lex puzzling)) (m9 (lex perplexing)) (m8 (lex occult)) (m7 (lex obscure)) (m6 (lex incomprehensible)) (m5 (lex dark)) (m4 (lex cryptic)) (m3 (lex arcane)) (m2 (lex ambiguous)) (m1 (lex enigmatic)))) (m12!) CPU time : 0.02 * ;Same, only for fragmentary ; Interestingly, fragmentary is the only one which has no similars among ; the other words (describe (assert similar (build lex "fragmentary") similar (build lex "broken") similar (build lex "incomplete") similar (build lex "disconnected") similar (build lex "incoherent") similar (build lex "partial"))) (m19! (similar (m18 (lex partial)) (m17 (lex incoherent)) (m16 (lex disconnected)) (m15 (lex incomplete)) (m14 (lex broken)) (m13 (lex fragmentary)))) (m19!) CPU time : 0.00 * ;Now elusive (describe (assert similar (build lex "elusive") similar (build lex "evasive") similar (build lex "deceptive") similar (build lex "mysterious") similar (build lex "ambiguous") similar (build lex "incomprehensible") similar (build lex "indefinable") similar (build lex "insubstantial") similar *occult similar (build lex "puzzling"))) (m25! (similar (m24 (lex insubstantial)) (m23 (lex indefinable)) (m22 (lex deceptive)) (m21 (lex evasive)) (m20 (lex elusive)) (m11 (lex mysterious)) (m10 (lex puzzling)) (m6 (lex incomprehensible)) (m2 (lex ambiguous)))) (m25!) CPU time : 0.00 * ;Finally mystical (describe (assert similar (build lex "mystical") similar *occult similar (build lex "arcane") similar (build lex "cryptic") similar (build lex "esoteric"))) (m28! (similar (m27 (lex esoteric)) (m26 (lex mystical)) (m4 (lex cryptic)) (m3 (lex arcane)))) (m28!) CPU time : 0.00 * ;Say that all the properties that directly describe the diary are mental concepts, things which are characteristics given ; by humans to things, ideas about things which don't exist outside the mind (giving a partial allowance to fragmentary for now, ; also using the 'sense' of elusive and fragmentary which are more 'inside the mind' than not): (describe (assert member ((build lex mystical) (build lex elusive) (build lex fragmentary) (build lex enigmatic)) class (build lex mental))) (m30! (class (m29 (lex mental))) (member (m26 (lex mystical)) (m20 (lex elusive)) (m13 (lex fragmentary)) (m1 (lex enigmatic)))) (m30!) CPU time : 0.00 * ;Now say that mental ideas are subclasses of the intensional group of things (describe (assert subclass (build lex mental) superclass (build lex intensional))) (m32! (subclass (m29 (lex mental))) (superclass (m31 (lex intensional)))) (m32!) CPU time : 0.01 * ; This will take care of the extensional or intensional categorization ; that was used in previous demos as two split rules, instead; this ; follows any/all subclass/superclass paths and says that if four things ; all have the same superclass, then the fifth thing is a member of that ; class. This will be used with the subclass/superclass assertion above ; to say that gnomic is 'intensional' because it is a superclass of the ; idea of mental concepts/ideas, of which fragmentary, elusive, mystical ; and enigmatic are members of. (describe (assert forall ($w $x $y $z $p $q $c) &ant( (build member *p class unknown) (build object *q property *w) (build object *q property *x) (build object *q property *y) (build object *q property *z) (build object *q property *p) (build subclass ((find (class- member) *w) (find (class- member) *x) (find (class- member) *y) (find (class- member) *z)) superclass (build lex *c))) cq (build member *p class (build lex *c)))) (m33! (forall v7 v6 v5 v4 v3 v2 v1) (&ant (p8 (superclass (p7 (lex v7)))) (p6 (object v6) (property v5)) (p5 (object v6) (property v4)) (p4 (object v6) (property v3)) (p3 (object v6) (property v2)) (p2 (object v6) (property v1)) (p1 (class unknown) (member v5))) (cq (p9 (class (p7)) (member v5)))) (m33!) CPU time : 0.00 * ; This is a slightly modified rule of the above, which says that if ; the adjectives are all of the same category, the unknown one is ; also in that category. (describe (assert forall ($w $x $y $z $s $p $q) &ant( (build member *p class unknown) (build object *q property *w) (build object *q property *x) (build object *q property *y) (build object *q property *z) (build object *q property *p) (build member (*w *x *y *z) class *s)) cq (build member *p class *s ))) (m34! (forall v14 v13 v12 v11 v10 v9 v8) (&ant (p16 (class v12) (member v11 v10 v9 v8)) (p15 (object v14) (property v13)) (p14 (object v14) (property v11)) (p13 (object v14) (property v10)) (p12 (object v14) (property v9)) (p11 (object v14) (property v8)) (p10 (class unknown) (member v13))) (cq (p17 (class v12) (member v13)))) (m34!) CPU time : 0.00 * ; The idea for the following series of rules is as follows: ; If four words have something in common, then the fifth has ; that word in common. ; This rule states that if an object has four properties, and they ; all have a similar word to each of them, then the unknown word, the ; fifth property, is also similar to that word. (describe (assert forall ($w $x $y $z $p $q) &ant( ; The properties all describe the same object ; Note: it's not actually possible to have all of these in one line- ; the original node which built them had to have the form of all arcs ; to one set. (build object *q property *p) (build object *q property *w) (build object *q property *x) (build object *q property *y) (build object *q property *z) ; p is unknown (build member *p class unknown)) cq ( build forall $s ; The main properties all share a similar word &ant( (build similar *w similar *s) (build similar *x similar *s) (build similar *y similar *s) (build similar *z similar *s)) cq (build similar *s similar *p)))) (m35! (forall v20 v19 v18 v17 v16 v15) (&ant (p23 (class unknown) (member v19)) (p22 (object v20) (property v18)) (p21 (object v20) (property v17)) (p20 (object v20) (property v16)) (p19 (object v20) (property v15)) (p18 (object v20) (property v19))) (cq (p29 (forall v21) (&ant (p27 (similar v21 v18)) (p26 (similar v21 v17)) (p25 (similar v21 v16)) (p24 (similar v21 v15))) (cq (p28 (similar v21 v19)))))) (m35!) CPU time : 0.00 * ; This rule states that if an object has three properties, and they ; all have a similar word to each of them, then the unknown word, the ; fourth property, is also similar to that word. (describe (assert forall ($x $y $z $p $q) &ant( ; The properties all describe the same object (build object *q property *p) (build object *q property *x) (build object *q property *y) (build object *q property *z) ; p is unknown (build member *p class unknown)) cq ( build forall $s ; The main properties all share a similar word &ant( (build similar *x similar *s) (build similar *y similar *s) (build similar *z similar *s)) cq (build similar *s similar *p)))) (m36! (forall v26 v25 v24 v23 v22) (&ant (p34 (class unknown) (member v25)) (p33 (object v26) (property v24)) (p32 (object v26) (property v23)) (p31 (object v26) (property v22)) (p30 (object v26) (property v25))) (cq (p39 (forall v27) (&ant (p37 (similar v27 v24)) (p36 (similar v27 v23)) (p35 (similar v27 v22))) (cq (p38 (similar v27 v25)))))) (m36!) CPU time : 0.00 * ; This rule states that if an object has two properties, and they ; all have a similar word to each of them, then the unknown word, the ; third property, is also similar to that word. (describe (assert forall ($x $y $p $q) &ant( ; The properties all describe the same object (build object *q property *p) (build object *q property *x) (build object *q property *y) ; p is unknown (build member *p class unknown)) cq ( build forall $s ; The main properties all share a similar word &ant( (build similar *x similar *s) (build similar *y similar *s)) ;(build similar *z similar *s)) cq (build similar *s similar *p)))) (m37! (forall v31 v30 v29 v28) (&ant (p43 (class unknown) (member v30)) (p42 (object v31) (property v29)) (p41 (object v31) (property v28)) (p40 (object v31) (property v30))) (cq (p47 (forall v32) (&ant (p45 (similar v32 v29)) (p44 (similar v32 v28))) (cq (p46 (similar v32 v30)))))) (m37!) CPU time : 0.00 * ; CASSIE READS THE PASSAGE: ; ========================= ; (put annotated SNePSUL code of the passage here) ; Post has a proper name of 'Post' (describe (add object #Post proper-name (build lex "Post"))) (m39! (object b1) (proper-name (m38 (lex Post)))) (m39!) CPU time : 0.01 * ; A diary is owned by Post (describe (add object #diary rel (build lex "diary") possessor *Post)) (m41! (object b2) (possessor b1) (rel (m40 (lex diary)))) (m41!) CPU time : 0.00 * ; The diary is a diary (describe (add member *diary class (build lex "diary"))) (m42! (class (m40 (lex diary))) (member b2)) (m42!) CPU time : 0.00 * ; The diary is enigmatic (describe (add object *diary property (build lex "enigmatic"))) (m46! (superclass (m31 (lex intensional)))) (m43! (object b2) (property (m1 (lex enigmatic)))) (m30! (class (m29 (lex mental))) (member (m26 (lex mystical)) (m20 (lex elusive)) (m13 (lex fragmentary)) (m1))) (m46! m43! m30!) CPU time : 0.24 * ; The diary is fragmentary (describe (add object *diary property (build lex "fragmentary"))) (m47! (object b2) (property (m13 (lex fragmentary)))) (m47!) CPU time : 0.07 * ; The diary is elusive (describe (add object *diary property (build lex "elusive"))) (m48! (object b2) (property (m20 (lex elusive)))) (m48!) CPU time : 0.07 * ; The diary is mystical (describe (add object *diary property (build lex "mystical"))) (m49! (object b2) (property (m26 (lex mystical)))) (m49!) CPU time : 0.07 * ;The diary is 'gnomic,' which is a member of the ; class of unknown things (describe (add object *diary property (build lex "gnomic"))) (m51! (object b2) (property (m50 (lex gnomic)))) (m51!) CPU time : 0.07 * ; Saying that the word gnomic is unknown (describe (add member (build lex "gnomic") class unknown)) (m158! (forall v32) (&ant (p97 (similar v32 (m20 (lex elusive)))) (p95 (similar v32 (m26 (lex mystical))))) (cq (p96 (similar (m50 (lex gnomic)) v32)))) (m157! (forall v32) (&ant (p98 (similar v32 (m13 (lex fragmentary)))) (p95)) (cq (p96))) (m156! (forall v32) (&ant (p98) (p97)) (cq (p96))) (m155! (forall v27) (&ant (p93 (similar v27 (m13))) (p91 (similar v27 (m20))) (p90 (similar v27 (m26)))) (cq (p92 (similar (m50) v27)))) (m148! (similar (m27 (lex esoteric)) (m3 (lex arcane)))) (m147! (similar (m27) (m4 (lex cryptic)))) (m146! (similar (m3) (m2 (lex ambiguous)))) (m145! (similar (m5 (lex dark)) (m3))) (m144! (similar (m6 (lex incomprehensible)) (m3))) (m143! (similar (m7 (lex obscure)) (m3))) (m142! (similar (m8 (lex occult)) (m3))) (m141! (similar (m9 (lex perplexing)) (m3))) (m140! (similar (m10 (lex puzzling)) (m3))) (m139! (similar (m11 (lex mysterious)) (m3))) (m138! (similar (m4) (m2))) (m137! (similar (m4) (m3))) (m136! (similar (m5) (m4))) (m135! (similar (m6) (m4))) (m134! (similar (m7) (m4))) (m133! (similar (m8) (m4))) (m132! (similar (m9) (m4))) (m131! (similar (m10) (m4))) (m130! (similar (m11) (m4))) (m121! (similar (m50) (m2))) (m120! (similar (m50) (m11))) (m119! (similar (m50) (m6))) (m118! (similar (m50) (m10))) (m117! (similar (m20) (m2))) (m116! (similar (m20) (m6))) (m115! (similar (m20) (m10))) (m114! (similar (m20) (m11))) (m113! (similar (m21 (lex evasive)) (m20))) (m112! (similar (m22 (lex deceptive)) (m20))) (m111! (similar (m23 (lex indefinable)) (m20))) (m110! (similar (m24 (lex insubstantial)) (m20))) (m109! (similar (m50) (m3))) (m108! (similar (m50) (m4))) (m107! (similar (m26) (m3))) (m106! (similar (m26) (m4))) (m105! (similar (m27) (m26))) (m104! (similar (m14 (lex broken)) (m13))) (m103! (similar (m15 (lex incomplete)) (m13))) (m102! (similar (m16 (lex disconnected)) (m13))) (m101! (similar (m17 (lex incoherent)) (m13))) (m100! (similar (m18 (lex partial)) (m13))) (m99! (similar (m2) (m1 (lex enigmatic)))) (m98! (similar (m3) (m1))) (m97! (similar (m4) (m1))) (m96! (similar (m5) (m1))) (m95! (similar (m6) (m1))) (m94! (similar (m7) (m1))) (m93! (similar (m8) (m1))) (m92! (similar (m9) (m1))) (m91! (similar (m10) (m1))) (m90! (similar (m11) (m1))) (m61! (forall v32) (&ant (p98) (p94 (similar v32 (m1)))) (cq (p96))) (m60! (forall v32) (&ant (p97) (p94)) (cq (p96))) (m59! (forall v32) (&ant (p95) (p94)) (cq (p96))) (m58! (forall v27) (&ant (p93) (p91) (p89 (similar v27 (m1)))) (cq (p92))) (m57! (forall v27) (&ant (p93) (p90) (p89)) (cq (p92))) (m56! (forall v27) (&ant (p91) (p90) (p89)) (cq (p92))) (m55! (forall v21) (&ant (p87 (similar v21 (m20))) (p86 (similar v21 (m13))) (p85 (similar v21 (m26))) (p84 (similar v21 (m1)))) (cq (p88 (similar (m50) v21)))) (m54! (class (m29 (lex mental))) (member (m50))) (m53! (class (m31 (lex intensional))) (member (m50))) (m52! (class unknown) (member (m50))) (m51! (object b2) (property (m50))) (m49! (object b2) (property (m26))) (m48! (object b2) (property (m20))) (m47! (object b2) (property (m13))) (m43! (object b2) (property (m1))) (m158! m157! m156! m155! m148! m147! m146! m145! m144! m143! m142! m141! m140! m139! m138! m137! m136! m135! m134! m133! m132! m131! m130! m121! m120! m119! m118! m117! m116! m115! m114! m113! m112! m111! m110! m109! m108! m107! m106! m105! m104! m103! m102! m101! m100! m99! m98! m97! m96! m95! m94! m93! m92! m91! m90! m61! m60! m59! m58! m57! m56! m55! m54! m53! m52! m51! m49! m48! m47! m43!) CPU time : 5.49 * ; Ask Cassie what "gnomic" means: ;First, ask what classes gnomic is in: (describe (find (class- ! member) (build lex gnomic))) (m29 (lex mental)) (m31 (lex intensional)) (unknown) (m29 m31 unknown) CPU time : 0.00 * ; Then, get the words which are 'similar' to it: (describe (findassert similar (build lex gnomic))) (m108! (similar (m50 (lex gnomic)) (m4 (lex cryptic)))) (m109! (similar (m50) (m3 (lex arcane)))) (m118! (similar (m50) (m10 (lex puzzling)))) (m119! (similar (m50) (m6 (lex incomprehensible)))) (m120! (similar (m50) (m11 (lex mysterious)))) (m121! (similar (m50) (m2 (lex ambiguous)))) (m108! m109! m118! m119! m120! m121!) CPU time : 0.00 * End of CVA/rfdoell-GNOMIC-demo.txt demonstration. CPU time : 6.06 * (lisp) "End of SNePS" cl-user(2): :ex