(in-package "ONTOLINGUA-USER")

(define-theory
     product-theory
     (frame-ontology slot-constraint-sugar bibliographic-data standard-units
      scalar-quantities)
   "The general product ontology defines the terms used for describing
products, objects that are typically bought and sold."
   :io-package
   "ONTOLINGUA-USER")


(in-theory (quote product-theory))



;;; minimum-storage-temperature

(define-frame minimum-storage-temperature :own-slots ((documentation "The maximum temperature at which this object should be stored.") (instance-of function) (arity 2) (domain tangible-product) (range dme-user::temperature)))

;;; us-cent

(define-frame us-cent :own-slots ((instance-of currency-quantity)))

;;; us-dollar

(define-frame us-dollar :own-slots ((instance-of currency-quantity)))

;;; currency-quantity

(define-frame currency-quantity :own-slots ((instance-of class) (subclass-of scalar-quantity) (documentation "The class of quantities used to measure currency.")))

;;; corporation

(define-frame corporation :own-slots ((instance-of class) (subclass-of organization) (documentation "A company.")))

;;; seller

(define-frame seller :own-slots ((instance-of relation) (arity 2) (domain purchasing-agreement) (range agent) (documentation "The seller in some purchasing-agreement.")))

;;; buyer

(define-frame buyer :own-slots ((instance-of relation) (arity 2) (domain purchasing-agreement) (range agent) (documentation "The buyer in some purchasing-agreement.")))

;;; currency-transferred

(define-frame currency-transferred :own-slots ((instance-of relation) (arity 2) (domain purchasing-agreement) (range currency-quantity) (documentation "The amount of money that changes hands in a purchase.")) :axioms ((=> (and (list-price ?prod ?price) (object-sold ?buy ?prod)) (currency-transferred ?buy ?price)) (=> (and (currency-transferred ?buy ?price) (object-sold ?buy ?prod)) (list-price ?prod ?price))))

;;; object-sold

(define-frame object-sold :own-slots ((instance-of relation) (arity 2) (domain purchasing-agreement) (range product) (documentation "The object that is sold in some Purchasing-Agreement.  If we decide to create Transaction, we might change the name of this predicate to transaction-object.  Alternatively, we might make this even more general by creating something like object-acted-on.")))

;;; obligation-in

(define-frame obligation-in :own-slots ((instance-of relation) (arity 3) (documentation "In this agreement, this agent has the following obligation")) :axioms ((nth-domain obligation-in 1 agreement) (nth-domain obligation-in 2 agent) (nth-domain obligation-in 3 obligation) (=> (obligation-in ?ag ?agent ?obligation) (agreeing-agents ?ag ?agent)) (=> (agreeing-agents ?ag ?agent) (exists (@obligation) (obligation-in ?ag ?agent ?obligation)))))

;;; obligation

(define-frame obligation :own-slots ((instance-of class) (subclass-of individual-thing) (documentation "This is just a placeholder for now.  It's not clear what the real representation will be.  One possibility is to have it be a Microtheory a la Cyc.  The things that the Agent is obligated to make true are true in the Obligation.  Another possibility is to make Obligations individual propositions that the Agent must make true, or individual actions the agent must perform.")))

;;; agreeing-agents

(define-frame agreeing-agents :own-slots ((instance-of relation) (arity 2) (range agent) (domain agreement) (documentation "Points to agents that are the agreeing parties in an agreement.  There must be at least two of these per agreement.")) :axioms nil)

;;; tangible-product

(define-frame tangible-product :own-slots ((instance-of class) (subclass-of product) (documentation "A Product that has physical extent.  Contrast with Service.")) :template-slots nil)

;;; maximum-storage-temperature

(define-frame maximum-storage-temperature :own-slots ((documentation "The maximum temperature at which this object should be stored.") (instance-of function) (arity 2) (domain tangible-product) (range dme-user::temperature)))

;;; service

(define-frame service :own-slots ((instance-of class) (subclass-of product) (documentation "A product that consists of one agent performing some action for another agent.  For example, a garbage collector taking away someone's garbage.  Contrast with Tangible-Product.")) :template-slots nil)

;;; on-site-8-hrs

(define-frame on-site-8-hrs :own-slots ((instance-of support-response)))

;;; on-site-4-hrs

(define-frame on-site-4-hrs :own-slots ((instance-of support-response)))

;;; return-to-vendor

(define-frame return-to-vendor :own-slots ((instance-of support-response)))

;;; support-response

(define-frame support-response :own-slots ((instance-of class) (subclass-of individual-thing) (documentation "The class of ways the support service provider responds to some request for support.")))

;;; has-support-response

(define-frame has-support-response :own-slots ((instance-of relation) (arity 2) (range support-response) (domain service-agreement) (documentation "A relation that indicates how the support service provider responds to some request for support in the service agreement.")) :axioms nil)

;;; service-agreement

