;;Adel Ahmed ;;CSE 700: Independent Study ;;Summer Session II 2003 ;;CVA : Inferring the meaning of the verb 'cripple' from context ;;; Reset the network (resetnet t) ;;; Don't trace infer ^(setq snip:*infertrace* nil) ;;; Load all valid relations (intext "./rels") (define member class object proper-name subclass superclass cardinality act agent action lex); (define possessor location rel property mode head mod skf skarg); ;;; Compose paths ;;(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths") (intext "./paths") ;;; Load Ehrlich Algorithm ;;;^(load "/projects/rapaport/CVA/mkb3.CVA/src/defn3") ;;^(load "../src/synfn") ^(load "./defun_verb.cl") ;;BACKGROUND KNOWLEDGE ;;-------------------- ;; ;;A typhoon is a violent windstorm. (describe (add forall $x ant (build member *x class (build lex "typhoon")) cq (build member *x class (build lex "windstorm")) cq (build object *x property (build lex "violent")) )); ;; ;;A city is a large (municipal) area where lots of people live. (describe (add forall $x ant (build member *x class (build lex "city")) cq (build object *x property (build lex "large")) cq (build object *x property (build lex "municipal")) cq (build member *x class (build lex "area")) cq (build subclass (build skf f1 skarg *x) = lotsOfPeople superclass (build lex "people")) cq (build object *lotsOfPeople cardinality (build lex "lots")) cq (build object1 *lotsOfPeople rel (build lex "live_in") object2 *x) )); ;; ;; A seaport is a port on a seashore that has facilities for seagoing ships (describe (add forall $s ant (build member *s class (build lex "seaport")) cq (build member *s class (build lex "port")) cq (build object *s location (build lex "seaShore")) cq (build subclass (build skf f2 skarg *s) = seaGoingShips superclass (build lex "ships")) cq (build subclass *seaGoingShips superclass (build lex "seaGoing")) cq (build object (build skf g skarg *s) possessor *s rel (build mod *seaGoingShips head (build lex "facilities"))) )); ;; ;; IF x does a AND a has the property p; ;; AND x does b AND b is unknown , ;; THEN 'possibly' b also has the property p. (describe (add forall ($x $a $b $p) &ant ( (build agent *x act (build action *a)) (build object *a property *p) (build object *b property (build lex "unknown")) (build agent *x act (build action *b))) cq (build mode (build lex "possibly") object (build object *b property *p)) )); ;; ;; rule: IF x kill_or_injure y, THEN x kills y or x injures y or both; (describe (add forall ($x $y) ant (build agent *x act (build action (build lex "kill_or_injure") object *y) ) cq (build min 1 max 2 arg (build agent *x act (build action (build lex "kill") object *y)) arg (build agent *x act (build action (build lex "injure") object *y)) ) )); ;; ;; Passage: Typhoon Vera killed or injured 218 people and "crippled" ;; the seaport city of Keelung. ;; ---------------------------------------------------------------- (describe (add object #vera proper-name vera)); (describe (add object #keelung proper-name keelung)); (describe (add object #some-people cardinality 218)); (describe (add subclass *some-people superclass (build lex "people"))); ;; Vera is a Typhoon (describe (add member *vera class (build lex "typhoon"))); ;; Keelung is a city (describe (add member *keelung class (build lex "city"))); ;; Keelung is a seaport. (describe (add member *keelung class (build lex "seaport"))); ;; Vera crippled Keelung (describe (add agent *vera act (build object *keelung action (build lex "cripple")))); (describe (add object (build lex "cripple") property (build lex "unknown"))); ;; Vera killed_or_injured people (describe (add agent *vera act (build object *some-people action (build lex "kill_or_injure")))); ;; ;; killing or injuring is bad (describe (add object (build lex "kill_or_injure") property (build lex "bad"))); (describe (add object (build lex "kill") property (build lex "bad"))); (describe (add object (build lex "injure") property (build lex "bad"))); ;; run the verb algorithm for the verb 'cripple' ^(defineVerb 'cripple);