; ======================================================================= ; FILENAME: harbinger.demo ; DATE: 12/8/03 ; PROGRAMMER: Albert Goldfain ; 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 "harbinger.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 noun definition algorithm: ^(load "/projects/rapaport/CVA/STN2/defun_noun.cl") ; Clear the SNePS network: (resetnet) ; 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/rels") (intext "myRels") ; load all pre-defined path definitions: ;(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") (intext "myPaths") ; BACKGROUND KNOWLEDGE: ; ===================== ;---------------------------------------------------------- ; BG I. The American Robin is a bird ;---------------------------------------------------------- (describe (add member #AmericanRobin class (build lex AmericanRobin))) (describe (add member *AmericanRobin class (build lex bird)=BIRDCLASS)) ;---------------------------------------------------------- ; BG II. Spring is a season ;---------------------------------------------------------- (describe (add object #Spring proper-name (build lex Spring))) (describe (add member *Spring class (build lex season)=SEASONS)) ;---------------------------------------------------------- ; BG III. Summer is a season ;---------------------------------------------------------- (describe (add object #Summer proper-name (build lex Summer))) (describe (add member *Summer class *SEASONS)) ;---------------------------------------------------------- ; BG IV. Spring is before Summer (or Summer is after Spring) ;---------------------------------------------------------- (describe (add before *Spring after *Summer)) ;---------------------------------------------------------- ; BG V. The American Robin is a migratory bird. ;---------------------------------------------------------- (describe (add member *AmericanRobin class (build mod (build lex migratory)=MIGRATORYTHING head *BIRDCLASS)=MIGRATORYBIRDS ) ) ;---------------------------------------------------------- ; BG VI. If x is z's y then x is a y ;---------------------------------------------------------- (describe (add forall ($x $y $z) ant (build object *x rel *y possessor *z) cq (build member *x class *y))) ;---------------------------------------------------------- ; BG VII. If x is a y bird and y is not a season then x is y ;---------------------------------------------------------- (describe (add forall ($x $y) &ant (build member *x class (build mod *y head *BIRDCLASS)) &ant (build min 0 max 0 arg(build member *y class *SEASONS)) cq (build object *x property *y) ) ) ;---------------------------------------------------------- ; BG VIII. If x is migratory then x migrates ;---------------------------------------------------------- (describe (add forall $x ant (build object *x property *MIGRATORYTHING) cq (build agent *x act (build action (build lex migrate)=MIGRATES) ) ) ) ;---------------------------------------------------------- ; BG IX. If x is the first of y then x is an indicator that ; y has arrived ;---------------------------------------------------------- (describe (build lex arrive)=ARRIVAL) (describe (add forall ($x $y) ant (build object1 *x rel (build lex first)=FIRSTOF object2 *y ) cq (build object1 *x rel (build lex indicates) object2 (build agent *y act (build action *ARRIVAL) ) ) ) ) ;---------------------------------------------------------- ; BG X, XI and XII. Defining the "first" of a class ;---------------------------------------------------------- (describe (add forall ($x $y) ant (build object1 *x rel *FIRSTOF object2 *y) cq (build member *x class *y) ) ) (describe (add forall ($x $y $z) &ant (build object1 *x rel *FIRSTOF object2 *y) &ant (build object1 *z rel *FIRSTOF object2 *y) cq (build equiv *x equiv *z) ) ) (describe (add forall ($x $y $z) &ant (build object1 *x rel *FIRSTOF object2 *y) &ant (build min 0 max 0 arg(build equiv *x equiv *z)) cq (build min 0 max 0 arg(build object1 *z rel *FIRSTOF object2 *y)) ) ) ;---------------------------------------------------------- ; BG XIII. Defining "other" ;---------------------------------------------------------- (describe (add forall ($x $y $z) &ant (build member *x class *y) &ant (build member *z class (build mod (build lex other) head *y)) cq (build min 0 max 0 arg(build equiv *x equiv *z)) ) ) ; CASSIE READS THE PASSAGE: ; ========================= ;---------------------------------------------------------- ; I. THE AMERICAN ROBIN IS CALLED THE "HARBINGER OF SPRING" ;---------------------------------------------------------- (describe (add object *AmericanRobin rel (build lex harbinger) = HARBINGERS possessor *Spring) = ARCHOS) ;--------------------------------------------- ; II. BECAUSE OF ITS EARLY NORTHWARD MIGRATION ;--------------------------------------------- (describe (add cause (add agent *AmericanRobin act (build action *MIGRATES) = MIGRATION ) = ENM effect *ARCHOS ) ) (describe (add object *MIGRATION property (build lex early))) (describe (add action *MIGRATES from #STARTLOC to #ENDLOC)) (describe (add object1 *ENDLOC rel (build lex north) object2 *STARTLOC)) ;---------------------------------------------------------------- ; III. WHICH BRINGS ITS ARRIVAL BEFORE MOST OTHER MIGRATORY BIRDS ;---------------------------------------------------------------- (describe (add before #ARRIVETIME1 after #ARRIVETIME2)) (describe (add cause *ENM effect (add agent *AmericanRobin act (build action *ARRIVAL) time *ARRIVETIME1 ) ) ) (describe (add agent (build mod (build lex other) head *MIGRATORYBIRDS ) act (build action *ARRIVAL) time *ARRIVETIME2 ) ) ;---------------------------------------------------------------------- ; IV. IT IS USUALLY THE FIRST OF THE SUMMER BIRDS TO BE NOTED BY HUMANS ;---------------------------------------------------------------------- (describe (add object1 *AmericanRobin rel *FIRSTOF object2 #SummerBirdsNotedByHumans ) ) (describe (add subclass *SummerBirdsNotedByHumans superclass (build mod *Summer head *BIRDCLASS) ) ) (describe (add subclass *SummerBirdsNotedByHumans superclass (build mod (build lex notedBy) head (build lex humans)) ) ) ; Ask Cassie what "harbinger" means: ^(defineNoun "harbinger")