;;; -*- Mode:Lisp; Syntax: Common-Lisp; Package:ONTOLINGUA-USER; Base:10 -*-;;;;;;----------------------------------------------------------------------;;; Knowledge Systems Laboratory, Stanford Univesity;;; Author: Adam Farquhar (Adam_Farquhar@ksl.stanford.edu);;; Copyright (c) 1993 by Adam Farquhar.;;;;;; Some portions of this file come from the Engineering Math;;; Ontologies, which contain the following copyright:;;;;;; Physical Quantities Ontology,;;; Scalar Quantities,;;; Unary Scalar Functions,;;; (c) 1993 Greg Olsen and Thomas Gruber;;;;;;----------------------------------------------------------------------;;; File Description:;;; This file contains the ONTOLINGUA background definitions;;; required for CML. This file, together with the result of;;; translating a closed domain theory should comprise a complete;;; OL theory.;;;;;; History/Bugs/Notes:;;; [axf 09/29/93] Created.;;;;;; - I dropped quantity-values. They used to be 'things with;;; dimensions' that could be the value of a quantity. Since I've;;; added ordinal and nominal quantities, which can have any objconst;;; as values, the class is no longer very meaningful. Something that;;; means 'values-with-dimension' might be useful as a domain;;; restriction for relations on quantities such as <, +, sin, etc,;;; which have domains from the reals.;;;;;;----------------------------------------------------------------------;;;;;;#|---------------------------------------------------------------------- Some Design Decisions about this ontology ----------------------------------------------------------------------|# (in-package "ONTOLINGUA-USER") (define-theoryCML(unary-scalar-functions) "The CML ontology is the theory underlying the CML language. It defines the basic concepts, such as model-fragment and time-dependent-relation, that are assumed in the language. It gives axiomatic semantics for the notion of time and change inherent in CML. The CML ontology is built upon the Engineering Math ontologies, extending the unary-scalar-functions and standard-units theories." :issues ("See discussion about has-quantity-function")) (in-theory 'CML) (define-classMODEL-FRAGMENT(?x) "A MODEL-FRAGMENT instance describes an aggregate (perhaps empty) of participating objects under certain conditions." :def (individual-thing ?x) ) (define-classENTITY(?X) "An ENTITY is an object with structurally stable properties. It differs from a MODEL-FRAGMENT in the set of properties that make sense for it. E.g. an 'automobile' is naturally represented as an entity, which might have attributes such as color: red, manufacturer: ford. " :def (individual-thing ?x)) (define-relationACTIVE(?time ?model-fragment-class ?mf-instance) "A model-fragment is associated with a set of time-dependent conditions and consequences; when those conditions hold, the consequences hold. While conditions and consequences are time-dependent, the participants, attributes, and quantities associated with a model-fragment are part of its definition and the associations do not change over time. Similarly, model-fragment classes are organized in a class hierarchy, and a model-fragment instance can be an instance of more than one class. The ACTIVE predicate associates a set of conditions with a model-fragment class. A model fragmentinstanceis active with respect to the conditions associated with a model-fragmentclassand a particular time. Thus, (active ?t ?mf-class ?mf-instance) holds when the conditions of the class ?mf-class, instantiated for instance ?mf-instance, are true at the time ?t. The translation of CML forms into KIF produces axioms that determine when ACTIVE holds for particular model fragments." :def (and (time-quantity ?time) (subclass-of ?model-fragment-class model-fragment) (model-fragment ?mf-instance))) (define-classINFINITE(?x) "The class of infinite quantities which includes infinite quantities for every physical dimension." :def (constant-quantity ?x)) (define-classSCENARIO(?s) "A scenario is a description of a modeled system, a set of initial conditions for exogenous constants, and an interval of time over which the system is to be analyzed or simulated." :def (and (individual-thing ?s) (time-quantity (initial-time ?s)) (time-quantity (final-time ?s)) (defined (scenario.participants ?s)))) (define-functionINITIAL-TIME(?s) :-> ?t "The initial time of a scenario is a time-quantity." :def (and (scenario ?s) (time-quantity ?t))) (define-functionFINAL-TIME(?s) :-> ?t "The final time of a scenario is a time-quantity." :def (and (scenario ?s) (time-quantity ?t))) (define-functionSCENARIO.PARTICIPANTS(?s) :-> ?participants "The scenario.participants of a scenario is a set of entities for which the scenario is defined." :def (and (scenario ?s) (set ?participants) (=> (member ?p ?participants) (entity ?p)))) (define-classPARTICIPANT-FUNCTION(?f) "A participant function is a unary function from model fragments to entities." :iff-def (and (unary-function ?f) (domain ?f model-fragment) (range ?f entity))) (define-classATTRIBUTE-FUNCTION(?f) "An attribute-function is a unary function defined over model fragments or entities." :iff-def (and (unary-function ?f) (domain ?f (kappa (?x) (or (model-fragment ?x) (entity ?x)))))) (define-function==(?q1 ?q2) "== is equality between quantities, factoring out differences between constants and time-dependent quantities. A time-dependent quantity that always returns the same value is == to its value, but not = to its value." :iff-def (and (physical-quantity ?q1) (physical-quantity ?q2) (forall ?t (= (value-at ?q1 ?t) (value-at ?q2 ?t))))) (define-classPIECEWISE-CONTINUOUS-QUANTITY(?x) "If ?x is defined over some dense interval of ?t, then there are a finite number of points at which ?t is not continuous." :def (function-quantity ?x) :issues (("A piecewise continuous quantity need not have a well defined value at a time point. One needs to know the direction as well (from left or right). Is is that the value not well defined, or is the means of finding the value not well defined?") ("Note that the derivative of a standard-quantity may be a piecewise-continuous-quantity."))) (define-classEVERYWHERE-CONTINUOUS-QUANTITY(?x) :def (and (piecewise-continuous-quantity ?x);; need to put in calculus for this) :issues (("Should restrict the definition to apply to the dense intervals over which ?x is defined."))) (define-classSTANDARD-QUANTITY(?x) "A STANDARD-QUANTITY is everywhere continuous, has a piecewise continuous derivative, and a dimension. Quantities in QPT and QPC are standard-quantities. In QSIM, the derivatives are continuous as well within a behavior." :iff-def (and (everywhere-continuous-quantity ?x) (piecewise-continuous-quantity (d/dt ?x)))) (define-classTIME-DEPENDENT-RELATION(?rel) "Time dependent relations are relations whose first argument is a time quantity. This is a second order relation." :def (and (relation ?rel);; the first argument is a time(nth-domain ?rel 1 time-quantity) )) (define-classTIME-DEPENDENT-FUNCTION(?f) "Time dependent functions are functions whose first argument is a time quantity. This is a second order relation." :def (and (time-dependent-relation ?f) (function ?f)));;;----------------------------------------------------------------------;;; We need polymorphic definitions for all of the operations allowed;;; on quantities.;;;----------------------------------------------------------------------(define-relationM+(?x ?y) "The M+ relationship holds between two quantities x y exactly when y = f(x) and f is a monotonic increasing function." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-relationM-(?x ?y) "The M- relationship holds between two quantities x y exactly when y = f(x) and f is a monotonic decreasing function." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-relationC+(?x ?y) "The C+ relation between two quantities x and y means that x = f(...,y,...) and the partial of f w.r.t. y is 1. If all of the arguments to f are C+, this is equivalent to saying that x is their sum." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-relationC-(?x ?y) "The C+ relation between two quantities x and y means that x = f(...,y,...) and the partial of f w.r.t. y is -1. If all of the arguments to f are C+, this is equivalent to saying that -x is their sum." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-relationQprop+(?x ?y) "The qualitative proportionality, Qprop+, also known as an indirect influence in the qualitative process theory literature, states that all things being equal ?x is proportional to ?y. If there are no other influences on ?x, then (Qprop+ ?x ?y) is equivalent to (M+ ?y ?x). Otherwise, it means that x = f(...,y,...) and the partial of f w.r.t. y is greater than zero." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-relationQprop-(?x ?y) "The qualitative proportionality, Qprop-, also known as an indirect influence in the qualitative process theory literature, states that all things being equal ?x is proportional to ?y. If there are no other influences on ?x, then (Qprop- ?x ?y) is equivalent to (M- ?y ?x). Otherwise, it means that x = f(...,y,...) and the partial of f w.r.t. y is less than zero." :def (and (time-dependent-quantity ?x) (time-dependent-quantity ?y))) (define-classQUANTITY-FUNCTION(?qf) "A quantity function maps some objects to a quantity." :def (and (function ?qf) (range ?qf time-dependent-quantity)) :issues (("Quantity functions defined within different model fragments may map to quantities with different dimensions and so on, so there is little that we can say about quantity functions beyond stating that the elements of their range is a quantity."))) (define-relationQUANTITY-FUNCTION-DIMENSION(?class ?function ?dimension) "The quantity-function-dimension of a quantity-function on a class is a `facet' of the quantity `slot'. It means that the range of the function --that is, the value type of the slot--is quantities of the specified dimension. For example, (quantity-function-dimension physical-object mass mass-dimension) says that the mass slot of physical-objects has values that are quantities of the physical-dimension called mass-dimension." :iff-def (and (class ?class) (quantity-function ?function) (physical-dimension ?dimension) (forall ?x (=> (instance-of ?x ?class) (= (quantity.dimension (value ?function ?x)) ?dimension))));; this tells frame editors to treat it as a facet. It could be inferred;; by a general purpose theorem prover, but why wait?:axiom-def (facet QUANTITY-FUNCTION-DIMENSION)) (define-relationCONTINUOUS-AT(?f ?p) "A function ?f is continuous at the point ?p. This definition needs work. It will be something like this (forall (?x ?epsilon) (=> (<(norm (value ?f ?p) (value ?f ?x)) ?epsilon) (exists (?delta) (<(norm (- ?x ?p) ?delta)))))" :constraints (and (function ?f) (holds ?f ?p)) :issues ("THIS DEFINITION NEEDS WORK.")) (define-relationCONTINUOUS-OVER(?f ?beg ?end) "A function ?f is continous over the interval ?beg ?end if it is defined and continuous-at every point between ?beg and ?end exclusive." :iff-def (and (unary-scalar-function-quantity ?f) (member ?beg (exact-domain ?f)) (member ?end (exact-domain ?f)) (forall (?x) (=> (and (<?beg ?x) (<?x ?end)) (and (defined (value ?f ?x)) (continuous-at ?f ?x)))))) (define-relationpiecewise-continuous-function(?f) "A function is piecewise-continuous if it's domain can be partitioned into a sequence of intervals such that it is continuous-over each such interval, and there is a finite distance between each pair of break points." :def (function ?f) ) (define-relationeverywhere-continuous-function(?f) "A function is everywhere-continuous if it is continuous over its entire domain." :def (function ?f);; -- is this too strong? Perhaps over every defined subsegment?);;;----------------------------------------------------------------------;;; Useful, but not necessary.;;;----------------------------------------------------------------------(define-relationHAS-QUANTITY-FUNCTION(?instance ?quantity-function) "Model fragments has functions from instances to quantities. These functions are called quantity-function's. Has-quantity-function is used to name the relevant functions for an model fragment instance. It is typically defined as an instance slot on a model-fragment class." :def (and (individual-thing ?instance) (quantity-function ?quantity-function)) :issues (("Should the domain of this be model-fragment instances, instead of classes?" "Suporting the instances option, the relevant slots inherit down through subclasses of model-fragment." "In support of the class option, this allows an inverse slot (currently called QUANTITY-FUNCTION-OF) from functions to the model-fragments it is about.")) ) (define-relationQUANTITY-FUNCTION-TOTAL-ON(?quantity-function ?class) :iff-def (and (quantity-function ?quantity-function) (class ?class) (total-on ?quantity-function ?class)) :issues ((:formerly-called QUANTITY-FUNCTION-OF) "This used to be defined as the INVERSE relation of has-quantity-function. But now, has-quantity-function is defined as an instance-slot (i.e., its domain is instances of a class), so the inverse quantity-function-of would only point at instances.")) (define-relationHAS-ATTRIBUTE-FUNCTION(?instance ?attribute-function) "Model fragments has functions from instances to quantities. These functions are called attribute-function's. Has-attribute-function is used to name the relevant functions for an model fragment instance. It is typically defined as an instance slot on a model-fragment class." :def (and (individual-thing ?instance) (attribute-function ?attribute-function)) :issues ("See the discussion about HAS-QUANTITY-FUNCTION.") ) (define-relationATTRIBUTE-FUNCTION-TOTAL-ON(?function ?class) :iff-def (and (attribute-function ?function) (class ?class) (total-on ?function ?class)) :issues ((:formerly-called ATTRIBUTE-FUNCTION-OF) "See the discussion about QUANTITY-FUNCTION-TOTAL-ON.")) (define-relationHAS-PARTICIPANT-FUNCTION(?instance ?function) "Model fragments has functions from instances to participants. These functions are called participant-function's. Has-participant-function is used to name the relevant functions for an model fragment instance. It is typically defined as an instance slot on a model-fragment class." :def (and (individual-thing ?instance) (participant-function ?function)) :issues ("See the discussion about HAS-QUANTITY-FUNCTION.") ) (define-relationPARTICIPANT-FUNCTION-TOTAL-ON(?function ?class) :iff-def (and (participant-function ?function) (class ?class) (total-on ?function ?class)) :issues ((:formerly-called participant-function) "See the discussion about QUANTITY-FUNCTION-TOTAL-ON.")) (define-functionSLOT-DOCUMENTATION(?class ?unary-function) :-> ?doc :def (and (class ?class) (unary-function ?unary-function) (string ?doc)) :axiom-def (facet slot-documentation) );==============================================================================;; Added by JPR.(define-classnon-numeric-quantity(?x)) (define-classstep-quantity(?x)) (define-classcount-quantity(?x))