next up previous contents
Next: Syntactic Sugar Up: Top-level Forms Previous: defQuantityFunction

Forms for defining model fragments

 

This section defines the syntax and semantics for the key CML forms defModelFragment and its restricted version defEntity.

tex2html_wrap2378

tex2html_wrap2380 The defModelFragment form defines a class of objects which are described by common static attributes and time dependent quantities, it also defines consequences that hold only when an instance of the class is active. The defModelFragment form may define conditions sufficient to imply the existence of an instance, in addition to the necessary consequences thereof.

The defEntity form is a restricted version of defModelFragment that is used for defining properties of a single object that are always true. The defEntity form defines only necessary consequences of an object being an instance of the class, not conditions sufficient to imply the existence of an instance.

The defEntity and defModelFragment forms have been designed to support an object-oriented style of defining domain theories. Each form defines a class of objects specified by sets of static attributes and time dependent quantities. These attributes and quantities are effectively slots defined on instances of the class. Furthermore, these classes may be arranged in a hierarchy via a :subclass-of relation.

   figure366
Figure: Model fragments are defined with the defModelFragment form. They provide conditionalized descriptions of the participating objects.

   figure372
Figure: Sample entity definition. In the equation, note that there are multiple syntactic forms for referencing quantities (i.e., (volume :self) and diameter).

   figure379
Figure: Syntax specification for the defEntity form.
Figure: Syntax specification for the defModelFragment form.

The name of the model fragment or entity, name, is a relation constant naming the class of instances.

:subclass-of
The :subclass-of clause allows a hierarchy to be defined. Each super is the name of a model fragment or entity definition. An instance of name is also an instance of each superclass. As a consequence, all of the participant, quantity, and attribute functions defined for each super are also defined for name.

:participants
The :participants clause identifies the objects that participate in the model fragment instance. Each participant is a function constant that names a unary function which may be applied to an instance to access the corresponding participant; each type is a relation constant that names a unary relation -- a class of which the participant is an instance.

:conditions
The :conditions clause specifies the conditions under which an instance of a model fragment is active. If the conditions hold over the specified participants, then an instance of the model fragment exists with the specified quantities and attributes. The conditions is an implicit conjunction of literals.

tex2html_wrap2382 The binary relations same and different may be used in the :conditions to state that two (usually inherited) participants are the same or different from each other.

tex2html_wrap2384

:attributes
The :attributes clause may be used to define static attributes of an instance. Each attribute is a symbol naming a function that is totally defined for instances of name. The attributes are polymorphic, that is, an attribute of the same name may be defined for another unrelated form with a different type.

:quantities
  The :quantities clause may be used to locally define quantities that describe an instance. The QF keywords are the keyword options defined for defQuantityFunction (See section gif, page gif) except that :=> is not allowed. Such implications may be placed in the :consequences clause. The quantities are polymorphic, that is, a quantity of the same name may be defined for another unrelated model fragment, but have different properties. Nonetheless, quantity functions defined in a :quantities clause must be consistent with any of the constraints imposed by a defQuantityFunction definition of the same name.

:consequences
The :consequences clause holds whenever an instance is active. The consequences is an implicit conjunction of literals. The primary role of the consequences is to establish equations that help to define the behavior of the participants. In addition to equations, the consequences may assert that various quantities are defined, as well as logical relations that do not involve quantities.




next up previous contents
Next: Syntactic Sugar Up: Top-level Forms Previous: defQuantityFunction

Tom Mostek
Wed Jan 21 13:00:43 CST 1998