(define-frame service-agreement :own-slots ((instance-of class) (subclass-of agreement product) (documentation "The class of agreement where some agents agrees to perform some service for another agent usually for some price")))

;;; support-for

(define-frame support-for :own-slots ((instance-of relation) (arity 2) (range support-service-type) (domain service-agreement) (documentation "A relation that indicates any training courses that are relevant to the product.")) :axioms nil)

;;; maintenance

(define-frame maintenance :own-slots ((instance-of support-service-type) (subclass-of class) (documentation "The class of service that includes actions which keep a product functioning for the buyer.")))

;;; installation

(define-frame installation :own-slots ((instance-of support-service-type) (subclass-of service) (documentation "The class of service that includes installing a product for the buyer.")))

;;; support-service-type

(define-frame support-service-type :own-slots ((instance-of class) (subclass-of class) (documentation "The class of types of services that are often supported by the sellers of products.")))

;;; warranty

(define-frame warranty :own-slots ((instance-of class) (subclass-of agreement) (documentation "A class of agreements that state the cirumstances under which defects in the product will corrected for no charge. These warrantees usually include how long after the product is purchased that the agreement will hold and what types of things are not included in the warranty. It should also include descriptions of actions that invalidate the warranty.")) :template-slots nil)

;;; agreement

(define-frame agreement :own-slots ((documentation "The class of things which consititute an agreement between two or more agents.
Agreements may be implicit or explicit.  They may be
written or verbal or gestural.") (instance-of class) (subclass-of individual-thing)) :template-slots ((agreeing-agents (minimum-slot-cardinality 2))))

;;; functional-document

(define-frame functional-document :own-slots ((instance-of class) (subclass-of document) (documentation "The class of documents which describe how to perform certain functions.")))

;;; use-document

(define-frame use-document :own-slots ((instance-of class) (subclass-of document) (documentation "The class of documents which describe how to use something (e.g. owner's manuals for VCRs).")))

;;; installation-document

(define-frame installation-document :own-slots ((instance-of class) (subclass-of document) (documentation "The class of documents which describe how to install something.")))

;;; associated-documents

(define-frame associated-documents :own-slots ((instance-of relation) (arity 2) (range document) (domain product) (documentation "A relation that indicates any documents that are relevant to the product.")) :axioms nil)

;;; government-discount

(define-frame government-discount :own-slots ((instance-of class) (subclass-of discount) (documentation "The class of discounts that can be given on a product if the buyer is a government employee or government contractor.")) :template-slots nil)

;;; school-discount

(define-frame school-discount :own-slots ((instance-of class) (subclass-of discount) (documentation "The class of discounts that can be given on a product if the buyer is associated with an educational organization.")) :template-slots nil)

;;; quantity-discount

(define-frame quantity-discount :own-slots ((instance-of class) (subclass-of discount) (documentation "The class of discounts that can be given on a product if a certain number of the products are purchased at one time.")) :template-slots nil)

;;; discount

(define-frame discount :own-slots ((instance-of class) (subclass-of individual-thing) (documentation "The class of discounts that can be given on a product.  There is usually some condition that has to be met for the discount to apply.")) :template-slots nil)

;;; model-number

(define-frame model-number :own-slots ((instance-of class) (subclass-of string) (documentation "The class of objects that can be model numbers. I'm just making this a string for now.")) :template-slots nil)

;;; has-model-number

(define-frame has-model-number :own-slots ((instance-of relation) (arity 2) (range model-number) (domain product) (documentation "A relation that indicates the model number of a product.")) :axioms nil)

;;; has-special-discount

(define-frame has-special-discount :own-slots ((instance-of relation) (arity 2) (range discount) (domain product) (documentation "A relation that indicates the discounts that may be applicable for the product such as government discounts, school discounts, quantity discounts, etc.")) :axioms nil)

;;; list-price

(define-frame list-price :own-slots ((instance-of relation) (arity 2) (range currency-quantity) (domain product) (documentation "A relation that indicates the price of a product that the seller quotes to a potential buyer. For example, to say that the list price of Cup001 is $40, (= (list-price Cup001) (* 40 US-Dollar)).")) :axioms nil)

;;; product

(define-frame product :own-slots ((instance-of class) (subclass-of individual-thing) (documentation "A class of objects that are typically bought and sold.") (subclass-partition (setof service tangible-product))) :template-slots ((list-price) (has-special-discount) (has-model-number) (associated-documents)))

;;; purchasing-agreement

(define-frame purchasing-agreement :own-slots ((instance-of class) (subclass-of agreement) (documentation "An Agreement between two agents in which one agent agrees to render the other some good or service in exchange for currency.")) :axioms ((=> (purchasing-agreement ?x) (exists (@y) (object-sold ?x ?y))) (=> (purchasing-agreement ?x) (exists (@y) (buyer ?x ?y))) (=> (purchasing-agreement ?x) (exists (@y) (seller ?x ?y)))))

This Lisp-to-HTML translation was brought to you by
François Gerbaux and Tom Gruber