; ======================================================================= ; FILENAME: kolper.demo.1 ; DATE: 10/29/2004 - 11/23/2004 ; PROGRAMMER: Rahul Krishna ;; this template version: template.demo.2003.11.17.txt ; Lines beginning with a semi-colon are comments. ; Lines beginning with "^" are Lisp commands. ; All other lines are SNePS commands. ; ; To use this file: run SNePS; at the SNePS prompt (*), type: ; ; (demo "kolper.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) ; Load the appropriate definition algorithm: ^(load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; 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: (intext "/projects/rapaport/CVA/STN2/demos/rels") ; load all pre-defined path definitions: (intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") ; Define some other relations (define skolem-function arg1) ; BACKGROUND KNOWLEDGE: ; ===================== ; A courtyard is outside of a room. (describe (assert forall ($cyard $room) &ant (build member *cyard class (build lex "courtyard")) &ant (build member *room class (build lex "room")) cq (build object1 *cyard rel (build lex "outside") object2 *room))) ; A room has windows (describe (assert forall *room ant (build member *room class (build lex "room")) cq (build member (build skolem-function window\ of arg1 *room) class (build lex "window")) cq (build object #win rel (build skolem-function window\ of arg1 *room) possessor *room))) ; A windows provides a view (describe (assert forall $window ant (build member *window class (build lex "window")) cq (build object1 *window rel (build lex "provides") object2 (build skolem-function view\ of arg1 *window)) cq (build member (build skolem-function view\ of arg1 *window) class (build lex "view")))) ;if an object fronts something that is outside a room and object is possessed by the room then it provides a view (describe (assert forall ($x $y $k $room) &ant (build object1 *x rel (build lex "front") object2 *y) &ant (build object1 *y rel (build lex "outside") object2 *room) &ant (build member *room class (build lex "room")) &ant (build possessor *room object *x rel *k) cq (build object1 *x rel (build lex "provides") object2 (build skolem-function view\ of arg1 *x)) cq (build member (build skolem-function view\ of arg1 *x) class (build lex "view")))) ; if x is y's z then x is a member of class z (describe (assert forall ($x $y $z) ant (build object *x possessor *y rel *z) cq (build member *x class *z))) ;if x and y both provide views, and x & y are members of classes a & b repectively, and class a is unknown, then class a is a subclass of class b (describe (assert forall ($a $b $w $x $y $z) &ant (build object1 *x rel (build lex "provides") object2 *w) &ant (build object1 *y rel (build lex "provides") object2 *z) &ant (build member *x class *a) &ant (build member *y class *b) &ant (build member *w class (build lex "view")) &ant (build member *z class (build lex "view")) &ant (build object *a property (build lex "unknown")) cq (build subclass *a superclass *b))) ; CASSIE READS THE PASSAGE: ; ========================= ; The Sentence: ; When you are used to a broad view, it becomes quite depressing ; when you come to live in a room with one or two kolpers ; fronting a courtyard. (describe (add forall ($view $agent $room $kolper $courtyard) &ant (build member *view class (build lex "view")) &ant (build object *view property (build lex "broad")) &ant (build object1 *agent rel (build lex "used to ") object2 *view) &ant (build agent *agent act (build action (build lex "live") object *room)) &ant (build member *room class (build lex room)) &ant (build possessor *room object *kolper rel (build lex "kolper")) &ant (build object1 *kolper rel (build lex "front") object2 *courtyard) &ant (build member *courtyard class (build lex "courtyard")) cq (build object *agent property (build lex "depressed")))) ; Add instances for the items in the above rule (add member #view class (build lex "view")) (add object *view property (build lex "broad")) (add agent #fred act (build action (build lex "live") object #room)) (add object1 *fred rel (build lex "used-to") object2 *view) (add member *room class (build lex "room")) (add possessor *room object #kolper rel (build lex "kolper")) (add object1 *kolper rel (build lex "front") object2 #courtyard) (add member *courtyard class (build lex "courtyard")) (add object (build lex "kolper") property (build lex "unknown")) ; Ask Cassie what "kolper" means: ^(defineNoun "kolper")