;;; File: restaurant-prototypes.km ;;; Author: Peter Clark ;;; Date: March 2000 ;;; **NOTE** This file requires KM 1.4.0-beta33 or later #| See Working Note 17 "$RESTAURANT re-visited: A KM Implementation of a Compositional Approach" (http://www.cs.utexas.edu/users/pclark/working_notes) for a discussion of the contents of this KB. WHAT THIS KB DOES: ================== KM> (load-kb "restaurant-prototypes.km") KM> (the description-of-all-subevents of (a Restaurant-Visiting)) The paying. The getting. The getting is before the eating. The sitting. The sitting is before the eating. The eating. The eating is after the sitting the getting. KM> (the description-of-all-subevents of (a McDonalds-Restaurant-Visiting)) The paying. The paying is before the getting. The getting. The getting is before the sitting the eating. The getting is after the paying. The sitting. The sitting is before the eating. The sitting is after the getting. The eating. The eating is after the getting the sitting. KM> (the description-of-all-subevents of (a Trudys-Restaurant-Visiting)) The sitting. The sitting is before the eating the getting. The getting. The getting is before the eating. The getting is after the sitting. The eating. The eating is before the paying. The eating is after the getting the sitting. The paying. The paying is after the eating. |# ;;; ================================================== (reset-kb) ;;; cotemporal-with isn't used in this KB, but we put it there anyway for completeness (before has (instance-of (Slot)) (inverse (after))) (cotemporal-with has (instance-of (Slot)) (inverse (cotemporal-with))) (subevents has (instance-of (Slot)) (inverse (superevents))) ;;; [1] This ugly formatting simply prints out the before, cotemporal-with, and after properties of ;;; for each subevent of the main event. (every Event has (all-subevents ((the subevents of Self) (the all-subevents of (the subevents of Self)))) (subevents ((the subevents of (the component-events of Self)))) (description-of-all-subevents ( (make-sentence (forall (the all-subevents of Self) ; [1] (:seq It "." (if (has-value (the before of It)) then (:seq It "is before" (the before of It) ".")) (if (has-value (the cotemporal-with of It)) then (:seq It "is cotemporal with" (the cotemporal-with of It) ".")) (if (has-value (the after of It)) then (:seq It "is after" (the after of It) ".")) (format nil "~%"))))))) (Paying has (superclasses (Event))) (Sitting has (superclasses (Event))) (Getting has (superclasses (Event))) (Eating has (superclasses (Event))) ;;; ---------------------------------------- ;;; PURCHASING ;;; ---------------------------------------- (Purchasing has (superclasses (Event))) (a-prototype Purchasing) ((the Purchasing) has (buyer ((a Agent))) (seller ((a Agent))) (item ((a Thing))) (money ((a Amount-Of-Money))) (subevents ( ; NOTE no ordering assumed here (a Getting with (agent ((the seller of Self))) (patient ((the item of Self))) (recipient ((the buyer of Self)))) (a Paying with (agent ((the buyer of Self))) (patient ((the money of Self))) (recipient ((the seller of Self))))))) (end-prototype) ;;; ---------------------------------------- ;;; DINING ;;; ---------------------------------------- (Dining has (superclasses (Event))) (a-prototype Dining) ((the Dining) has (agent ((a Person))) (patient ((a Edible-Thing))) (location ((a Place))) (subevents ( ; again, no ordering implied (a Sitting with (agent ((the agent of Self))) (location ((the location of Self)))) (a Getting with (agent ((the agent of Self))) (patient ((the patient of Self)))) (a Eating with (agent ((the agent of Self))) (patient ((the patient of Self))))))) ((the Sitting) has (before ((the Eating)))) ((the Getting) has (before ((the Eating)))) ;;; (but we don't know whether the sitting is before or after the getting) (end-prototype) ;;; ---------------------------------------- ;;; THE COMPOSITION: RESTAURANT VISITING = PURCHASING + DINING ;;; ---------------------------------------- (Restaurant-Visiting has (superclasses (Event))) (a-prototype Restaurant-Visiting) ((the Restaurant-Visiting) has (diner ((a Person))) (meal ((a Meal))) (restaurant ((a Restaurant))) (table ((a Table with (location ((the restaurant of Self)))))) (money ((a Amount-Of-Money)))) ;;; Specify the components... ((the Restaurant-Visiting) has (component-events ( (a Purchasing with (buyer ((the Person))) (seller ((the Restaurant))) (item ((the Meal))) (money ((the Amount-Of-Money)))) (a Dining with (agent ((the Person))) (patient ((the Meal))) (location ((the Table))))))) ;;; Introduce these subevents (as I want to then refer to them)... ((the Purchasing) has (subevents ((a Getting)))) ((the Dining) has (subevents ((a Getting)))) ;;; ...and then state they are coreferential (== does unification) ((the Getting subevents of (the Purchasing)) == (the Getting subevents of (the Dining))) (end-prototype) ;;; ---------------------------------------- ;;; MCDONALDS-RESTAURANT-VISITING: Extra constraints on event ordering specified ;;; ---------------------------------------- (McDonalds-Restaurant-Visiting has (superclasses (Restaurant-Visiting))) (a-prototype McDonalds-Restaurant-Visiting) ;;; We now define the McDonalds-Specific Connections between components: ;;; (a) Explicitly create the to-be-referred-to objects... ((the McDonalds-Restaurant-Visiting) has (component-events ((a Purchasing with (subevents ((a Getting) (a Paying)))) (a Dining with (subevents ((a Sitting) (a Eating))))))) ;;; ...then (b) state the connections of interest... ((the Paying) has (before ((the Getting)))) ((the Getting) has (before ((the Sitting)))) ((the Getting) has (before ((the Eating)))) (end-prototype) ;;; ---------------------------------------- ;;; TRUDYS-RESTAURANT-VISITING: Extra constraints on event ordering specified ;;; ---------------------------------------- (Trudys-Restaurant-Visiting has (superclasses (Restaurant-Visiting))) (a-prototype Trudys-Restaurant-Visiting) ;;; We now define the Trudys-Specific Connections between components: ;;; (a) Explicitly create the to-be-referred-to objects... ((the Trudys-Restaurant-Visiting) has (component-events ((a Purchasing with (subevents ((a Getting) (a Paying)))) (a Dining with (subevents ((a Sitting) (a Eating))))))) ;;; ...then (b) state the connections of interest... ((the Paying) has (after ((the Eating)))) ((the Getting) has (after ((the Sitting)))) (end-prototype)