;; ============================================================================
;;                    	    REARDEN COMMERCE, INC.
;;                	            Hotel Ontology
;; ============================================================================

;; Created by: Karen Joy Nomorosa (karen.nomorosa [at] reardencommerce [dot] com)
;; Created on: April 15, 2011
;; Last modified: May 27, 2011
;; Modified by: Karen Joy Nomorosa (karen.nomorosa [at] reardencommerce [dot] com)

;; Description:  This ontology describes different concepts that are prevalent
;; in the hotel domain

;; Access to and use of these products is governed by the GNU General Public 
;; License <http://www.gnu.org/copyleft/gpl.html>. 
;; By using these products, you agree to be bound by the terms 
;; of the GPL.

;; We ask the people using or referencing this work cite our primary paper:

;; Niles, I., and Pease, A.  2001.  Towards a Standard Upper Ontology.  In 
;; Proceedings of the 2nd International Conference on Formal Ontology in 
;; Information Systems (FOIS-2001), Chris Welty and Barry Smith, eds, 
;; Ogunquit, Maine, October 17-19, 2001.  See also http://www.ontologyportal.org

;; Separating Hotel from HotelBuilding, where Hotel is the agent or the business that
;; administers or operates the HotelBuilding, and HotelBuilding is the physical 
;; structure where Hotel is located.

;; NOTE: Removing this definition to accommodate independent TravelerAccommodation
;; operators such as Vacation Rentals, Room Rentals, etc. who do not necessarily have
;; a hotel building - who might just be renting out a room in their homes, etc.
;; And so the basic definition of TravelerAccommodation is basically anyone who allows
;; someone to rent a HotelUnit for a specific amount of time.
;; (=> 
;;   (attribute ?X TravelerAccommodation)
;;   (exists (?PROPERTY ?BLDG)
;;     (and
;;       (equal ?PROPERTY (PropertyFn ?X))
;;       (instance ?BLDG HotelBuilding)
;;       (element ?BLDG ?PROPERTY))))


;; NOTE: Renting is a subclass of FinancialTransaction, so the relationship &%rents,
;; which implies that an instance of Renting exists, already implies that 
;; TravelerAccommodation provides       
(=>
  (attribute ?X TravelerAccommodation)
  (hasPurpose ?X
    (exists (?GUEST ?ROOM)
      (and
        (rents ?GUEST ?X ?ROOM ?TI)
        (instance ?ROOM HotelUnit)
        (element ?ROOM (PropertyFn ?X))))))

        
