; ================================================================ ; FILENAME: AREEAMOSTOFI-RAVAGE-DEMO.txt ; DATE: 4/26/2011 ; PROGRAMMER: Areea Mostofi ; Using the Becker Verb Algorithm ; 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 "AREEAMOSTOFI-RAVAGE-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) ;Loading of the (default) appropriate definition algorithm: ;Not use because of ambiguity of output. ;(load "/projects/rapaport/CVA/STN2/defun_verb.cl") ;Loading of Becker's Verb Algorithm ^(load "/projects/rapaport/CVA/verbalgorithm3.1/defun_verb.cl") ;Clear the SNePS network: (resetnet t) ; Optional: ; UNCOMMENT THE FOLLOWING CODE TO TURN 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-CHANNEL* anysent) ; (when (isopen.ch ch) ; (setq anysent ; (of (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 of Becker's Relations ^(load "/projects/rapaport/CVA/verbalgorithm3.1/rels") ; load all pre-defined path definitions: ;(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ;^(load "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ;loading of Becker's ^(load "/projects/rapaport/CVA/verbalgorithm3.1/paths") ;BACKGROUND KNOWLEDGE: ;==================== ;Invading armies destroy public buildings (describe (assert member #armies class (build lex "Invading Armies"))) (describe (assert member #buildings class (build lex "public buildings"))) (describe (assert agent *armies act (build action (build lex "destroy") object (*buildings)))) ;RULE: ;For all x, y, act1, act2 IF x does act1 to y and x does act 2 to y and act2 is unknown ;THEN IF x does act2 to y THEN x does act1 to y. (describe (assert forall ($x $y $act1 $act2) &ant((build agent *x act (build action *act1 object *y)) (build agent *x act (build action *act2 object *y)) (build object *act2 property (build lex "unknown"))) cq (build ant (build agent *x act (build action *act2 object *y)) cq(build agent *x act (build action *act1 object *y))))) ;CASSIE READS THE PASSAGE: ;========================= ;Invading armies ravage public buildings. (describe (add agent *armies act (build action (build lex "ravage") object *buildings))) ;Ravage is the unknown word. (describe (add object (build lex "ravage") property (build lex "unknown"))) ;Ask Cassie what "RAVAGE" means: ^(defineVerb 'ravage)