;;; File: restaurant-classes.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-classes.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 statements 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))) (every 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))))))) ;;; ---------------------------------------- ;;; DINING ;;; ---------------------------------------- (Dining has (superclasses (Event))) (every 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))) (before ((the Eating subevents of Self)))) (a Getting with (agent ((the agent of Self))) (patient ((the patient of Self))) (before ((the Eating subevents of Self)))) (a Eating with (agent ((the agent of Self))) (patient ((the patient of Self))) (after ((the Sitting subevents of Self) (the Getting subevents of Self))))))) ;;; ---------------------------------------- ;;; THE COMPOSITION: RESTAURANT VISITING = PURCHASING + DINING ;;; ---------------------------------------- (Restaurant-Visiting has (superclasses (Event))) ;;; [1] This is a slightly awkward way of saying the two Gettings (in the Purchasing and Dining) ;;; are coreferential. (every 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))) (component-events ( (a Purchasing with (buyer ((the diner of Self))) (seller ((the restaurant of Self))) (item ((the meal of Self))) (money ((the money of Self))) (subevents ((the Getting subevents of (the Dining component-events of Self))))) ; [1] (a Dining with (agent ((the diner of Self))) (patient ((the meal of Self))) (location ((the table of Self))) (subevents ((the Getting subevents of (the Purchasing component-events of Self)))))))) ; [1] ;;; ---------------------------------------- ;;; MCDONALDS-RESTAURANT-VISITING: Extra constraints on event ordering specified ;;; ---------------------------------------- (McDonalds-Restaurant-Visiting has (superclasses (Restaurant-Visiting))) ;;; We now define the McDonalds-Specific Connections between components: ;;; [1] the Paying is before the Getting. ;;; [2] the Getting is before the Sitting and the Eating. (every McDonalds-Restaurant-Visiting has (component-events ( (a Purchasing with (subevents ((a Paying with (before ((the Getting subevents of ; [1] (the Dining component-events of Self)))))))) (a Dining with (subevents ((a Getting with (before ((the Sitting subevents of ; [2] (the Dining component-events of Self)) (the Eating subevents of (the Dining component-events of Self))))))))))) ;;; ---------------------------------------- ;;; TRUDYS-RESTAURANT-VISITING: Extra constraints on event ordering specified ;;; ---------------------------------------- (Trudys-Restaurant-Visiting has (superclasses (Restaurant-Visiting))) ;;; [1] the Paying is after the Eating. ;;; [2] the Getting is after the Sitting. (every Trudys-Restaurant-Visiting has (component-events ( (a Purchasing with (subevents ((a Paying with (after ((the Eating subevents of ; [1] (the Dining component-events of Self))))) (a Getting with (after ((the Sitting subevents of ; [2] (the Dining component-events of Self))))))))))) ;;; --- end ---