(subrelation guest customer)
(documentation guest EnglishLanguage "&%guest refers to the &%customer living in a
&%TemporaryResidence for the duration of his stay there")
(termFormat EnglishLanguage guest "guest")

(domain guest 1 CognitiveAgent)
(domain guest 2 CognitiveAgent)

(=>
  (and
    (rents ?GUEST ?HOTEL ?ROOM ?TI)
    (attribute ?HOTEL TravelerAccommodation)
    (instance ?ROOM HotelUnit))
  (holdsDuring ?TI
    (guest ?GUEST ?HOTEL)))

(subclass HotelBuilding ResidentialBuilding)
(documentation HotelBuilding EnglishLanguage "A &%ResidentialBuilding which provides 
temporary accommodations to guests in exchange for money.")
(termFormat EnglishLanguage HotelBuilding "hotel")

(=> 
  (instance ?HOTEL HotelBuilding)
  (exists (?ROOM)
    (and
      (instance ?ROOM HotelRoom)
      (properPart ?ROOM ?HOTEL))))      

(subclass HotelUnit StationaryArtifact)
(subclass HotelUnit TemporaryResidence)
(documentation HotelUnit EnglishLanguage "&%HotelUnit describes the basic unit that
a traveler sleeps in when he is in &%TravelerAccomodation.  It can be a &%Room or a 
detached &%Building")
(termFormat EnglishLanguage HotelUnit "hotel unit")

(=>
  (instance ?ROOM HotelUnit)
  (exists (?BED)
    (and
      (instance ?BED Bed)
      (located ?BED ?ROOM))))

(=>
  (instance ?ROOM HotelUnit)
  (exists (?HOTEL)
    (and
      (attribute ?HOTEL TravelerAccommodation)
      (element ?ROOM (PropertyFn ?HOTEL)))))

(=>
  (instance ?ROOM HotelUnit)
  (hasPurpose ?ROOM
    (exists (?AGENT ?CUST ?TI)
      (and
        (not (equal ?AGENT ?CUST))
        (element ?ROOM (PropertyFn ?AGENT))
        (rents ?CUST ?AGENT ?ROOM ?TI)))))
      
(subclass HotelRoom Room)
(subclass HotelRoom HotelUnit)
(documentation HotelRoom EnglishLanguage "&%HotelRoom refers to a &%Room that is part
of a &%HotelBuilding that serves as a &%TemporaryResidence for travelers")
(termFormat EnglishLanguage HotelRoom "hotel room")

(=>
  (instance ?ROOM HotelRoom)
  (exists (?BLDG)
    (and
      (instance ?BLDG HotelBuilding)
      (part ?ROOM ?BLDG))))
      
(subclass HotelVilla Building)
(subclass HotelVilla HotelUnit)
(documentation HotelVilla EnglishLanguage "&%HotelVilla refers to a &%Building that
is completely detached from the main &%HotelBuilding")
(termFormat EnglishLanguage HotelVilla "hotel villa")

(subclass RoomInventory Collection)
(documentation RoomInventory EnglishLanguage "&%RoomInventory is the &%Collection of
&%HotelUnit  that a &%TravelerAccommodation has in one &%PropertyFn")
(termFormat EnglishLanguage RoomInventory "room inventory")

(=>
  (instance ?X RoomInventory)
  (memberType ?X HotelUnit))
  
(=>
  (and
    (element ?X (PropertyFn ?HOTEL))
    (instance ?X RoomInventory))
  (forall (?Y)
    (=>
      (member ?Y ?X)
      (element ?Y (PropertyFn ?HOTEL)))))
  
;; ---------------------------------------------------------------------------------
;; Hotel Room Relations
;; ---------------------------------------------------------------------------------      

;; TO ROOM INVENTORY
;; ==================

(instance allRoomsPhysicalAmenity BinaryPredicate)
(documentation allRoomsPhysicalAmenity EnglishLanguage "(&%allRoomsPhysicalAmenity
?INV ?OBJ) means that all rooms in &%RoomInventory ?INV have &%roomAmenity ?OBJ")
(termFormat EnglishLanguage allRoomsPhysicalAmenity "physical amenity in all rooms")

(domain allRoomsPhysicalAmenity 1 RoomInventory)
(domainSubclass allRoomsPhysicalAmenity 2 Object)

(=>
  (allRoomsPhysicalAmenity ?INV ?OBJ)
  (forall (?X)
    (=>
      (memberType ?INV ?X)
      (roomAmenity ?X ?OBJ))))

(instance someRoomsPhysicalAmenity BinaryPredicate)
(documentation someRoomsPhysicalAmenity EnglishLanguage "(&%someRoomsPhysicalAmenity
?INV ?OBJ) means that there are rooms in &%RoomInventory ?INV that have 
&%roomAmenity ?OBJ")
(termFormat EnglishLanguage someRoomsPhysicalAmenity "physical amenity in some rooms")

(domain someRoomsPhysicalAmenity 1 RoomInventory)
(domainSubclass someRoomsPhysicalAmenity 2 Object)

(=>
  (someRoomsPhysicalAmenity ?INV ?OBJ)
  (exists (?X)
    (and
      (memberType ?INV ?X)
      (roomAmenity ?X ?OBJ))))

(instance someRoomsServiceAmenity BinaryPredicate)
(documentation someRoomsServiceAmenity EnglishLanguage "(&%someRoomsServiceAmenity 
?INV ?SVC) means that there are rooms in &%RoomInventory ?INV that have 
&%roomAmenity ?SVC")
(termFormat EnglishLanguage someRoomsServiceAmenity "service amenity in some rooms")

(domain someRoomsServiceAmenity 1 RoomInventory)
(domainSubclass someRoomsServiceAmenity 2 ServiceProcess)

(=>
  (someRoomsServiceAmenity ?INV ?SVC)
  (exists (?X)
    (and
      (memberType ?INV ?X)
      (roomAmenity ?X ?SVC))))
      
(instance allRoomsServiceAmenity BinaryPredicate)
(documentation allRoomsServiceAmenity EnglishLanguage "(&%allRoomsServiceAmenity 
?INV ?SVC) means that all rooms in &%RoomInventory ?INV have &%roomAmenity ?SVC")
(termFormat EnglishLanguage allRoomsServiceAmenity "service amenity in all rooms")

(domain allRoomsServiceAmenity 1 RoomInventory)
(domainSubclass allRoomsServiceAmenity 2 ServiceProcess)

(=>
  (allRoomsServiceAmenity ?INV ?OBJ)
  (forall (?X)
    (=>
      (memberType ?INV ?X)
      (roomAmenity ?X ?OBJ))))

(instance allRoomsPolicy BinaryPredicate)
(documentation allRoomsPolicy EnglishLanguage "(&%allRoomsPolicy 
?INV ?POLICY) means that all rooms in &%RoomInventory ?INV have &%roomPolicy ?POLICY")
(termFormat EnglishLanguage allRoomsPolicy "room policy in all rooms")

(domain allRoomsPolicy 1 RoomInventory)
(domain allRoomsPolicy 2 Policy)

(=>
  (allRoomsPolicy ?INV ?POLICY)
  (forall (?X)
    (=>
      (memberType ?INV ?X)
      (roomPolicy ?X ?POLICY))))
      
(instance someRoomsPolicy BinaryPredicate)
(documentation someRoomsPolicy EnglishLanguage "(&%someRoomsPolicy 
?INV ?POLICY) means some rooms in &%RoomInventory ?INV have &%roomPolicy ?POLICY")
(termFormat EnglishLanguage someRoomsPolicy "room policy in all rooms")

(domain someRoomsPolicy 1 RoomInventory)
(domain someRoomsPolicy 2 Policy)

(=>
  (someRoomsPolicy ?INV ?POLICY)
  (exists (?X)
    (and
      (memberType ?INV ?X)
      (roomPolicy ?X ?POLICY))))

(instance someRoomsAttribute BinaryPredicate)
(documentation someRoomsAttribute EnglishLanguage "(&%someRoomsAttribute ?INV ?ATTR) 
means some rooms in &%RoomInventory ?INV have &%RelationalAttribute ?ATTR")
(termFormat EnglishLanguage someRoomsAttribute "some rooms attribute")

(domain someRoomsAttribute 1 RoomInventory)
(domain someRoomsAttribute 2 RelationalAttribute)

(=>
  (someRoomsAttribute ?INV ?ATTR)
  (exists (?X)
    (and
      (member ?X ?INV)
      (attribute ?X ?ATTR))))

;; HOTEL UNIT RELATIONS
;; ================================================================================

(instance roomAmenity BinaryPredicate)
(documentation roomAmenity EnglishLanguage "(&%roomAmenity ?ROOM ?PHYS) means that
&%TravelerAccommodation provides &%Physical ?PHYS in &%HotelUnit ?ROOM")
(termFormat EnglishLanguage roomAmenity "room amenity")

(domainSubclass roomAmenity 1 HotelUnit)
(domainSubclass roomAmenity 2 Physical)

(=>
  (and
    (roomAmenity ?ROOM ?OBJ)
    (subclass ?OBJ Object))
  (forall (?R)
    (=>
      (instance ?R ?ROOM)
      (exists (?O)
        (and
          (instance ?R ?ROOM)
          (instance ?O ?OBJ)
          (located ?O ?R))))))
          
(=>
  (and
    (guest ?CUST ?HOTEL)
    (stays ?CUST ?R)
    (element ?R (PropertyFn ?HOTEL))
    (instance ?R ?ROOM)
    (roomAmenity ?ROOM ?OBJ)
    (subclass ?OBJ Object))
  (exists (?O)
    (and
      (instance ?O ?OBJ)
      (located ?O ?R)
      (confersRight
        (exists (?PROC)
          (and
            (agent ?PROC ?CUST)
            (or
              (instrument ?PROC ?O)
              (patient ?PROC ?O)
              (resource ?PROC ?O)))) ?HOTEL ?CUST))))          

(=>
  (and
    (roomAmenity ?ROOM ?SVC)
    (subclass ?SVC Process))
  (modalAttribute
    (exists (?X ?S)
      (and
        (instance ?X ?ROOM)
        (agent ?S ?HOTEL)
        (or
          (instance ?S ?SVC)
          (and
            (instance ?PROC ?SVC)
            (subProcess ?S ?PROC)))
        (located ?S ?X))) Possibility))

(subrelation freeRoomAmenity roomAmenity)
(documentation freeRoomAmenity EnglishLanguage "(&%freeRoomAmenity ?ROOM ?PHYS) 
means that there is no price associated with the use of an object or the rendering
of a service")
(termFormat EnglishLanguage freeRoomAmenity "free room amenity")

(=>
  (and
    (freeRoomAmenity ?ROOM ?OBJ)
    (subclass ?OBJ Object)
    (instance ?R ?ROOM)
    (stays ?GUEST ?R)
    (element ?R (PropertyFn ?HOTEL))
    (instance ?O ?OBJ)
    (located ?O ?R)
    (instance ?P Process)
    (agent ?P ?GUEST)
    (or
      (patient ?P ?O)
      (instrument ?P ?O)
      (resource ?P ?O)))
  (price ?P (MeasureFn 0 UnitedStatesDollar) ?HOTEL))

(=>
  (and
    (freeRoomAmenity ?ROOM ?PROC)
    (subclass ?PROC Process)
    (instance ?R ?ROOM)
    (stays ?GUEST ?R)
    (element ?R (PropertyFn ?HOTEL))
    (or
      (instance ?P ?PROC)
      (and
        (instance ?S ?PROC)
        (subProcess ?P ?S)))
    (located ?P ?R))
  (price ?P (MeasureFn 0 UnitedStatesDollar) ?HOTEL))

(subrelation paidRoomAmenity roomAmenity)
(documentation paidRoomAmenity EnglishLanguage "(&%paidRoomAmenity ?ROOM ?PHYS) 
means that there is a fee associated with the use of an object or the rendering
of a service")
(termFormat EnglishLanguage paidRoomAmenity "paid room amenity")

(=>
  (and
    (paidRoomAmenity ?ROOM ?OBJ)
    (subclass ?OBJ Object))
  (=>
    (and
      (instance ?R ?ROOM)
      (stays ?GUEST ?R)
      (element ?R (PropertyFn ?HOTEL))
      (instance ?O ?OBJ)
      (located ?O ?R)
      (instance ?P Process)
      (agent ?P ?GUEST)
      (or
        (located ?P ?O)
        (patient ?P ?O)
        (instrument ?P ?O)
        (resource ?P ?O)))
    (and
      (price ?P ?PRICE ?HOTEL)
      (greaterThan ?PRICE (MeasureFn 0 UnitedStatesDollar)))))

(=>
  (and
    (paidRoomAmenity ?ROOM ?PROC)
    (subclass ?PROC Process))
  (=>
    (and
      (instance ?R ?ROOM)
      (stays ?GUEST ?R)
      (element ?R (PropertyFn ?HOTEL))
      (or
        (instance ?P ?PROC)
        (and
          (instance ?S ?PROC)
          (subProcess ?P ?S)))
      (located ?P ?R))
    (and
      (price ?P ?PRICE ?HOTEL)
      (greaterThan ?PRICE (MeasureFn 0 UnitedStatesDollar)))))
    
(instance roomPolicy BinaryPredicate)
(documentation roomPolicy EnglishLanguage "(&%roomPolicy ?ROOM ?POLICY) means that
&%Policy ?POLICY is applied to the &%HotelUnit ?ROOM")
(termFormat EnglishLanguage roomPolicy "room policy")

(domainSubclass roomPolicy 1 HotelUnit)
(domain roomPolicy 2 Policy)

(=>
  (roomPolicy ?ROOM ?POLICY)
  (forall (?R)
    (=>
      (instance ?R ?ROOM)
      (policyLocationCoverage ?POLICY ?R))))
      
(instance roomAttribute BinaryPredicate)
(documentation roomAttribute EnglishLanguage "(&%roomAttribute ?ROOM ?ATTR) means that
all instances of &%HotelUnit ?ROOM has attribute ?ATTR")
(termFormat EnglishLanguage roomAttribute "room attribute")

(domainSubclass roomAttribute 1 HotelUnit)
(domain roomAttribute 2 RelationalAttribute)  

(=>
  (roomAttribute ?ROOM ?ATTR)
  (forall (?R)
    (=>
      (instance ?R ?ROOM)
      (attribute ?R ?ATTR))))

(instance maxRoomCapacity BinaryPredicate)
(documentation maxRoomCapacity EnglishLanguage "(&%maxRoomCapacity ?ROOM ?NUM) means
that &%TravelerAccommodation allows a maximum number of ?NUM people to stay in ?ROOM
during one stay")
(termFormat EnglishLanguage maxRoomCapacity "maximum capacity")

(domainSubclass maxRoomCapacity 1 StationaryArtifact)
(domain maxRoomCapacity 2 Integer)

(=>
  (and
    (maxRoomCapacity ?ROOM ?NUM)
    (instance ?X ?ROOM)
    (element ?X (PropertyFn ?AGENT)))
  (modalAttribute
    (exists (?GRP)
      (and
        (instance ?GRP GroupOfPeople)
        (memberCount ?GRP ?PPL)
        (lessThanOrEqualTo ?PPL ?NUM)
        (stays ?GRP ?X))) Possibility))
       
     
;; HOTEL PROPERTY RELATIONS
;; =================================================================================

(instance propertyAmenity BinaryPredicate)
(documentation propertyAmenity EnglishLanguage "(&%propertyAmenity ?AGENT ?PHYS) means
that &Agent ?AGENT provides &%Physical ?PHYS on its property")
(termFormat EnglishLanguage propertyAmenity "property amenity")

(domain propertyAmenity 1 Agent)
(domainSubclass propertyAmenity 2 Physical)

(=>
  (and
    (customer ?CUST ?AGENT)
    (propertyAmenity ?AGENT ?PHYS)
    (subclass ?PHYS Object)
    (instance ?X ?PHYS))
  (confersRight
    (exists (?PROC)
      (and
        (instance ?PROC Process)
        (or
          (resource ?PROC ?X)
          (instrument ?PROC ?X)
          (patient ?PROC ?X))
        (or
          (agent ?PROC ?CUST)
          (experiencer ?PROC ?CUST)))) ?AGENT ?CUST))
      
(=>
  (and
    (customer ?CUST ?AGENT)
    (propertyAmenity ?AGENT ?PHYS)
    (subclass ?PHYS Process))
  (modalAttribute
    (exists (?S ?LOC)
      (and
        (element ?LOC (PropertyFn ?AGENT))
        (agent ?S ?HOTEL)
        (or
          (instance ?S ?PHYS)
          (and
            (instance ?PROC ?PHY)
            (subProcess ?S ?PROC)))
        (located ?S ?LOC))) Possibility))

(subrelation freePropertyAmenity propertyAmenity)
(documentation freePropertyAmenity EnglishLanguage "(&%freePropertyAmenity ?AGENT ?PHYS)
means that &%Agent ?AGENT provides &%Physical ?PHYS at no additional cost")
(termFormat EnglishLanguage freePropertyAmenity "free property amenity")

(=>
  (and
    (freePropertyAmenity ?AGENT ?PHYS)
    (instance ?X ?PHYS)
    (customer ?CUST ?AGENT)
    (or
      (and
        (instance ?X Process)
        (or
          (agent ?X ?CUST)
          (experiencer ?X ?CUST)))
      (and
        (possesses ?AGENT ?X)
        (instance ?X Object)
        (uses ?CUST ?X))))
  (price ?X (MeasureFn 0 UnitedStatesDollar) ?AGENT))
  
(subrelation paidPropertyAmenity propertyAmenity)
(documentation paidPropertyAmenity EnglishLanguage "(&%paidPropertyAmenity ?AGENT ?PHYS)
means that &%Agent ?AGENT provides &%Physical ?PHYS at additional cost")
(termFormat EnglishLanguage paidPropertyAmenity "paid property amenity")

(=>
  (and
    (paidPropertyAmenity ?AGENT ?PHYS)
    (instance ?X ?PHYS)
    (customer ?CUST ?AGENT)
    (or
      (and
        (instance ?X Process)
        (or
          (agent ?X ?CUST)
          (experiencer ?X ?CUST)))
      (and
        (possesses ?AGENT ?X)
        (instance ?X Object)
        (uses ?CUST ?X))))
  (and
    (price ?X ?PRICE ?AGENT)
    (greaterThan ?PRICE (MeasureFn 0 UnitedStatesDollar))))
        
(instance activityCapability BinaryPredicate)
(documentation activityCapability EnglishLanguage "(&%activityCapability ?AGENT ?ACT)
means that &%Process ?ACT can be located on the property owned by &%Agent ?AGENT")
(termFormat EnglishLanguage activityCapability "activity capability")

(domain activityCapability 1 Agent)
(domainSubclass activityCapability 2 Process)

(=>
  (activityCapability ?AGENT ?ACT)
  (exists (?LOC)
    (and
      (element ?LOC (PropertyFn ?AGENT))
      (capability ?ACT located ?LOC))))
      
(instance propertyPolicy BinaryPredicate)
(documentation propertyPolicy EnglishLanguage "(&%propertyPolicy ?AGENT ?POLICY) means
that ?POLICY is a &%Policy with &%policyLocationCoverage that covers all elements of
&%PropertyFn ?AGENT")
(termFormat EnglishLanguage propertyPolicy "property policy")

(domain propertyPolicy 1 Agent)
(domain propertyPolicy 2 Policy)

(=>
  (propertyPolicy ?AGENT ?POLICY)
  (forall (?X)
    (=>
      (element ?X (PropertyFn ?AGENT))
      (policyLocationCoverage ?POLICY ?X))))
      
(instance orgStaff BinaryPredicate)
(documentation orgStaff EnglishLanguage "(&%orgStaff ?ORG ?POS) means that &%Agent
?ORG employs &%Human with &%Attribute ?POS")
(termFormat EnglishLanguage orgStaff "organization staff")

(domain orgStaff 1 Agent)
(domain orgStaff 2 RelationalAttribute)

(=>
  (orgStaff ?AGENT ?POS)
  (exists (?H)
    (and
      (employs ?AGENT ?H)
      (attribute ?H ?POS))))

(instance managedBy BinaryPredicate)
(documentation managedBy EnglishLanguage "(&%managedBy ?OBJ ?AGENT) means that 
&%Object ?OBJ is &%Managing by &%Agent ?AGENT.  ?AGENT may no necessarily own ?OBJ.")
(termFormat EnglishLanguage managedBy "managed by")

(domain managedBy 1 Physical)
(domain managedBy 2 Agent)

(=>
  (managedBy ?OBJ ?AGENT)
  (exists (?AGENT2 ?MAN)
    (and
      (possesses ?AGENT2 ?OBJ)
      (instance ?MAN Managing)
      (patient ?MAN ?OBJ)
      (agent ?MAN ?AGENT))))
      
(subclass InternetAddress ContactSite)

(instance checkInTime BinaryPredicate)
(documentation checkInTime EnglishLanguage "(&%checkInTime ?HOTEL ?TIME) means that
&%TravelerAccomodation ?HOTEL only starts &%CheckInService after ?TIME")
(termFormat EnglishLanguage checkInTime "check-in time")

(domain checkInTime 1 Organization)
(domainSubclass checkInTime 2 TimePoint)

(=>
  (checkInTime ?HOTEL ?TIME)
  (modalAttribute
    (exists (?T ?C)
      (and
        (instance ?T ?TIME)
        (instance ?C CheckInService)
        (agent ?C ?HOTEL)
        (before (BeginFn (WhenFn ?C)) ?T))) Unlikely))
        
(instance checkOutTime BinaryPredicate)
(documentation checkOutTime EnglishLanguage "(&%checkOutTime ?HOTEL ?TIME) means that
&%TravelerAccommodation ?HOTEL expects guests to &%CheckOutService before ?TIME")
(termFormat EnglishLanguage checkOutTime "check-out time")

(=>
  (and
    (checkOutTime ?HOTEL ?TIME)
    (guest ?GUEST ?HOTEL))
  (expects ?HOTEL
    (exists (?T ?C)
      (and
        (instance ?T ?TIME)
        (patient ?C ?GUEST)
        (instance ?C CheckOutService)
        (agent ?C ?HOTEL)
        (before (BeginFn (WhenFn ?C)) ?T)))))

(instance numberOfFloors BinaryPredicate)
(documentation numberOfFloors EnglishLanguage "(&%numberOfFloors ?BLDG ?NUM) means 
that &%Building ?BLDG has &%Integer ?NUM number of &%BuildingLevel")
(termFormat EnglishLanguage numberOfFloors "number of floors")

(domain numberOfFloors 1 Building)
(domain numberOfFloors 2 Integer)

(=>
  (numberOfFloors ?BLDG ?NUM)
  (exists (?FLOORS)
    (and
      (forall (?X)
        (=>
          (and
            (instance ?X BuildingLevel)
            (part ?X ?BLDG))
          (member ?X ?FLOORS)))
      (memberCount ?FLOORS ?NUM))))

(instance yearBuilt BinaryPredicate)
(documentation yearBuilt EnglishLanguage "(&%yearBuilt ?OBJ ?YEAR) means that the 
&%Making of &%Object ?OBJ was completed on &%Year ?YEAR")
(termFormat EnglishLanguage yearBuilt "year built")

(domain yearBuilt 1 Object)
(domainSubclass yearBuilt 2 Year)

(=>
  (yearBuilt ?OBJ ?YEAR)
  (exists (?TIME ?MAKE)
    (and
      (instance ?TIME ?YEAR)
      (instance ?MAKE Making)
      (result ?MAKE ?OBJ)
      (temporallyBetweenOrEqual
        (BeginFn ?TIME)
        (EndFn (WhenFn ?REPAIR))
        (EndFn ?TIME)))))
      
        
(instance lastRenovation BinaryPredicate)
(documentation lastRenovation EnglishLanguage "(&%lastRenovation ?OBJ ?YEAR) means
that &%Object ?OBJ was last repaired on &%Year ?YEAR")    
(termFormat EnglishLanguage lastRenovation "last renovation")

(domain lastRenovation 1 Object)
(domainSubclass lastRenovation 2 Year)

(=>
  (lastRenovation ?OBJ ?YEAR)
  (exists (?TIME ?REPAIR)
    (and
      (instance ?REPAIR Repairing)
      (patient ?REPAIR ?OBJ)
      (instance ?TIME ?YEAR)
      (temporallyBetweenOrEqual
        (BeginFn ?TIME)
        (EndFn (WhenFn ?REPAIR))
        (EndFn ?TIME)))))

(instance colocatedAgent BinaryPredicate)
(documentation colocatedAgent EnglishLanguage "(&%colocatedAgent ?ORG1 ?ATTR1)
means that an &%Organization with &%Attribute ?ATTR1 is colocated with ?ORG1")
(termFormat EnglishLanguage colocatedAgent "colocated business")

(domain colocatedAgent 1 Agent)
(domain colocatedAgent 2 RelationalAttribute)

(=>
  (colocatedAgent ?ORG ?ATTR)
  (exists (?ORG2 ?LOC)
    (and
      (instance ?ORG2 Agent)
      (attribute ?ORG2 ?ATTR)
      (located ?ORG ?LOC)
      (located ?ORG2 ?LOC))))
   
        
;; TO HOTEL FUNCTION ROOM
;; =================================================================================

;; proposition here actually refers more to the design or arrangement of the room
(instance capacityByArrangement TernaryPredicate)
(documentation capacityByArrangement EnglishLanguage "(&%capacityByArrangement ?AREA 
?PROP ?QTY) means that &%Integer ?QTY is the maximum capacity of &%Region ?AREA when
&%Proposition ?PROP is followed.")
(termFormat EnglishLanguage capacityByArrangement "capacity by arrangement")

(domain capacityByArrangement 1 Region)
(domain capacityByArrangement 2 Proposition)
(domain capacityByArrangement 3 Integer)

(=>
  (capacityByArrangement ?AREA ?PROP ?INT)
  (=>
    (represents ?AREA ?PROP)
    (modalAttribute
      (exists (?GRP)
        (and
          (instance ?GRP GroupOfPeople)
          (memberCount ?GRP ?PPL)
          (lessThanOrEqualTo ?PPL ?INT)
          (located ?GRP ?AREA))) Possibility)))
          
(instance functionRoomAmenity BinaryPredicate)
(documentation functionRoomAmenity EnglishLanguage "(&%functionRoomAmenity ?RM ?PHYS)
means that &%Physical ?PHYS is available for people who &%Renting &%HotelFunctionRoom 
?RM")
(termFormat EnglishLanguage functionRoomAmenity "function room amenity")

(domainSubclass functionRoomAmenity 1 HotelFunctionRoom)
(domainSubclass functionRoomAmenity 2 Physical)

(=>
  (and
    (functionRoomAmenity ?FR ?PHY)
    (instance ?RM ?FR)
    (element ?RM (PropertyFn ?HOTEL))
    (instance ?RENT Renting)
    (patient ?RENT ?RM)
    (agent ?RENT ?HOTEL)
    (destination ?RENT ?CUST)
    (subclass ?PHY Object))
  (modalAttribute
    (exists (?O ?P)
      (and
        (instance ?O ?PHY)
        (instance ?P Process)
        (or
          (resource ?P ?O)
          (instrument ?P ?O)
          (patient ?P ?O))
        (or
          (agent ?P ?CUST)
          (experiencer ?P ?CUST)))) Possibility))

(subrelation freeFunctionRoomAmenity functionRoomAmenity)
(documentation freeFunctionRoomAmenity EnglishLanguage "(&%freeFunctionRoomAmenity
?RM ?PHY) means that the use of ?PHY provided by &%TravelerAccommodation to customers
renting &%HotelFunctionRoom does not incur charges")
(termFormat EnglishLanguage freeFunctionRoomAmenity "free function room amenity")

(=>
  (and
    (freeFunctionRoomAmenity ?FR ?PHYS)
    (instance ?RM ?FR)
    (element ?RM (PropertyFn ?AGENT))
    (instance ?R Renting)
    (patient ?R ?RM)
    (destination ?R ?CUST)
    (instance ?X ?PHYS)
    (possesses ?AGENT ?X)
    (customer ?CUST ?AGENT)
    (or
      (and
        (instance ?X Process)
        (or
          (agent ?X ?CUST)
          (experiencer ?X ?CUST)))
      (and
        (possesses ?AGENT ?X)
        (instance ?X Object)
        (uses ?CUST ?X))))
  (price ?X (MeasureFn 0 UnitedStatesDollar) ?AGENT))

(subrelation paidFunctionRoomAmenity functionRoomAmenity)
(documentation paidFunctionRoomAmenity EnglishLanguage "(&%paidFunctionRoomAmenity
?RM ?PHY) means that the use of ?PHY provided by &%TravelerAccommodation to customers
renting &%HotelFunctionRoom incurs charges")
(termFormat EnglishLanguage paidFunctionRoomAmenity "free function room amenity")

(=>
  (and
    (paidFunctionRoomAmenity ?FR ?PHYS)
    (instance ?RM ?FR)
    (element ?RM (PropertyFn ?AGENT))
    (instance ?R Renting)
    (patient ?R ?RM)
    (destination ?R ?CUST)
    (instance ?X ?PHYS)
    (possesses ?AGENT ?X)
    (customer ?CUST ?AGENT)
    (or
      (and
        (instance ?X Process)
        (or
          (agent ?X ?CUST)
          (experiencer ?X ?CUST)))
      (and
        (possesses ?AGENT ?X)
        (instance ?X Object)
        (uses ?CUST ?X))))
  (and
    (price ?X ?PRICE ?AGENT)
    (greaterThan ?PRICE (MeasureFn 0 UnitedStatesDollar))))
  
;; LOCATION RELATIONS
;; =================================================================================

(instance nearOrientation BinaryPredicate)
(documentation nearOrientation EnglishLanguage "(&%nearOrientation ?OBJ1 ?OBJ2) means
that ?OBJ1 has &%orientation &%Near to ?OBJ2")
(termFormat EnglishLanguage nearOrientation "near orientation")

(domain nearOrientation 1 Physical)
(domainSubclass nearOrientation 2 Physical)

(=>
  (nearOrientation ?OBJ1 ?OBJ2)
  (exists (?X)
    (and
      (instance ?X ?OBJ2)
      (orientation ?OBJ1 ?X Near))))

(instance onOrientation BinaryPredicate)
(documentation onOrientation EnglishLanguage "(&%onOrientation ?OBJ1 ?OBJ2) means
that ?OBJ1 has &%orientation &%On ?OBJ2")
(termFormat EnglishLanguage onOrientation "on orientation")

(domain onOrientation 1 Physical)
(domainSubclass onOrientation 2 Physical)

(=>
  (onOrientation ?OBJ1 ?OBJ2)
  (exists (?X)
    (and
      (instance ?X ?OBJ2)
      (orientation ?OBJ1 ?X On))))
      
(instance adjacentOrientation BinaryPredicate)
(documentation adjacentOrientation EnglishLanguage "(&%adjacentOrientation ?OBJ1 ?OBJ2)
means that ?OBJ1 has &%orientation &%Adjacent to ?OBJ2")
(termFormat EnglishLanguage adjacentOrientation "adjacent orientation")

(=>
  (adjacentOrientation ?OBJ1 ?OBJ2)
  (exists (?X)
    (and
      (instance ?X ?OBJ2)
      (orientation ?OBJ1 ?X Adjacent))))

(instance viewType BinaryPredicate)
(documentation viewType EnglishLanguage "(&%viewType ?REGION ?OBJ) means that a person
in ?REGION can see ?OBJ")
(termFormat EnglishLanguage viewType "view type")

(domain viewType 1 Object)
(domainSubclass viewType 2 Physical)

(=>
  (and
    (viewType ?ROOM ?OBJ)
    (instance ?ROOM Room)
    (orientation ?OBJ ?ROOM Outside))
  (modalAttribute
    (exists (?HUMAN ?SEE ?INST)
      (and
        (instance ?HUMAN Human)
        (located ?HUMAN ?ROOM)
        (instance ?SEE Seeing)
        (instance ?INST ?OBJ)
        (patient ?SEE ?INST)
        (agent ?SEE ?HUMAN))) Possibility))

;; ---------------------------------------------------------------------------------
;; Rooms
;; ---------------------------------------------------------------------------------
      
(subclass HotelRoomAttribute RelationalAttribute)
(documentation HotelRoomAttribute EnglishLanguage "&%HotelRoomAttribute gives descriptions
about &%HotelUnit")
(termFormat EnglishLanguage HotelRoomAttribute "hotel room attribute")

(=>
  (and
    (attribute ?X ?Y)
    (instance ?Y HotelRoomAttribute))
  (instance ?X HotelUnit))

(instance StandardRoom HotelRoomAttribute)
(documentation StandardRoom EnglishLanguage "&%StandardRoom describes the most basic 
room type offered by the hotel.  It is mean to describe a room in relation to other
rooms in the same hotel as opposed to the same type of room in a different hotel")
(termFormat EnglishLanguage StandardRoom "standard room")
(successorAttributeClosure StandardRoom SuiteRoom)

(instance DeluxeRoom HotelRoomAttribute)
(documentation DeluxeRoom EnglishLanguage "&%DeluxeRoom describes a room that has 
better amenities, furnishing, size or location than a standard room")
(termFormat EnglishLanguage DeluxeRoom "deluxe room")
(successorAttribute StandardRoom DeluxeRoom)

(instance SuiteRoom HotelRoomAttribute)
(documentation SuiteRoom EnglishLanguage "&%SuiteRoom describes a room that has 
defined areas apart from the sleeping area.  Sometimes, &%SuiteRoom have more than one
&%Room within it")
(termFormat EnglishLanguage SuiteRoom "suite")
(successorAttribute DeluxeRoom SuiteRoom)

(=>
  (attribute ?X SuiteRoom)
  (exists (?AREA)
    (and
      (instance ?AREA SittingArea)
      (located ?AREA ?X))))

(instance ChildrenSuite HotelRoomAttribute)
(documentation ChildrenSuite EnglishLanguage "&%ChildrenSuite describes a room that
is meant for &%HumanChild to stay in")
(termFormat EnglishLanguage ChildrenSuite "children's suite")

(=>
  (attribute ?X ChildrenSuite)
  (hasPurpose ?X 
    (exists (?CHILD)
      (and
        (instance ?CHILD HumanChild)
        (stays ?CHILD ?X)))))        
        
(instance FemaleExecutiveRoom HotelRoomAttribute)
(documentation FemaleExecutiveRoom EnglishLanguage "&%FemaleExecutiveRoom describes a
room that has been designed for the female executive")
(termFormat EnglishLanguage FemaleExecutiveRoom "female executive room")

(=>
  (attribute ?X FemaleExecutiveRoom)
  (hasPurpose ?X
    (exists (?HUMAN)
      (and
        (instance ?HUMAN Human)
        (attribute ?HUMAN Female)
        (attribute ?HUMAN BusinessExecutive)
        (stays ?HUMAN ?X)))))

(instance DownAndInRoom HotelRoomAttribute)
(documentation DownAndInRoom EnglishLanguage "&%DownAndInRoom describes a &%HotelUnit
that has its entrance and exit inside the &%HotelBuilding")
(termFormat EnglishLanguage DownAndInRoom "down and in room")

(=>        
  (attribute ?X DownAndInRoom)
  (exists (?LOC ?INDOOR)
    (and
      (instance ?INDOOR Indoors)
      (instance ?LOC Region)
      (orientation ?LOC ?X Adjacent)
      (orientation ?LOC ?X Outside)
      (located ?LOC ?INDOOR))))

(instance DownAndOutRoom HotelRoomAttribute)
(documentation DownAndOutRoom EnglishLanguage "&%DownAndOutRoom describes a &%HotelUnit
that has its entrance and exit that lead &%Outdoors")
(termFormat EnglishLanguage DownAndOutRoom "down and out room")

(=>
  (attribute ?X DownAndOutRoom)
  (exists (?LOC ?OUTDOOR)
    (and
      (instance ?OUTDOOR Outdoors)
      (instance ?LOC Region)
      (orientation ?LOC ?X Adjacent)
      (orientation ?LOC ?X Outside)
      (located ?LOC ?OUTDOOR))))

(instance ThemeRoom HotelRoomAttribute)
(documentation ThemeRoom EnglishLanguage "&%ThemeRoom describes a &%HotelUnit that 
follows a certain style or theme of decor, for instance, a Disney-themed room would
have decor that represent creations from Disney")
(termFormat EnglishLanguage ThemeRoom "theme room")

(=>
  (attribute ?ROOM ThemeRoom)
  (exists (?DESIGN ?PROP)
    (and
      (instance ?DESIGN Designing)
      (result ?DESIGN ?PROP)
      (represents ?ROOM ?PROP))))

(instance TowerRoom HotelRoomAttribute)
(documentation TowerRoom EnglishLanguage "&%TowerRoom describes a &%HotelUnit that
is in the &%HighRise building of a (&%PropertyFn ?HOTEL)")
(termFormat EnglishLanguage TowerRoom "tower room")

(=>
  (attribute ?ROOM TowerRoom)
  (exists (?BLDG)
    (and
      (instance ?BLDG HighRise)
      (located ?ROOM ?BLDG))))

(instance WesternRoomStyle HotelRoomAttribute)
(documentation WesternRoomStyle EnglishLanguage "&%WesternRoomStyle describes a &%HotelUnit
that has a layout, furniture and decor that is aligned with Western culture")
(termFormat EnglishLanguage WesternRoomStyle "western room style")

(instance AsianRoomStyle HotelRoomAttribute)
(documentation AsianRoomStyle EnglishLanguage "&%AsianRoomStyle describes a 
&%HotelUnit that has a layout, furniture and decor that is aligned with Asian culture")
(termFormat EnglishLanguage AsianRoomStyle "asian room style")       

(instance CastleRoom HotelRoomAttribute)
(termFormat EnglishLanguage CastleRoom "castle room")

(instance AnnexRoom HotelRoomAttribute)
(documentation AnnexRoom EnglishLanguage "&%AnnexRoom is a &%HotelRoom that is not
located in the main building of a hotel, or the building of the hotel that has the
&%HotelFrontDesk")
(termFormat EnglishLanguage AnnexRoom "annex room")

(=>
  (and
    (element ?ROOM (PropertyFn ?HOTEL))
    (attribute ?ROOM AnnexRoom)
    (instance ?ROOM HotelRoom))
  (exists (?BLDG1 ?BLDG2 ?FRNT)
    (and
      (subOrganization ?FRNT ?HOTEL)
      (instance ?FRNT HotelFrontDesk)
      (located ?FRNT ?BLDG1)
      (element ?BLDG1 (PropertyFn ?HOTEL))
      (element ?BLDG2 (PropertyFn ?HOTEL))
      (part ?ROOM ?BLDG2)
      (not (equal ?BLDG1 ?BLDG2)))))

(subAttribute HoneymoonSuite SuiteRoom)
(documentation HoneymoonSuite EnglishLanguage "&%HoneymoonSuite is a &%SuiteRoom that is 
meant for newly married people who are on their honeymoon trip")
(termFormat EnglishLanguage HoneymoonSuite "honeymoon suite")

(instance LoftStyle RelationalAttribute)
(documentation LoftStyle EnglishLanguage "&%LoftStyle refers to how a &%StationaryArtifact
such as a &%Room or &%CondominiumUnit or &%Building has raised floor space above the 
ground that overlooks the the ground floor")
(termFormat EnglishLanguage LoftStyle "loft style")

(=>
  (attribute ?X LoftStyle)
  (instance ?X StationaryArtifact))

(=>
  (attribute ?X LoftStyle)
  (exists (?FLOOR ?LOFT ?CEILING)
    (and
      (bottom ?FLOOR ?X)
      (top ?CEILING ?X)
      (instance ?LOFT StationaryArtifact)
      (orientation ?LOFT ?FLOOR Above)
      (orientation ?LOFT ?CEILING Below))))
            
(instance Oversized RelationalAttribute)
(documentation Oversized EnglishLanguage "&%Oversized means that something has a 
larger measure than normal")
(termFormat EnglishLanguage Oversized "oversized")

(=>
  (and
    (immediateInstance ?BIG ?CLASS)
    (immediateInstance ?NORMAL ?CLASS)
    (attribute ?BIG Oversized))
  (exists (?BIGSIZE ?NORMALSIZE)
    (and
      (measure ?BIG ?BIGSIZE)
      (measure ?NORMAL ?NORMALSIZE)
      (greaterThan ?BIGSIZE ?NORMALSIZE))))
      
(=>
  (and
    (attribute ?ROOM Oversized)
    (immediateInstance ?ROOM ?HOTELUNIT)
    (subclass ?HOTELUNIT HotelUnit))
  (exists (?NORMAL ?AREA1 ?AREA2)
    (and
      (immediateInstance ?NORMAL ?HOTELUNIT)
      (measure ?NORMAL ?AREA1)
      (measure ?ROOM ?AREA2)
      (instance ?AREA1 AreaMeasure)
      (instance ?AREA2 AreaMeasure)
      (greaterThan ?AREA2 ?AREA1))))
      
(subclass HotelLevelAttribute RelationalAttribute)
(documentation HotelLevelAttribute EnglishLanguage "&%HotelLevelAttribute are
attributes that describe certain &%BuildingLevels in a &%HotelBuilding")

(=>
  (and
    (attribute ?X ?Y)
    (instance ?Y HotelLevelAttribute))
  (and
    (instance ?X BuildingLevel)
    (exists (?BLDG)
      (and
        (instance ?BLDG HotelBuilding)
        (part ?X ?BLDG)))))

(instance ExecutiveLevel HotelLevelAttribute)
(documentation ExecutiveLevel EnglishLanguage "&%ExecutiveLevel refers to a &%BuildingLevel
in a &%HotelBuilding with &%HotelRooms that have been designed to accommodate the needs
of the &%BusinessExecutive")
(termFormat EnglishLanguage ExecutiveLevel "executive level")

(=>
  (attribute ?X ExecutiveLevel)
  (forall (?Y)
    (=>
      (and
        (instance ?Y HotelRoom)
        (located ?Y ?X))
      (hasPurpose ?Y
        (exists (?HUMAN)
          (and
            (attribute ?HUMAN BusinessExecutive)
            (instance ?HUMAN Human)
            (stays ?HUMAN ?Y)))))))

(instance ExclusiveFemaleLevel HotelLevelAttribute)
(documentation ExclusiveFemaleLevel EnglishLanguage "&%ExclusiveFemaleLevel refers to
a &%BuildingLevel in a &%HotelBuilding that &%hasPurpose to house &%Female &%guest")
(termFormat EnglishLanguage ExclusiveFemaleLevel "female level")

(=>
  (attribute ?X ExclusiveFemaleLevel)
  (forall (?Y)
    (=>
      (and
        (instance ?Y HotelRoom)
        (located ?Y ?X))
      (hasPurpose ?Y
        (exists (?HUMAN)
          (and
            (attribute ?HUMAN Female)
            (stays ?HUMAN ?Y)))))))

(instance ClubLevel HotelLevelAttribute)
(documentation ClubLevel EnglishLanguage "&%ClubLevel refers to a &%BuildingLevel in 
a &%HotelBuilding that provides superior levels of service and security for a premium
price")
(termFormat EnglishLanguage ClubLevel "club level")
        
;; ---------------------------------------------------------------------------------
;; General Concepts
;; ---------------------------------------------------------------------------------

      
;; if a GroupOfPeople has an adult and a baby in it, then a Crib is within the 
;; adult's scope of interest

(=>
  (and
    (instance ?GRP GroupOfPeople)
    (member ?ADULT ?GRP)
    (member ?BABY ?GRP)
    (instance ?BABY HumanBaby)
    (instance ?ADULT HumanAdult)
    (instance ?CRIB Crib))
  (inScopeOfInterest ?ADULT ?CRIB))

(subclass Brand ContentBearingPhysical)
(documentation Brand EnglishLanguage "&%Brand refers to a unique design, sign, symbol,
name or a combination of these that is employed in creating an image that identifies 
a product that differentiates it from its competitors (BusinessDictionary.com)")
(termFormat EnglishLanguage Brand "brand")

(=>
  (instance ?BRAND Brand)
  (exists (?OBJ)
    (and
      (instance ?OBJ Object)
      (productBrand ?BRAND ?OBJ))))

(=>
  (instance ?BRAND Brand)
  (exists (?AGENT ?CREATION)
    (and
      (instance ?CREATION Creation)
      (result ?CREATION ?BRAND)
      (agent ?CREATION ?AGENT))))

(subrelation productBrand represents)
(documentation productBrand EnglishLanguage "(&%productBrand ?BRAND ?OBJ) means that 
the perception associated with &%Brand ?BRAND is reflected on &%Physical ?OBJ")
(termFormat EnglishLanguage productBrand "product brand")

(=>
  (productBrand ?BRAND ?OBJ)
  (instance ?BRAND Brand))
      
(instance brandIcon BinaryPredicate)
(documentation brandIcon EnglishLanguage "(&%brandIcon ?BRAND ?ICON) means that &%Icon
?ICON is associated with &%Brand ?BRAND")
(termFormat EnglishLanguage brandIcon "brand icon")

(domain brandIcon 1 Brand)
(domain brandIcon 2 Icon)

(=>
  (brandIcon ?BRAND ?ICON)
  (exists (?AGENT)
    (and
      (managedBy ?BRAND ?AGENT)
      (managedBy ?ICON ?AGENT)
      (represents ?ICON ?BRAND))))

(instance subBrand BinaryPredicate)
(documentation subBrand EnglishLanguage "(&%subBrand ?BRAND1 ?BRAND2) means that 
&%Brand ?BRAND2 uses the identity and reputation propagated by ?BRAND1 but is applied
to a more specific set of objects")
(termFormat EnglishLanguage subBrand "sub-brand")

(=>
  (subBrand ?BRAND1 ?BRAND2)
  (exists (?COLL ?OBJ)
    (and
      (instance ?COLL Collection)
      (represents ?BRAND1 ?COLL)
      (member ?OBJ ?COLL)
      (represents ?BRAND2 ?OBJ))))
      

;; additional rule for Internet

(=>
  (and
    (engineeringSubcomponent ?DEVICE1 Internet)
    (engineeringSubcomponent ?DEVICE2 Internet)
    (not (equal ?DEVICE1 ?DEVICE2)))
  (hasPurpose Internet
    (exists (?COMM)
      (and
        (instance ?COMM Communication)
        (agent ?COMM ?DEVICE1)
        (destination ?COMM ?DEVICE2)
        (instrument ?COMM Internet)))))
          
(subclass InternetAccessPoint Device)
(documentation InternetAccessPoint EnglishLanguage "&%InternetAccessPoint refers to 
a &%Device that allows another &%Device to access and use the &%Internet")
(termFormat EnglishLanguage InternetAccessPoint "internet access point")

(=>
  (and
    (instance ?AP InternetAccessPoint)
    (instance ?DEVICE Device))
  (holdsDuring
    (WhenFn (connectedEngineeringComponents ?DEVICE ?AP))
    (engineeringSubcomponent ?DEVICE Internet)))

(subclass Modem InternetAccessPoint)
(documentation Modem EnglishLanguage "&%Modem is a device used by computers to
connect computers to the internet using a telephone line")
(termFormat EnglishLanguage Modem "modem")

(=>
  (instance ?X Modem)
  (hasPurpose ?X
    (exists (?ISP ?CONN)
      (and
        (instance ?ISP InternetServiceProvider)
        (connectsEngineeringComponents ?CONN ?X ?ISP)
        (instance ?CONN TelephoneLine)))))
    
(subclass InternetConnection EngineeringConnection)
(documentation InternetConnection EnglishLanguage "&%InternetConnection refers to 
the medium or channel by which a device is &%connected to an &%InternetAccessPoint")
(termFormat EnglishLanguage InternetConnection "internet connection")

(=>
  (and
    (connectsEngineeringComponents ?CONN ?DEVICE ?AP)
    (instance ?AP InternetAccessPoint))
  (instance ?CONN InternetConnection))
  
(subclass Cable EngineeringConnection)
(documentation Cable EnglishLanguage "&%Cable refers to an &%EngineeringConnection 
made of &%WireLine")
(termFormat EnglishLanguage Cable "cable")

(=>
  (instance ?C Cable)
  (exists (?WIRE)
    (and
      (instance ?WIRE WireLine)
      (part ?WIRE ?C))))
      
(subclass WiredInternetConnection InternetConnection)
(documentation WiredInternetConnection EnglishLanguage "&%WiredInternetConnection is 
an &%InternetConnection that uses &%Cable to connect two devices together")
(termFormat EnglishLanguage WiredInternetConnection "internet")

(=>
  (instance ?CONN WiredInternetConnection)
  (exists (?CABLE)
    (and
      (part ?CABLE ?CONN)
      (instance ?CABLE Cable))))
      
(subclass WirelessInternetConnection InternetConnection)
(documentation WirelessInternetConnection EnglishLanguage "&%WirelessInternetConnection
is an &%InternetConnection that does not use cables to connect to the 
&%InternetAccessPoint")
(termFormat EnglishLanguage WirelessInternetConnection "wireless internet")

(=>
  (instance ?CONN WirelessInternetConnection)
  (not 
    (exists (?CABLE)
      (and
        (part ?CABLE ?CONN)
        (instance ?CABLE Cable)))))
        
(subclass Casino StationaryArtifact)
(documentation Casino EnglishLanguage "&%Casino is a type of &%StationaryArtifact that
has the purpose of housing gambling activities")

(=>
  (instance ?X Casino)
  (hasPurpose ?X
    (exists (?GAME ?BET)
      (and
        (instance ?GAME Game)
        (located ?GAME ?X)
        (instance ?BET Betting)
        (subProcess ?BET ?GAME)))))

;; naics.kif: CasinoHotels

(=>
  (and
    (attribute ?X TravelerAccommodation)
    (element ?CASINO (PropertyFn ?X))
    (instance ?CASINO Casino))
  (attribute ?X CasinoHotels))


      
(instance DutyFree NormativeAttribute)
(documentation DutyFree EnglishLanguage "&%DutyFree describes how &%DutyTax is not
charged for an imported product")
(termFormat EnglishLanguage DutyFree "duty free")        
        
(=>
  (and
    (attribute ?X DutyFree)
    (instance ?X Product))
  (not 
    (exists (?DUTY)
      (and
        (instance ?DUTY DutyTax)
        (patient ?DUTY ?X)))))

(=>
  (and
    (attribute ?X DutyFree)
    (instance ?X Store))
  (forall (?OBJ)
    (=>
      (and
        (instance ?SELL Selling)
        (patient ?SELL ?OBJ)
        (located ?SELL ?X)
        (instance ?OBJ Product))
      (attribute ?OBJ DutyFree))))  

      
;; axiom for temperature control as a physical amenity      
(=>
  (roomAmenity ?HR TemperatureControl)
  (exists (?DEVICE ?ROOM ?TEMP)
    (and
      (instance ?ROOM ?HR)
      (instance ?DEVICE AirConditioner)
      (instance ?TEMP TemperatureControl)
      (located ?TEMP ?ROOM)
      (part ?TEMP ?DEVICE))))


;; additional axiom for InRoom movies
(=>
  (roomAmenity ?ROOM MotionPicture)
  (exists (?R ?MS ?MP)
    (and
      (instance ?R ?ROOM)
      (instance ?MS MediaSystem)
      (located ?MS ?R)
      (instance ?MP MotionPicture)
      (modalAttribute
        (exists (?RL)
          (and
            (instance ?RL RadiatingLight)
            (instrument ?RL ?MS)
            (patient ?RL ?MP))) Possibility))))

;; axiom for hotel employing a tennis professional  
(=>
  (and
    (employs ?HOTEL ?ATHLETE)
    (attribute ?HOTEL TravelerAccommodation)
    (attribute ?ATHLETE TennisProfessional)
    (guest ?CUST ?HOTEL))
  (modalAttribute
    (exists (?TENNIS ?LOC)
      (and
        (instance ?TENNIS Tennis)
        (contestParticipant ?TENNIS ?ATHLETE)
        (contestParticipant ?TENNIS ?CUST)
        (located ?TENNIS ?LOC)
        (located ?HOTEL ?LOC))) Possibility))
            
;; ---------------------------------------------------------------------------------
;; Food
;; --------------------------------------------------------------------------------- 

(subclass MealPlan Proposition)
(documentation MealPlan EnglishLanguage "&%MealPlan refers to the &%Meal that are 
included in a particular stay at a &%TravelerAccommodation")
(termFormat EnglishLanguage MealPlan "meal plan")
      
(instance includedMeal BinaryPredicate)
(documentation includedMeal EnglishLanguage "(&%includedMeal ?PLAN ?ATTR ?TIME) indicates
that the ?ATTR type of &%Meal is available at ?TIME according to ?PLAN")
(termFormat EnglishLanguage includedMeal "included meal")

(domain includedMeal 1 MealPlan)
(domain includedMeal 2 RelationalAttribute)

;; if a room has an associated mealplan that indicates included meals, then while 
;; there is a guest staying in that room, there is a meal available at the stated
;; time intervals for that guest to consume (if he wants to) 

(=>
  (and
    (offers ?HOTEL ?MP)
    (instance ?MP MealPlan)
    (includedMeal ?MP ?ATTR)
    (attribute ?HOTEL TravelerAccommodation)
    (guest ?GUEST ?HOTEL)
    (buys ?GUEST ?HOTEL ?MP))
  (holdsDuring
    (WhenFn (guest ?GUEST ?HOTEL))
    (exists (?TI)
      (holdsDuring ?TI
        (exists (?MEAL)
          (and
            (attribute ?MEAL ?ATTR)
            (hasPurpose ?MEAL
              (exists (?E)
                (and
                  (instance ?E Eating)
                  (agent ?E ?GUEST)
                  (patient ?E ?MEAL))))))))))

(subclass FullBoard MealPlan)
(documentation FullBoard EnglishLanguage "&%FullBoard is an arrangement in which a
&%TravelerAccommodation provides breakfast, lunch, and dinner")
(termFormat EnglishLanguage FullBoard "full board")

(=>
  (instance ?X FullBoard)
  (and
    (includedMeal ?X Breakfast)
    (includedMeal ?X Lunch)
    (includedMeal ?X Dinner)))

(subclass HalfBoard MealPlan)
(documentation HalfBoard EnglishLanguage "&%HalfBoard is an arrangement in which a 
&%TravelerAccommodation provides breakfast and dinner, but no meal at lunchtime")
(termFormat EnglishLanguage HalfBoard "half board")

(=>
  (instance ?X HalfBoard)
  (and
    (includedMeal ?X Breakfast)
    (includedMeal ?X Dinner)))

(subclass MealPlanEuropean MealPlan)
(documentation MealPlanEuropean EnglishLanguage "&%MealPlanEuropean describes an 
arrangement where no meals are provided for by the &%TravelerAccommodation")
(termFormat EnglishLanguage MealPlanEuropean "european meal plan")

(=>
  (instance ?X MealPlanEuropean)
  (not
    (exists (?ATTR)
      (includedMeal ?X ?ATTR))))

(subclass MealPlanContinental MealPlanBreakfast)
(documentation MealPlanContinental EnglishLanguage "&%MealPlanContinental is an arrangement 
in which a  &%TravelerAccommodation provides a continental breakfast")
(termFormat EnglishLanguage MealPlanContinental "continental meal plan")

(=>
  (instance ?X MealPlanContinental)
  (includedMeal ?X ContinentalBreakfast))
  
(subclass MealPlanBreakfast MealPlan)
(documentation MealPlanBreakfast EnglishLanguage "&%MealPlanBreakfast is an arrangement 
in which a  &%TravelerAccommodation provides a &%Breakfast")
(termFormat EnglishLanguage MealPlanBreakfast "breakfast meal plan")

(=>
  (instance ?X MealPlanBreakfast)
  (includedMeal ?X Breakfast))  

(subclass MealPlanModifiedAmerican MealPlan)
(documentation MealPlanModifiedAmerican EnglishLanguage "&%MealPlanModifiedAmerican is 
an arrangement in which a &%TravelerAccommodation provides 2 &%Meal, &%Breakfast
and either &Lunch or &%Dinner")
(termFormat EnglishLanguage MealPlanBreakfast "modified american meal plan")

(=>
  (instance ?X MealPlanModifiedAmerican)
  (and
    (includedMeal ?X Breakfast)
    (or
      (includedMeal ?X Dinner)
      (includedMeal ?X Lunch))))
      
;; ---------------------------------------------------------------------------------
;; Facilities
;; --------------------------------------------------------------------------------- 

(subclass BusinessCenter Room)
(documentation BusinessCenter EnglishLanguage "&%BusinessCenter is a type of facility
that is equipped with different objects that allow a person to do his &%Working")
(termFormat EnglishLanguage BusinessCenter "business center")

(=>
  (instance ?X BusinessCenter)
  (hasPurpose ?X
    (exists (?PERSON ?WORK ?OBJ)
      (and
        (instance ?PERSON BusinessPerson)
        (instance ?WORK Working)
        (instance ?OBJ Object)
        (located ?OBJ ?X)
        (agent ?WORK ?PERSON)
        (or
          (instrument ?WORK ?OBJ)
          (resource ?WORK ?OBJ)
          (patient ?WORK ?OBJ))))))

(=>
  (instance ?X BusinessCenter)
  (modalAttribute
    (exists (?COMP)
      (and
        (instance ?COMP Computer)
        (located ?COMP ?X))) Likely))
        
(=>
  (instance ?X BusinessCenter)
  (modalAttribute
    (exists (?IC)
      (and
        (instance ?IC InternetConnection)
        (located ?IC ?X))) Likely))

(subclass HotelFunctionRoom Room)
(documentation HotelFunctionRoom EnglishLanguage "&%HotelFunctionRoom is a &%Room found
in a &%HotelBuilding that is rented out and can be used for virtually any purpose.")
(termFormat EnglishLanguage HotelFunctionRoom "hotel function room")

(=>
  (instance ?X HotelFunctionRoom)
  (exists (?HOTEL)
    (element ?X (PropertyFn ?HOTEL))))
    
(=>
  (and
    (instance ?X HotelFunctionRoom)
    (element ?X (PropertyFn ?HOTEL)))
  (hasPurpose ?X
    (exists (?RENT)
      (and
        (instance ?RENT Renting)
        (patient ?RENT ?X)))))
        
(=>
  (instance ?X HotelFunctionRoom)
  (modalAttribute
    (exists (?MTG)
      (and
        (instance ?MTG FormalMeeting)
        (located ?MTG ?X))) Possibility))

;; ---------------------------------------------------------------------------------
;; Amenities
;; ---------------------------------------------------------------------------------

(subclass HotelMiniBar Collection)
(documentation HotelMiniBar EnglishLanguage "&%HotelMiniBar is a &%Collection of 
(&%FoodForFn &%Human) that is available for a certain price")
(termFormat EnglishLanguage HotelMiniBar "mini bar")

(=>
  (instance ?X HotelMiniBar)
  (memberType ?X (FoodForFn Human)))
  
(=>
  (roomAmenity ?X HotelMiniBar)
  (exists (?ROOM ?BAR ?HOTEL)
    (and
      (instance ?ROOM ?X)
      (element ?ROOM (PropertyFn ?HOTEL))
      (instance ?BAR HotelMiniBar)
      (located ?BAR ?ROOM)
      (forall (?ITEM)
        (=>
          (member ?ITEM ?BAR)
          (exists (?AMT)
            (price ?ITEM ?AMT ?HOTEL)))))))

(subclass HotelFrontDesk Organization)            
(documentation HotelFrontDesk EnglishLanguage "&%HotelFrontDesk is a &%subOrganization
of a &%TravelerAccommodation that takes charge of all &%CheckInService and
&%CheckOutService transactions.  They often do other miscellaneous things too at the
request of the hotel &%guest")
(termFormat EnglishLanguage HotelFrontDesk "front desk")

(=>
  (instance ?X HotelFrontDesk)
  (exists (?ORG)
    (and
      (attribute ?ORG TravelerAccommodation)
      (subOrganization ?X ?ORG))))
      
(=>
  (instance ?X HotelFrontDesk)
  (hasPurpose ?X
    (exists (?CHECK)
      (and
        (or
          (instance ?CHECK CheckInService)
          (instance ?CHECK CheckOutService))
        (agent ?CHECK ?X)))))
 
 
 
;; ---------------------------------------------------------------------------------
;; Services
;; ---------------------------------------------------------------------------------

;; additional rules for ServiceProcess
(=>
  (instance ?X ServiceProcess)
  (exists (?AGENT ?CUST)
    (and
      (serviceProvider ?X ?AGENT)
      (serviceRecipient ?X ?CUST)
      (not (equal ?AGENT ?CUST)))))

(subclass LaundryService ServiceProcess)
(documentation LaundryService EnglishLanguage "&%LaundryService refers to an agent
washing, drying, and (possibly) ironing articles of clothing")
(termFormat EnglishLanguage LaundryService "laundry service")

(=>
  (instance ?SVC LaundryService)
  (exists (?CLOTHES ?WASH ?DRY ?IRON)
    (and
      (instance ?CLOTHES Clothing)
      (patient ?SVC ?CLOTHES)
      (subProcess ?WASH ?SVC)
      (instance ?WASH Washing)
      (patient ?WASH ?CLOTHES)
      (result ?WASH (attribute ?CLOTHES Clean))
      (subProcess ?DRY ?SVC)
      (instance ?DRY Drying)
      (patient ?DRY ?CLOTHES)
      (instance ?IRON Ironing)
      (subProcess ?IRON ?SVC)
      (patient ?IRON ?CLOTHES)
      (before (BeginFn (WhenFn ?WASH)) (BeginFn (WhenFn ?DRY)))
      (before (BeginFn (WhenFn ?DRY)) (BeginFn (WhenFn ?IRON))))))

(subclass DryCleaningService ServiceProcess)
(documentation DryCleaningService EnglishLanguage "&%DryCleaningService refers to
cleaning of &%Clothing using some chemical solvent instead of water")
(termFormat EnglishLanguage DryCleaningService "dry-clean")

(=>
  (instance ?SVC DryCleaningService)
  (exists (?CLOTHES ?WATER ?CHEM)
    (and
      (instance ?CLOTHES Clothing)
      (not (instrument ?SVC ?WATER))
      (instance ?WATER Water)
      (instance ?CHEM ChemicalProduct)
      (instrument ?SVC ?CHEM)
      (patient ?SVC ?CLOTHES)
      (result ?SVC (attribute ?CLOTHES Clean)))))
            
(subclass ValetLaundryService ServiceProcess)
(documentation ValetLaundryService EnglishLanguage "&%ValetLaundryService refers to an
agent picking up clothing, performing &%LaundryService, and then delivering it back
to customer")
(termFormat EnglishLanguage ValetLaundryService "valet laundry")

(=>
  (instance ?SVC ValetLaundryService)
  (exists (?CUST ?AGENT ?LOC ?CLOTHES ?LAUNDRY ?PICKUP ?DELIVERY)
    (and
      (customer ?CUST ?AGENT)
      (stays ?CUST ?LOC)
      (agent ?SVC ?AGENT)
      (instance ?CLOTHES Clothing)
      (instance ?PICKUP Getting)
      (located ?PICKUP ?LOC)
      (patient ?PICKUP ?CLOTHES)
      (agent ?PICKUP ?AGENT)
      (or
        (instance ?LAUNDRY LaundryService)
        (instance ?LAUNDRY DryCleaningService))
      (agent ?LAUNDRY ?AGENT)
      (patient ?LAUNDRY ?CLOTHES)
      (instance ?DELIVERY DeliveryService)
      (patient ?DELIVERY ?CLOTHES)
      (destination ?DELIVERY ?LOC)
      (before (BeginFn (WhenFn ?PICKUP)) (BeginFn (WhenFn ?LAUNDRY)))
      (before (BeginFn (WhenFn ?LAUNDRY)) (BeginFn (WhenFn ?DELIVERY))))))

(subclass IroningService ServiceProcess)

(documentation IroningService EnglishLanguage "&%IroningService refers to a
&%ServiceProcess that includes the &%Ironing of some &%Clothing")
(termFormat EnglishLanguage IroningService "ironing service")

(=>
  (instance ?X IroningService)
  (exists (?IRON ?CLOTHES)
    (and
      (instance ?CLOTHES Clothing)
      (instance ?IRON Ironing)
      (patient ?IRON ?CLOTHES)
      (subProcess ?IRON ?X))))
      
(subclass ChildCareService Maintaining)
(subclass ChildCareService ServiceProcess)
(documentation ChildCareService EnglishLanguage "&%ChildCareService refers to 
an agent looking after children and babies")
(termFormat EnglishLanguage ChildCareService "child-care service")


(=>
  (instance ?SVC ChildCareService)
  (exists (?CHILD ?SITTER)
    (and
      (or
        (instance ?CHILD HumanChild)
        (instance ?CHILD HumanBaby))
      (serviceProvider ?SVC ?SITTER)
      (patient ?SVC ?CHILD)
      (not (parent ?CHILD ?SITTER)))))
      
(=>
  (capability ChildCareService agent ?X)
  (exists (?SITTER)
    (and
      (employs ?X ?SITTER)
      (capability ChildCareService serviceProvider ?SITTER))))
      
(=>
  (and
    (parent ?CHILD ?PARENT)
    (or
      (instance ?CHILD HumanChild)
      (instance ?CHILD HumanBaby)))
  (modalAttribute
    (exists (?CARE)
      (and
        (instance ?CARE ChildCareService)
        (desires ?PARENT ?CARE))) Possibility))

(=>
  (and
    (instance ?X Nursery)
    (element ?X (PropertyFn ?HOTEL))
    (attribute ?HOTEL TravelerAccommodation))
  (and
    (attribute ?X CommunalAttribute)
    (employs ?HOTEL ?NANNY)
    (hasPurpose ?NANNY
      (exists (?CARE)
        (and
          (instance ?CARE ChildCareService)
          (serviceProvider ?CARE ?NANNY))))))
                
(subclass Cleaning Maintaining)      
(documentation Cleaning EnglishLanguage "&%Cleaning refers to the &%Process of removing
dirt and arranging things")
(termFormat EnglishLanguage Cleaning "cleaning")

(=>
  (instance ?X Cleaning)
  (exists (?OBJ)
    (and
      (patient ?X ?OBJ)
      (holdsDuring
        (EndFn (WhenFn ?X))
        (attribute ?OBJ Clean)))))
        
(subclass RoomCleaningService ServiceProcess)
(documentation RoomCleaningService EnglishLanguage "&%RoomCleaningService refers to a 
&%Maid &%Cleaning an area such as a &%Room or &%House")
(termFormat EnglishLanguage RoomCleaningService "service")

(=>
  (instance ?X RoomCleaningService)
  (exists (?MAID ?PLACE ?CLEAN)
    (and
      (attribute ?MAID Maid)
      (serviceProvider ?X ?MAID)
      (located ?X ?PLACE)
      (subProcess ?CLEAN ?X)
      (instance ?CLEAN Cleaning)
      (patient ?CLEAN ?PLACE)
      (agent ?CLEAN ?MAID))))
     
(=>
  (and
    (attribute ?X TravelerAccommodation)
    (capability RoomCleaningService agent ?X))
  (exists (?MAID ?HOTELROOM)
    (and
      (employs ?X ?MAID)
      (attribute ?MAID Maid)
      (instance ?HOTELROOM HotelUnit)
      (part ?HOTELROOM (PropertyFn ?X))
      (capability RoomCleaningService patient ?HOTELROOM)
      (capability RoomCleaningService serviceProvider ?MAID))))   

(subclass TurndownService ServiceProcess)
(documentation TurndownService EnglishLanguage "&%TurndownService refers to a &%ServiceProcess
wherein a &%Bed is prepared for &%Sleeping by &%Folding the bed linen")
(termFormat EnglishLanguage TurndownService "turndown service")

(=>
  (instance ?X TurndownService)
  (exists (?FOLD ?BED ?SHEET)
    (and
      (instance ?FOLD Folding)
      (instance ?SHEET BedLinen)
      (instance ?BED Bed)
      (located ?SHEET ?BED)
      (patient ?FOLD ?SHEET)
      (subProcess ?FOLD ?X))))
      
(subclass RoomService ServiceProcess)
(documentation RoomService EnglishLanguage "&%RoomService refers to an agent delivering
PreparedFood that somebody has ordered to that person's &%HotelUnit")
(termFormat EnglishLanguage RoomService "room service")

(=>
  (instance ?SVC RoomService)
  (exists (?AGENT ?FOOD ?CUSTOMER ?RQST ?ORDER ?DELIVERY ?LOC)
    (and
      (customer ?CUSTOMER ?AGENT)
      (agent ?SVC ?AGENT)
      (instance ?RQST Requesting)
      (agent ?RQST ?CUSTOMER)
      (patient ?RQST ?ORDER)
      (represents ?ORDER ?FOOD)
      (instance ?FOOD PreparedFood)
      (located ?CUSTOMER ?LOC)
      (instance ?LOC HotelUnit)
      (instance ?DELIVERY DeliveryService)
      (patient ?DELIVERY ?FOOD)
      (destination ?DELIVERY ?LOC)
      (before 
        (BeginFn (WhenFn ?RQST))
        (BeginFn (WhenFn ?DELIVERY))))))
      
(subclass WakeUpService ServiceProcess)
(documentation WakeUpService EnglishLanguage "&%WakeUpService refers to an agent
performing some action (like a phone call or knocking on the door) to wake up a person")
(termFormat EnglishLanguage WakeUpService "wake-up service")

(=>
  (instance ?SVC WakeUpService)
  (hasPurpose ?SVC
    (exists (?WAKE ?CUST ?AGENT ?PROC)
      (and
        (agent ?SVC ?AGENT)
        (experiencer ?SVC ?CUST)
        (instance ?PROC IntentionalProcess)
        (agent ?PROC ?AGENT)
        (experiencer ?PROC ?CUST)
        (instance ?WAKE WakingUp)
        (experiencer ?WAKE ?CUST)
        (result ?PROC ?WAKE)))))

;; KJN: Moving this to Transportation.kif where we are starting to build different
;; types of Transportation Services... also generalizing it to Vehicle        
;;(subclass TransportationService ServiceProcess)
;;(documentation TransportationService EnglishLanguage "&%TransportationService refers to
;;how an agent that possesses some kind of ground vehicle transports people around")
;;(termFormat EnglishLanguage TransportationService "transportation service")        
        
;;(=>
;;  (instance ?SVC TransportationService)
;;  (exists (?VEHICLE ?AGENT ?TRANS ?CUST)
;;    (and
;;      (agent ?SVC ?AGENT)
;;      (possesses ?AGENT ?VEHICLE)
;;      (customer ?CUST ?AGENT)
;;      (instance ?VEHICLE Automobile)
;;      (instance ?TRANS Transportation)
;;      (agent ?TRANS ?AGENT)
;;      (patient ?TRANS ?CUST)
;;      (instrument ?TRANS ?VEHICLE)
;;      (subProcess ?TRANS ?SVC))))
      
(subclass ShuttleService TransportationService)
(documentation ShuttleService EnglishLanguage "&%ShuttleService refers to how an
agent that possesses some kind of Automobile takes people between an origin location to
some predefined locations")
(termFormat EnglishLanguage ShuttleService "shuttle")

(=>
  (instance ?SVC ShuttleService)
  (exists (?LIST ?VEHICLE ?AGENT)
    (and
      (agent ?SVC ?AGENT)
      (possesses ?AGENT ?VEHICLE)
      (instance ?VEHICLE Automobile)
      (instance ?LIST List)
      (forall (?X)
        (=>
          (inList ?X ?LIST)
          (and
            (instance ?X PostalPlace)
            (exists (?TRANSPORT)
              (and
                (instance ?TRANSPORT Transportation)
                (agent ?TRANSPORT ?AGENT)
                (instrument ?TRANSPORT ?VEHICLE)
                (destination ?TRANSPORT ?X)))))))))

(=>
  (instance ?SVC ShuttleService)
  (modalAttribute
    (exists (?GRP1 ?GRP2)
      (and
        (instance ?GRP1 GroupOfPeople)
        (instance ?GRP2 GroupOfPeople)
        (patient ?SVC ?GRP1)
        (patient ?SVC ?GRP2)
        (not (equal ?GRP1 ?GRP2)))) Possibility))
        
(subclass AirportShuttleService ShuttleService)
(documentation AirportShuttleService EnglishLanguage "&%AirportShuttleService is a
type of &%ShuttleService that has an &%Airport as one of its stops")
(termFormat EnglishLanguage AirportShuttleService "airport shuttle")

(=>
  (instance ?SVC AirportShuttleService)
  (exists (?AIRPORT ?TRANSPORT)
    (and 
      (instance ?AIRPORT Airport)
      (instance ?TRANSPORT Transportation)
        (or
          (destination ?TRANSPORT ?AIRPORT)
          (origin ?TRANSPORT ?AIRPORT)))))

(subclass TourService ServiceProcess)
(documentation TourService EnglishLanguage "&%TourService is the process of taking
customers to different &%TouristSite")
(termFormat EnglishLanguage TourService "tour service")

(=>
  (instance ?TOUR TourService)
  (exists (?SITE ?SUBTOUR)
    (and
      (instance ?SITE TouristSite)
      (instance ?SUBTOUR Translocation)
      (destination ?SUBTOUR ?SITE)
      (subProcess ?SUBTOUR ?TOUR))))

(subclass CurrencyExchangeService ServiceProcess)
(documentation CurrencyExchangeService EnglishLanguage "&%CurrencyExchangeService is a
type of service where some amount in a certain currency is exchange for an equivalent
amount in another currency")
(termFormat EnglishLanguage CurrencyExchangeService "currency exchange")

(=>
  (instance ?X CurrencyExchangeService)
  (exists (?AMT ?AMT1 ?CURR1 ?AMT2 ?CURR2 ?CUST)
    (and
      (agent ?X ?CUST)
      (not (equal ?CURR1 ?CURR2))
      (instance ?AMT CurrencyMeasure)
      (holdsDuring
        (WhenFn (StartFn ?X))
        (and
          (monetaryValue ?M1 ?AMT)
          (possesses ?CUST ?M1)
          (equal ?AMT (MeasureFn ?NUM1 ?CURR1))))
      (holdsDuring
        (WhenFn (EndFn ?X))
        (and
          (monetaryValue ?M2 ?AMT)
          (possesses ?CUST ?M2)
          (not (possesses ?CUST ?M1))
          (equal ?AMT (MeasureFn ?NUM2 ?CURR2)))))))
      
(subclass PhotocopyingService ServiceProcess)
(documentation PhotocopyingService EnglishLanguage "&%PhotocopyingService is a type of
&%ServiceProcess wherein a &%copy of a document is created for a customer")
(termFormat EnglishLanguage PhotocopyingService "photocopying")

(=>
  (instance ?X PhotocopyingService)
  (exists (?COPY)
    (and
      (instance ?COPY Copying)
      (subProcess ?COPY ?X))))
      
(=>
  (and
    (instance ?X PhotocopyingService)
    (serviceProvider ?X ?AGENT))
  (exists (?DEVICE)
    (and
      (instance ?DEVICE Device)
      (hasPurpose ?DEVICE
        (exists (?COPY)
          (and
            (instance ?COPY Copying)
            (instrument ?COPY ?DEVICE))))
      (possesses ?AGENT ?DEVICE)
      (instrument ?X ?DEVICE))))
      
(subclass CheckInService ServiceProcess)
(documentation CheckInService EnglishLanguage "&%CheckInService refers to the process
of informing a &%serviceProvider that the &%customer is ready for some &%Process
to begin")
(termFormat EnglishLanguage CheckInService "check-in service")

(=>
  (instance ?CHECK CheckInService)
  (exists (?AGENT ?CUST ?GREET ?SERVICE)
    (and
      (customer ?CUST ?AGENT)
      (serviceProvider ?CHECK ?AGENT)
      (instance ?GREET Greeting)
      (agent ?GREET ?CUST)
      (destination ?GREET ?AGENT)
      (subProcess ?GREET ?CHECK)
      (instance ?SERVICE Process)
      (agent ?SERVICE ?AGENT)
      (causes ?CHECK ?SERVICE))))

(subclass SelfServiceCheckIn CheckInService)
(documentation SelfServiceCheckIn EnglishLanguage "&%SelfServiceCheckIn is a type of
&%CheckInService that does not involve interfacing with a &%Human. Instead, some
automated process is put in place")
(termFormat EnglishLanguage SelfServiceCheckIn "self-service check-in")

(=>
  (instance ?CHECK SelfServiceCheckIn)
  (exists (?AGENT)
    (and
      (agent ?CHECK ?AGENT)
      (not (instance ?AGENT Human)))))
      
(subclass CheckOutService ServiceProcess)
(documentation CheckOutService EnglishLanguage "&%CheckOutService is a type of &%ServiceProcess
where a &%customer announces his departure, signalling the end of the core service
being offered to him.  This is normally where bills are settled")
(termFormat EnglishLanguage CheckOutService "check-out service")

(=>
  (instance ?CHECK CheckOutService)
  (exists (?CHECKIN)
    (and
      (instance ?CHECKIN CheckInService)
      (before 
        (BeginFn (WhenFn ?CHECKIN))
        (BeginFn (WhenFn ?CHECK))))))

(=>
  (and
    (instance ?CHECKIN CheckInService)
    (causes ?CHECKIN ?SERVICE)
    (instance ?CHECKOUT CheckOutService))
  (finishes
    (WhenFn ?CHECKOUT)
    (WhenFn ?SERVICE)))
    
(subclass SelfServiceCheckOut CheckOutService)
(documentation SelfServiceCheckOut EnglishLanguage "&%SelfServiceCheckOut is a type of
&%CheckOutService that does not involve interfacing with a &%Human. Instead, some
automated process is put in place")
(termFormat EnglishLanguage SelfServiceCheckOut "self-service check-out")

(=>
  (instance ?CHECK SelfServiceCheckOut)
  (exists (?AGENT)
    (and
      (agent ?CHECK ?AGENT)
      (not (instance ?AGENT Human)))))

(subclass VideoCheckOut SelfServiceCheckOut)
(documentation VideoCheckOut EnglishLanguage "&%VideoCheckOut is a type of 
&%SelfServiceCheckOut where a &%VideoDisplay in a person's &%HotelUnit is used
to do &%CheckOutService")
(termFormat EnglishLanguage VideoCheckOut "video check-out")

(=>
  (instance ?CHECK VideoCheckOut)
  (exists (?VD)
    (and
      (instance ?VD VideoDisplay)
      (instrument ?CHECK ?VD))))
      
(=>
  (propertyAmenity ?HR VideoCheckOut)
  (exists (?VD ?ROOM)
    (and
      (instance ?VD VideoDisplay)
      (capability VideoCheckOut instrument ?VD)
      (located ?VD ?ROOM)
      (instance ?ROOM ?HR))))

(subclass ExecutiveService ServiceProcess)
(documentation ExecutiveService EnglishLanguage "&%ExecutiveService is the class of
&%ServiceProcess that are directed towards guests staying at rooms in an &%ExecutiveLevel")
(termFormat EnglishLanguage ExecutiveService "executive service")

(=>
  (instance ?SVC ExecutiveService)
  (exists (?HUMAN ?LEVEL ?ROOM)
    (and
      (serviceRecipient ?SVC ?HUMAN)
      (stays ?HUMAN ?ROOM)
      (located ?ROOM ?LEVEL)
      (attribute ?LEVEL ExecutiveLevel))))

      
(subclass SafetyDepositService ServiceProcess)
(documentation SafetyDepositService EnglishLanguage "&%SafetyDepositService is a type
of &%ServiceProcess that involves a &%serviceProvider &%Keeping objects for a 
&%customer in a &%SafeContainer.  This could apply to a &%HotelFrontDesk keeping
things in a safety deposit box, or a bank doing the same thing.")
(termFormat EnglishLanguage SafetyDepositService "safety deposit box")

(=>
  (instance ?SVC SafetyDepositService)
  (exists (?SAFE ?KEEP ?OBJ ?AGENT)
    (and
      (serviceProvider ?SVC ?AGENT)
      (instance ?SAFE SafeContainer)
      (instance ?KEEP Keeping)
      (located ?KEEP ?SAFE)
      (possesses ?AGENT ?SAFE)
      (patient ?KEEP ?OBJ)
      (subProcess ?KEEP ?SVC)
      (not (possesses ?AGENT ?OBJ)))))

(subclass MedicalService ServiceProcess)
(documentation MedicalService EnglishLanguage "&%MedicalService is a type of 
&%ServiceProcess involving some &%DiagnosticProcess or &%TherapeuticProcess administered
by a &%MedicalDoctor")
(termFormat EnglishLanguage MedicalService "medical service")

(=>
  (instance ?MS MedicalService)
  (exists (?AGENT ?HUMAN ?PROC)
    (and
      (agent ?MS ?AGENT)
      (employs ?AGENT ?HUMAN)
      (attribute ?HUMAN MedicalDoctor)
      (serviceProvider ?MS ?HUMAN)
      (or
        (instance ?PROC TherapeuticProcess)
        (instance ?PROC DiagnosticProcess))
      (subProcess ?PROC ?MS))))

(subclass SecretarialService ServiceProcess)
(documentation SecretarialService EnglishLanguage "&%SecretarialService is a type of
&%ServiceProcess where a &%serviceProvider hires a &%ClericalSecretary to fulfill the
needs of a &%serviceRecipient")
(termFormat EnglishLanguage SecretarialService "secretarial service")

(=>
  (instance ?X SecretarialService)
  (exists (?SP ?SEC)
    (and
      (serviceProvider ?X ?SP)
      (serviceRecipient ?X ?SR)
      (employs ?SP ?SEC)
      (attribute ?SEC ClericalSecretary))))
      
;; ---------------------------------------------------------------------------------
;; Other CommercialAgents that can be found inside Hotel
;; ---------------------------------------------------------------------------------

;; WellnessSpa
(subAttribute WellnessDaySpa FitnessAndRecreationalSportsCenters)
(documentation WellnessDaySpa EnglishLanguage "&%WellnessDaySpa refers to a type of
&%FitnessAndRecreationalSportsCenters that offer services for relaxation such as 
facials or massages")
(termFormat EnglishLanguage WellnessDaySpa "wellness spa")

(=>
  (attribute ?X WellnessDaySpa)
  (hasPurpose ?X
    (exists (?MASSAGE)
      (and
        (instance ?MASSAGE Massaging)
        (agent ?MASSAGE ?X)))))

;; Tour Arrangement and Reservation Services
(subAttribute TourArrangementAndReservationServices TravelArrangementAndReservationServices)
(documentation TourArrangementAndReservationServices EnglishLanguage 
"&%TourArrangementAndReservationServices refers to the service of arranging the taking
of customers to %&TouristSites")
(termFormat EnglishLanguage TourArrangementAndReservationServices 
"tour arrangement and reservation services")

(=>
  (attribute ?X TourArrangementAndReservationServices)
  (hasPurpose ?X
    (exists (?PROC ?RESERVE)
      (and
        (instance ?RESERVE TourReservation)
        (instance ?PROC IntentionalProcess)
        (agent ?PROC ?X)
        (or
          (result ?PROC ?RESERVE)
          (patient ?PROC ?RESERVE))))))

(subclass ArtsAndRecreationTicketingServices PerformingArtsSpectatorSportsAndRelatedIndustries)
(documentation ArtsAndRecreationTicketingServices EnglishLanguage "&%ArtsAndRecreationTicketingServices
refer to agencies that sell &%Ticket to &%Sport events or &%Performance")
(termFormat EnglishLanguage  ArtsAndRecreationTicketingServices "arts and recreation tickets")

(=>
  (attribute ?X ArtsAndRecreationTicketingServices)
  (hasPurpose ?X
    (exists (?SELL ?TICKET)
      (and
        (instance ?SELL Selling)
        (patient ?SELL ?TICKET)
        (agent ?SELL ?X)
        (instance ?TICKET Ticket)
        (destination ?SELL ?CUST)
        (hasPurpose ?TICKET
          (confersRight
            (exists (?WATCH ?PERF)
              (and
                (instance ?WATCH Seeing)
                (agent ?WATCH ?CUST)
                (patient ?WATCH ?PERF)
                (or
                  (instance ?PERF Performance)
                  (instance ?PERF Sport)))) ?X ?CUST))))))                
        
;; ---------------------------------------------------------------------------------
;; Hotel Employees
;; ---------------------------------------------------------------------------------        

(instance Porter ServicePosition)
(documentation Porter EnglishLanguage "&%Porter refers to a &%Human employed to carry
luggages and other supplies")
(termFormat EnglishLanguage Porter "porter")

(=>
  (attribute ?X Porter)
  (hasPurpose ?X
    (exists (?LUGGAGE ?CARRY)
      (and
        (instance ?LUGGAGE TravelContainer)
        (instance ?CARRY Carrying)
        (agent ?CARRY ?X)))))
        
(=>
  (and
    (customer ?CUST ?AGENT)
    (employs ?AGENT ?X)
    (attribute ?AGENT TravelerAccommodation)
    (attribute ?X Porter)
    (possesses ?CUST ?LUGGAGE)
    (instance ?LUGGAGE TravelContainer))
  (exists (?ROOM ?CARRY)
    (and
      (instance ?ROOM HotelUnit)
      (instance ?CARRY Carrying)
      (agent ?CARRY ?X)
      (or
        (destination ?CARRY ?ROOM)
        (origin ?CARRY ?ROOM)))))
        
(instance Concierge ServicePosition)
(documentation Concierge EnglishLanguage "&%Concierge refers to the position held by
a hotel employee whose primary job it is to help or assist customers of the hotel by
answering questions, providing reservations, etc.")
(termFormat EnglishLanguage Concierge "concierge")

(=>
  (attribute ?X Concierge)
  (hasPurpose ?X
    (exists (?HELP)
      (and
        (instance ?HELP Helping)
        (agent ?HELP ?X)))))

(instance Doorman ServicePosition)
(documentation Doorman EnglishLanguage "&%Doorman refers to the position held by a
person whose primary job it is to open and close doors")
(termFormat EnglishLanguage Doorman "doorman")

(=>
  (instance ?X Doorman)
  (hasPurpose ?X
    (exists (?DOOR ?PROC)
      (and
        (instance ?DOOR Door)
        (agent ?PROC ?X)
        (patient ?PROC ?DOOR)
        (or
          (instance ?PROC Opening)
          (instance ?PROC Closing))))))
        
;; ---------------------------------------------------------------------------------
;; Policy: this generic bit on policies moved to TravelPolicies.kif, kn:OK, vcvp 08/03/2011 
;; ---------------------------------------------------------------------------------

;; in the wordnet mappings, Policy is subsumed by Plan, however looking at the definition
;; of Plan in SUMO, it is subclassed from Procedure, which is a "sequence-dependent
;; specification", which is not necessarily the case. As such, will be subclassing
;; it from Proposition instead.

;;  (subclass Policy Proposition)
;;(documentation Policy EnglishLanguage "&%Policy is a type of &%Proposition created and
;;enforced by an &%Organization such as a government or a business, which contains guiding
;;principles or a plan or course of action adopted by that organization.")
;;(termFormat EnglishLanguage Policy "policy")

;;(=>
;;  (instance ?POLICY Policy)
;;  (exists (?ORG)
;;    (policyOwner ?ORG ?POLICY)))
    
    
;;(instance policyOwner BinaryPredicate)
;;(documentation policyOwner EnglishLanguage "(&%policyOwner ?&%Organization ?&%Policy)
;;describes how ?&%Policy is adopted and enforced by ?&%Organization")
;;(termFormat EnglishLanguage policyOwner "policy owner")
;;(domain policyOwner 1 Organization)
;;(domain policyOwner 2 Policy)

;;(=>
;;  (policyOwner ?AGENT ?POLICY)
;;  (exists (?CREATE)
;;    (and
;;     (instance ?CREATE Creation)
;;      (agent ?CREATE ?AGENT)
;;      (result ?CREATE ?POLICY))))
 
(instance policyLocationCoverage BinaryPredicate)
(documentation policyLocationCoverage EnglishLanguage "(&%policyLocationCoverage 
?&%Policy ?&%GeographicArea) creates a relationship for policies that are restricted
to certain areas or location.  This relation means that ?&%Policy enforcement is 
confined to ?%&GeographicArea")
(domain policyLocationCoverage 1 Policy)
(domain policyLocationCoverage 2 Object)

(subclass SmokingPolicy Policy)
(documentation SmokingPolicy EnglishLanguage "&%SmokingPolicy refers to a policy
that indicates how &%Smoking is or is not allowed within a certain location")
(termFormat EnglishLanguage SmokingPolicy "smoking policy")

(=>
  (and
    (instance ?POLICY SmokingPolicy)
    (policyLocationCoverage ?POLICY ?LOC))
  (or
    (containsInformation ?POLICY
      (modalAttribute
        (exists (?SMOKE1)
          (and
            (instance ?SMOKE1 Smoking)
            (located ?SMOKE1 ?LOC))) Permission))
    (containsInformation ?POLICY
      (modalAttribute
        (exists (?SMOKE2)
          (and
            (instance ?SMOKE2 Smoking)
            (located ?SMOKE2 ?LOC))) Prohibition))))

(subclass PetPolicy Policy)
(documentation PetPolicy EnglishLanguage "&%PetPolicy indicates where &%DomesticAnimal
is allowed or not in the premises")
(termFormat EnglishLanguage PetPolicy "pet policy")

(=>
  (and
    (instance ?POLICY PetPolicy)
    (policyLocationCoverage ?POLICY ?LOC))
  (or
    (containsInformation ?POLICY 
      (modalAttribute
        (exists (?PET1)
          (and
            (instance ?PET1 DomesticAnimal)
            (located ?PET1 ?LOC))) Permission))
    (containsInformation ?POLICY 
      (modalAttribute
        (exists (?PET2)
          (and
            (instance ?PET2 DomesticAnimal)
            (located ?PET2 ?LOC))) Prohibition))))

(subclass ChildrenPolicy Policy)
(documentation ChildrenPolicy EnglishLanguage "&%ChildrenPolicy dictates if &%HumanChild
is allowed or not in an establishment")
(termFormat EnglishLanguage ChildrenPolicy "children policy")

(=>
  (and
    (instance ?POLICY ChildrenPolicy)
    (policyOwner ?AGENT ?POLICY)
    (policyLocationCoverage ?POLICY ?LOC))
  (or
    (containsInformation ?POLICY
      (modalAttribute
        (exists (?CUST1)
          (and
            (customer ?CUST1 ?AGENT)
            (instance ?CUST1 HumanChild))) Possibility))
    (containsInformation ?POLICY
      (not
        (modalAttribute
          (exists (?CUST2)
            (and
              (customer ?CUST2 ?AGENT)
              (instance ?CUST2 HumanChild))) Possibility)))))
                
       
(subclass PetsAllowedPolicy PetPolicy)
(documentation PetsAllowedPolicy EnglishLanguage "&%PetsAllowedPolicy states that
&%DomesticAnimal is allowed within a specific location")
(termFormat EnglishLanguage PetsAllowedPolicy "pets allowed")

(=>
  (and
    (instance ?POLICY PetsAllowedPolicy)
    (policyLocationCoverage ?POLICY ?LOC)
    (policyOwner ?AGENT ?POLICY))
  (confersNorm ?AGENT
    (exists (?PET)
      (and
        (instance ?PET DomesticAnimal)
        (located ?PET ?LOC))) Permission))

(subclass NoPetsPolicy PetPolicy)
(documentation NoPetsPolicy EnglishLanguage "&%NoPetsPolicy states that &%DomesticAnimal
is not allowed within a specific location")
(termFormat EnglishLanguage NoPetsPolicy "no pets allowed")

(=>
  (and
    (instance ?POLICY NoPetsPolicy)
    (policyLocationCoverage ?POLICY ?LOC)
    (policyOwner ?AGENT ?POLICY))
  (deprivesNorm ?AGENT
    (exists (?PET)
      (and
        (instance ?PET DomesticAnimal)
        (located ?PET ?LOC))) Permission))
        
(subclass NoSmokingPolicy SmokingPolicy)
(documentation NoSmokingPolicy EnglishLanguage "&%NoSmokingPolicy states that &%Smoking
is not allowed within a specific location")
(termFormat EnglishLanguage NoSmokingPolicy "no smoking policy")

(=>
  (and
    (instance ?POLICY NoSmokingPolicy)
    (policyLocationCoverage ?POLICY ?LOC)
    (policyOwner ?AGENT ?POLICY))
  (deprivesNorm ?AGENT
    (exists (?SMOKE)
      (and
        (instance ?SMOKE Smoking)
        (located ?SMOKE ?LOC))) Permission))


(subclass SmokingAllowedPolicy SmokingPolicy)
(documentation SmokingAllowedPolicy EnglishLanguage "&%SmokingAllowedPolicy states that &%Smoking
is allowed within a specific location")
(termFormat EnglishLanguage SmokingAllowedPolicy "smoking allowed policy")

(=>
  (and
    (instance ?POLICY SmokingAllowedPolicy)
    (policyLocationCoverage ?POLICY ?LOC)
    (policyOwner ?AGENT ?POLICY))
  (confersNorm ?AGENT
    (exists (?SMOKE)
      (and
        (instance ?SMOKE Smoking)
        (located ?SMOKE ?LOC))) Permission))
        
(subclass NoChildrenPolicy ChildrenPolicy)
(documentation NoChildrenPolicy EnglishLanguage "&%NoChildrenPolicy states that &%HumanChild
are not allowed within a specific location")
(termFormat EnglishLanguage NoChildrenPolicy "no children allowed")

(=>
  (and
    (instance ?POLICY NoChildrenPolicy)
    (policyLocationCoverage ?POLICY ?LOC)
    (policyOwner ?AGENT ?POLICY))
  (deprivesNorm ?AGENT
    (exists (?CHILD)
      (and
        (instance ?CHILD HumanChild)
        (located ?CHILD ?LOC))) Permission))

(subclass HousekeepingPolicy Policy)
(documentation HousekeepingPolicy EnglishLanguage "&%HousekeepingPolicy dictates the
amount of &%RoomCleaning that is done in a &%TravelerAccommodation")
(termFormat EnglishLanguage HousekeepingPolicy "housekeeping policy")

(=>
  (instance ?POLICY HousekeepingPolicy)
  (exists (?AGENT)
    (and
      (policyOwner ?AGENT ?POLICY)
      (attribute ?AGENT TravelerAccommodation))))      
      
(subclass DailyHousekeepingPolicy HousekeepingPolicy)
(documentation DailyHousekeepingPolicy EnglishLanguage "&%DailyHousekeepingPolicy means
that &%RoomCleaning is done at least once a day for the duration of a &%guest stay")
(termFormat EnglishLanguage DailyHousekeepingPolicy "daily housekeeping")

(=>
  (and
    (instance ?POLICY DailyHousekeepingPolicy)
    (policyOwner ?AGENT ?POLICY))
  (modalAttribute
    (exists (?GUEST ?ROOM)
      (and 
        (guest ?GUEST ?AGENT)
        (stays ?GUEST ?ROOM)
        (equal ?STAY (WhenFn (stays ?GUEST ?ROOM)))
        (holdsDuring ?STAY
          (forall (?DAY)
            (=>
              (and
                (instance ?DAY Day)
                (during ?DAY ?STAY))
              (exists (?RC)
                (and
                  (instance ?RC RoomCleaningService)
                  (patient ?RC ?ROOM)
                  (during ?RC ?DAY)))))))) Likely))
      
(subclass NoHousekeepingPolicy HousekeepingPolicy)
(documentation NoHousekeepingPolicy EnglishLanguage "&%NoHousekeepingPolicy means that
&%RoomCleaning is not done for the duration of a &%guest stay at a &%TravelerAccommodation")
(termFormat EnglishLanguage NoHousekeepingPolicy "no housekeeping")        

(=>
  (and
    (instance ?POLICY NoHousekeepingPolicy)
    (policyOwner ?AGENT ?POLICY)
    (attribute ?AGENT TravelerAccommodation))
  (modalAttribute
    (exists (?GUEST ?ROOM)
      (and
        (guest ?GUEST ?AGENT)
        (holdsDuring
          (WhenFn 
            (stays ?GUEST ?ROOM))
          (not
            (exists (?CLEAN)
              (and
                (instance ?CLEAN RoomCleaningService)
                (patient ?CLEAN ?ROOM))))))) Likely))

(subclass WithHousekeepingPolicy HousekeepingPolicy)
(documentation WithHousekeepingPolicy EnglishLanguage "&%WithHousekeepingPolicy means that
&%RoomCleaning is not done for the duration of a &%guest stay at a &%TravelerAccommodation")
(termFormat EnglishLanguage WithHousekeepingPolicy "with housekeeping")        

(=>
  (and
    (instance ?POLICY WithHousekeepingPolicy)
    (policyOwner ?AGENT ?POLICY)
    (attribute ?AGENT TravelerAccommodation))
  (modalAttribute
    (exists (?GUEST ?ROOM)
      (and
        (guest ?GUEST ?AGENT)
        (holdsDuring
          (WhenFn 
            (stays ?GUEST ?ROOM))
          (exists (?CLEAN)
            (and
              (instance ?CLEAN RoomCleaningService)
              (patient ?CLEAN ?ROOM)))))) Likely))      
        
;; ---------------------------------------------------------------------------------
;; HotelPackages
;; ---------------------------------------------------------------------------------
        
(subclass HotelPackage Proposition)
(documentation HotelPackage EnglishLanguage "&%HotelPackage is a type of &%Proposition
initiated by a hotel or travel management company that includes a stay at a hotel as
well as other inclusions that take advantage of a hotel's amenities")
(termFormat EnglishLanguage HotelPackage "hotel package")

(instance roomStay TernaryPredicate)
(documentation roomStay EnglishLanguage "(&%roomStay ?PACKAGE ?QTY ?ROOM) means that the
package includes a ?QTY number of days stay at room type ?ROOM at the 
&%TravelerAccommodation")
(termFormat EnglishLanguage roomStay "room stay")
(domain roomStay 1 HotelPackage)
(domain roomStay 2 Integer)
(domainSubclass roomStay 3 HotelUnit)

(=>
  (and
    (propositionOwner ?HP ?AGENT)
    (instance ?HP HotelPackage)
    (accommodationProvider ?HP ?HOTEL)
    (roomStay ?HP ?NUM ?ROOM)
    (buys ?CUST ?AGENT ?HP))
  (exists (?T)
    (and
      (equal ?TI (MeasureFn ?NUM DayDuration))
      (holdsDuring ?TI
        (guest ?CUST ?HOTEL)))))   

(instance accommodationProvider BinaryPredicate)
(documentation accommodationProvider EnglishLanguage "(&%accommodationProvider ?PKG ?ORG)
means that ?ORG, which is a &%TravelerAccommodation business, will provide the 
accommodations for the &%HotelPackage ?PKG")
(termFormat EnglishLanguage accommodationProvider "accommodations provider")

(domain accommodationProvider 1 HotelPackage)
(domain accommodationProvider 2 Organization)

(=>
  (accommodationProvider ?PKG ?HOTEL)
  (attribute ?HOTEL TravelerAccommodation))
    
(instance physicalInclusion BinaryPredicate)
(documentation physicalInclusion EnglishLanguage "(&%physicalInclusion ?PACKAGE ?OBJ) means
that the resource ?OBJ is available for the guest's use or consumption")
(termFormat EnglishLanguage physicalInclusion "physical inclusion")
(domain physicalInclusion 1 HotelPackage)
(domainSubclass physicalInclusion 2 Object)
    
(instance processInclusion BinaryPredicate)
(documentation processInclusion EnglishLanguage "(&processInclusion ?PACKAGE ?SVC) means
that the guest can be the experiencer of serviceRecipient of ?SVC")
(termFormat EnglishLanguage processInclusion "process inclusion")
(domain processInclusion 1 HotelPackage)
(domainSubclass processInclusion 2 Process)

(instance policyInclusion BinaryPredicate)
(documentation policyInclusion EnglishLanguage "(&%policyInclusion ?PACKAGE ?POLICY)
means that ?POLICY is applicable")
(termFormat EnglishLanguage policyInclusion "policy inclusion")
(domain policyInclusion 1 HotelPackage)
(domainSubclass policyInclusion 2 Policy)

(instance mealPlanInclusion BinaryPredicate)
(documentation mealPlanInclusion EnglishLanguage "(&%mealPlanInclusion ?PKG ?PLAN) means
that the conditions in &%MealPlan ?PLAN is applicable to the consume of the &%HotelPackage")
(termFormat EnglishLanguage mealPlanInclusion "meal plan inclusion")
(domain mealPlanInclusion 1 HotelPackage)
(domainSubclass mealPlanInclusion 2 MealPlan)

(=>
  (instance ?X HotelPackage)
  (exists (?UNIT ?INT)
    (roomStay ?X ?INT ?UNIT)))        
            
(subclass GolfPackage HotelPackage)
(documentation GolfPackage EnglishLanguage "&%GolfPackage is a type of &%HotelPackage
that includes Golfing")
(termFormat EnglishLanguage GolfPackage "golf package")

(=>
  (instance ?X GolfPackage)
  (processInclusion ?X Golf))

        
;; -------------------------------------------------------------------------------
;; To be fully defined at a later date
;; -------------------------------------------------------------------------------

(subclass TravelReservation Reservation)
(documentation TravelReservation EnglishLanguage "&%TravelReservation refers to a 
&%Reservation that describes combined services for travel such as flight, hotels, etc")
(termFormat EnglishLanguage TravelReservation "travel reservation")

(=>
  (instance ?X TravelReservation)
  (modalAttribute
    (exists (?FLIGHT)
      (and
        (instance ?FLIGHT FlightReservation)
        (subProposition ?FLIGHT ?X))) Likely))

(subclass FlightReservation Reservation)
(documentation FlightReservation EnglishLanguage "&%FlightReservation refers to a 
&%Reservation specifically for Airline flights")
(termFormat EnglishLanguage FlightReservation "flight reservation")

(subclass TourReservation Reservation)
(documentation TourReservation EnglishLanguage "&%TourReservation refers to a &%Reservation
specifically for &%TourService")
(termFormat EnglishLanguage TourReservation "tour reservation")

(subclass HotelReservation Reservation)
(documentation HotelReservation EnglishLanguage "&%HotelReservation refers to a
&%Reservation specifically for &%TravelerAccommodation stays")
(termFormat EnglishLanguage HotelReservation "hotel reservation")

(=>
  (and
    (fulfillingEntity ?AGENT ?RESERVE)
    (instance ?RESERVE HotelReservation))
  (attribute ?AGENT TravelerAccommodation))
  
(instance numberOccupant BinaryPredicate)
(documentation numberOccupant EnglishLanguage "(&%numberOccupant ?RESERVE ?NUM) means
that the &%Reservation ?RESERVE indicates &%Integer ?NUM of &%Human that will potentially
be staying in the &%TravelerAccommodation")
(termFormat EnglishLanguage numberOccupant "number of occupants")

(domain numberAdultOccupant 1 HotelReservation)
(domain numberAdultOccupant 2 Integer)  

(=>
  (and 
    (numberOccupant ?RESERVE ?NUM)
    (fulfillingEntity ?RESERVE ?HOTEL))
  (exists (?COL)
    (and
      (instance ?COL GroupOfPeople)
      (memberType ?COL Human)
      (memberCount ?COL ?NUM)
      (potentialCustomer ?COL ?HOTEL))))
  
(subrelation numberAdultOccupant numberOccupant)
(documentation numberAdultOccupant EnglishLanguage "(&%numberAdultOccupant ?RESERVE 
?NUM) means that the &%Reservation ?RESERVE indicates &%Integer ?NUM of &%HumanAdult 
that will be fulfilling the reservation")
(termFormat EnglishLanguage numberAdultOccupant "number of adult occupants")


(=>
  (and
    (numberAdultOccupant ?RESERVE ?NUM)
    (fulfillingEntity ?RESERVE ?HOTEL))
  (exists (?COL)
    (and
      (instance ?COL GroupOfPeople)
      (memberType ?COL HumanAdult)
      (memberCount ?COL ?NUM)
      (potentialCustomer ?COL ?HOTEL))))
      
(subrelation numberChildOccupant numberOccupant)
(documentation numberChildOccupant EnglishLanguage "(&%numberChildOccupant ?RESERVE 
?NUM) means tht the &%Reservation ?RESERVE indicates &%Integer ?NUM of &%HumanChild 
is included in the reservation")
(termFormat EnglishLanguage numberChildOccupant "number of child occupants")

(=>
  (and
    (numberChildOccupant ?RESERVE ?NUM)
    (fulfillingEntity ?RESERVE ?HOTEL))
  (exists (?COL ?SUBCOL)
    (and
      (instance ?COL GroupOfPeople)
      (subCollection ?SUBCOL ?COL)
      (instance ?SUBCOL GroupOfPeople)
      (memberType ?SUBCOL HumanChild)
      (memberCount ?SUBCOL ?NUM)
      (potentialCustomer ?COL ?HOTEL))))
      
(subrelation numberSeniorOccupant numberOccupant)
(documentation numberSeniorOccupant EnglishLanguage "(&%numberSeniorOccupant ?RESERVE
?NUM) means that the &%Reservation ?RESERVE indicates &%Integer ?NUM of &%HumanAdult
that has &%age &%greaterThanOrEqualTo 60")
(termFormat EnglishLanguage numberSeniorOccupant "number of senior occupants")

(=>
  (and 
    (numberSeniorOccupant ?RESERVE ?NUM)
    (fulfillingEntity ?RESERVE ?HOTEL))
  (exists (?COL)
    (and
      (instance ?COL GroupOfPeople)
      (forall (?X)
        (=>
          (member ?X ?COL)
          (and
            (instance ?X HumanAdult)
            (age ?X (MeasureFn ?AGE YearDuration))
            (greaterThanOrEqualTo ?AGE 60))))
      (memberCount ?COL ?NUM)
      (potentialCustomer ?COL ?HOTEL))))
      
(instance reservedRoom BinaryPredicate)
(documentation reservedRoom EnglishLanguage "(&%reservedRoom ?RESERVE ?ROOMTYPE)
means that the &$HotelUnit ?ROOMTYPE is the requested room type for the hotel stay 
indicated by &%HotelReservation ?RESERVE")
(termFormat EnglishLanguage reservedRoom "reserved room")

(domain reservedRoom 1 HotelReservation)
(domainSubclass reservedRoom 2 HotelUnit)

(=>
  (and
    (reservedRoom ?RESERVE ?ROOMTYPE)
    (reservationStart ?RESERVE ?TIME1)
    (reservationEnd ?RESERVE ?TIME2)
    (reservingEntity ?RESERVE ?CUST))
  (modalAttribute
    (holdsDuring
      (TimeIntervalFn ?TIME1 ?TIME2)
      (and
        (instance ?X ?ROOMTYPE)
        (stays ?CUST ?X))) Likely))
        
(instance reservedPackage BinaryPredicate)
(documentation reservedPackage EnglishLanguage "(&%reservedPackage ?RESERVE ?PACKAGE)
means that the &%customer has reserved for the &%HotelPackage ?PACKAGE")
(termFormat EnglishLanguage reservedPackage "reserved package")

(domain reservedPackage 1 Reservation)
(domain reservedPackage 2 Proposition)

(=>
  (and
    (reservedPackage ?RESERVE ?PACKAGE)
    (reservingEntity ?RESERVE ?CUST))
  (modalAttribute
    (exists (?PROC)
      (and
        (realization ?PROC ?PACKAGE)
        (experiencer ?PROC ?CUST))) Likely))
        
(instance rateDetail BinaryPredicate)
(documentation rateDetail EnglishLanguage "(&%rateDetail ?RESERVE ?FORMULA) gives
the price detail associated with each item in the reservation")
(termFormat EnglishLanguage rateDetail "rate detail")

(domain 1 rateDetail Reservation)
(domain 2 rateDetail Formula)

;; -------------------------------------------------------------------------------
;; RATING
;; -------------------------------------------------------------------------------

(subclass RatingAttribute SubjectiveAssessmentAttribute)
(documentation RatingAttribute EnglishLanguage "&%RatingAttribute attempts to quantify the subjective 
assessment of an &%Object using some scoring system.  A &%RatingAttribute is created 
by an &%Agent with some criteria in mind.")

;; if ?RATING is an instance of RatingAttribute, then there exists some agent that 
;; underwent some decision-making to come up with that rating
(=>
  (instance ?RATING RatingAttribute)
  (exists (?AGENT)
    (ratingsAgent ?RATING ?AGENT)))

;;(ratingsAgent ?RATING ?AGENT)
(instance ratingsAgent BinaryPredicate)      
(documentation ratingsAgent EnglishLanguage "(&%ratingsAgent ?RATING ?AGENT) means that ?AGENT went 
through some &%Deciding process in order to create &%RatingAttribute ?RATING.")
(domain ratingsAgent 1 RatingAttribute)
(domain ratingsAgent 2 Agent)

(=>
  (ratingsAgent ?RATING ?AGENT)
  (exists (?PROCESS)
    (and
      (instance ?PROCESS Deciding)
      (agent ?PROCESS ?AGENT)
      (result ?PROCESS ?RATING))))
 
(subclass HotelRating RatingAttribute)
(documentation HotelRating EnglishLanguage "&%HotelRating is a &%SubjectiveAssessmentAttribute 
specifically targeted at the overall quality of a &%Hotel, its premises and services")

(=>
  (and
    (subjectiveAttribute ?ENTITY ?ATTR ?AGENT)
    (instance ?ATTR HotelRating))
  (attribute ?ENTITY TravelerAccommodation))

(subclass RestaurantRating RatingAttribute)
(documentation RestaurantRating EnglishLanguage "&%RestaurantRating is a &%SubjectiveAssessmentAttribute 
specifically targeted at the overall quality of a &%Restaurant")

(=>
  (and
    (subjectiveAttribute ?ENTITY ?ATTR ?AGENT)
    (instance ?ATTR RestaurantRating))
  (instance ?ENTITY Restaurant))

(subclass FoodRating RatingAttribute)
(documentation FoodRating EnglishLanguage "&%FoodRating is a &%SubjectiveAssessmentAttribute 
specifically targeted the overall quality of &%Food")

;; FoodRating has the purpose of applying a subjective assessment on food prepared by
;; an agent
(=>
  (instance ?RATING FoodRating)
  (hasPurpose ?RATING
    (and
      (instance ?C Classifying)
      (destination ?C ?FOOD)
      (patient ?C ?RATING)
      (instance ?FOOD PreparedFood))))
      
(=> 
  (and
    (subjectiveAttribute ?ENTITY ?ATTR ?AGENT)
    (instance ?ATTR FoodRating)
    (instance ?ENTITY Agent))
  (exists (?FOOD ?COOK ?CLASSIFY)
    (and
      (instance ?COOK Cooking)
      (agent ?COOK ?ENTITY)
      (result ?COOK ?FOOD)
      (instance ?CLASSIFY Classifying)
      (destination ?CLASSIFY ?FOOD)
      (patient ?CLASSIFY ?ATTR))))

(subclass ServiceRating RatingAttribute)
(documentation ServiceRating EnglishLanguage "&%ServiceRating is a &%SubjectiveAssessmentAttribute 
specifically targeted at the overall quality of &%service given by an agent")

(=>
  (instance ?RATING ServiceRating)
  (hasPurpose ?RATING
    (and
      (instance ?C Classifying)
      (destination ?C ?S)
      (patient ?C ?RATING)
      (instance ?S ServiceProcess))))
      
(=> 
  (and
    (subjectiveAttribute ?ENTITY ?ATTR ?AGENT)
    (instance ?ATTR ServiceRating)
    (instance ?ENTITY Agent))
  (exists (?SVC ?CLASSIFY)
    (and
      (instance ?SVC ServiceProcess)
      (agent ?SVC ?ENTITY)
      (instance ?CLASSIFY Classifying)
      (destination ?CLASSIFY ?SVC)
      (patient ?CLASSIFY ?ATTR))))
      
(subclass AmbienceRating RatingAttribute)
(documentation AmbienceRating EnglishLanguage "&%AmbienceRating is a &%SubjectiveAssessmentAttribute 
specifically targeted at the overall quality of an environment's atmosphere") 

(subclass PriceRating RatingAttribute)
(documentation PriceRating EnglishLanguage "&%PriceRating is a &%SubjectiveAssessmentAttribute 
specifically targeted at the price (or average price) of an object is")


