; ======================================================================= ; FILENAME: kolper.demo.2 ; DATE: 11/15/2004 - 12/1/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 "brkolper.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 other relations (define skolem-function arg1 mod head) ; 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 window possibly provides a view (describe (assert forall $window ant (build member *window class (build lex "window")) cq (build mod (build lex "possibly") head (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")))) ; A window possibly does not provide a view (describe (assert forall $window ant (build member *window class (build lex "window")) cq (build mod (build lex "possibly") head (build min 0 max 0 arg (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 possibly 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 mod (build lex "possibly") head (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 an object fronts something that is outside a room and object is possessed by the room then it possibly does not provide 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 mod (build lex "possibly") head (build min 0 max 0 arg (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 possibly 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 mod (build lex "possibly") head (build object1 *x rel (build lex "provides") object2 *w)) &ant (build mod (build lex "possibly") head (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))) ;if x is used to a view and x is depressed and a view is possibly provided or not provided by some z, then y is not provided by that z (describe (add forall ($x $v1 $v2 $z $view) &ant (build object *x property (build lex "depressed")) &ant (build object1 *x rel (build lex "used-to") object2 *v1) &ant (build member *v1 class *view) &ant (build mod (build lex "possibly") head (build object1 *z rel (build lex "provides") object2 *v2)) &ant (build mod (build lex "possibly") head (build min 0 max 0 arg (build object1 *z rel (build lex "provides") object2 *v2))) &ant (build member *v2 class *view) cq (build min 0 max 0 arg (build object1 *z rel (build lex "provides") object2 *v2)))) ; if not(x provides y), then x "does not provide" y (describe (add forall ($x $y) ant (build min 0 max 0 arg (build object1 *x rel (build lex "provides") object2 *y)) cq (build object1 *x rel (build lex "does not provide") object2 *y))) ; 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")) (add object *fred property (build lex "depressed")) ; Ask Cassie what "kolper" means: ^(defineNoun "kolper")