Table of Contents

Function Define-Frame

Define-frame is a syntax for giving definitions that look like frames. It is designed to make it easy to map into object-oriented representations.

The syntax is:

(define-frame <frame-name>
      :own-slots ((<own-slot-spec>)*)
      :template-slots ((<template-slot-spec>)*)
      :axioms (<axiom>*)
      :issues <issue-tree>
      :theory <theory-spec>
      )
   <own-slot-spec> :== (<slot-name> <value-spec>+)
   <template-slot-spec> :== (<slot-name> <facet-or-value-spec>+)
   <value-spec> :== <constant> | (SETOF <constant>*) | (LISTOF <constant>*)
		    | (QUOTE <lisp s-expression>)
   <constant> :== <string> | <symbol> | <number>
   <facet-or-value-spec> :== <value-spec> | (<facet> <value-spec>*)
   <issue-tree> :== <symbol> | <string> | ({<symbol> | <string>}+)
<frame-name> :== symbol naming a class, relation, function, or object <slot-name> :== symbol naming a binary relation or unary function <facet> :== symbol naming a slot constraint relation, such as VALUE-TYPE
   <axiom> :== KIF sentence mentioning <frame-name>

In this syntax, all named objects are frames. Whether a frame is a class, relation, function, or other kind of object is given by the values of the INSTANCE-OF slot.

The remaining keyword arguments may occur in any order, and are described below:

:AXIOMS - The value of :AXIOMS is a list of KIF sentences mentioning <frame-name>. These axioms can be used to say things that can't be expressed in the restricted slot/value format.

:ISSUES - The value of this argument should be a Lisp "tree" of strings. The tree can be either a string, or a list of strings, or a list of (<label> <any-lisp-object>) pairs, where <label> is a string or symbol that names the type of the comment. For examples,

   :issues ("This is a footnote about FOO."
            (:example (= (foo ?x) (inverse (bar ?x))))
            ("Why not do it this way?

:OWN-SLOTS - slots on the object itself, as opposed to the instances of a class. If the object is a class, then own slots describe relationships and properties of the class as a whole, such as its superclasses and documentation. If the object is an instance, then own slots describe properties of the object, including the relation instance-of.

Own slots are binary relations applied to frames, with the frame inserted as a first argument. For example,

    (define-frame frame-1
      :own-slots ((instance-of class-2)))

translates to the KIF sentence

     (instance-of frame-1 class-2)

The value of a slot may be either a constant like a number or symbol, or it may be a list beginning with one of the KIF operators SETOF, LISTOF, and QUOTE.

The expression (SETOF a b c) denotes the set containing a, b, and c.

The expression (LISTOF d e f) denotes the sequence d,e,f.

The expression (QUOTE x) denotes the expression x, where x may be any lisp expression.

There are many possible own slots. Here are some that are recognized by Ontolingua translators: INSTANCE-OF SUBCLASS-OF ALIAS DOCUMENTATION DOMAIN SUBRELATION-OF NTH-DOMAIN RANGE SUBCLASS-PARTITION EXHAUSTIVE-SUBCLASS-PARTITION

:TEMPLATE-SLOTS - only make sense if the frame is an instance of CLASS, because template slots describe properties of instances of the class. For example, the template slot spec

     (slot-2 (SLOT-VALUE-TYPE type-3))

for the frame class-1 translates to the KIF sentence

     (slot-value-type class-1 slot-2 type-3)

which is a second-order way of saying

     (forall ?c (=> (and (instance-of ?c class-1)
			 (defined (slot-2 ?c)))
		    (instance-of (slot-2 ?c) type-3)))

A value of a template slot is a downward inherited value (it is a slot value for all instances of the class). For frame class-1, the template slot spec

     (slot-2 value-3)

translates into the KIF sentence

     (inherited-slot-value class-1 slot-2 value-3)

The frame ontology defines the set of facets recognized by Ontolingua. The following are guaranteed to be supported: INHERITED-SLOT-VALUE SLOT-CARDINALITY MAXIMUM-SLOT-CARDINALITY MINIMUM-SLOT-CARDINALITY SLOT-VALUE-TYPE

:THEORY - The value of this keyword argument should be a symbol which names the theory in which the definition should be defined. If the :THEORY argument is not supplied, the current theory is assumed (see IN-THEORY.)

Alternate Slot Syntax

Ontolingua supports additional syntax for writing some definition sentences in a frame/slot style instead of the predicate calculus style of KIF. This additional syntax is supported via three additional definition keywords, whose associated values are lists of sentences in the following format, called a SLOT-VALUE-SPEC:

    (slot-name slot-value1 slot-value2 ...) 

SLOT-NAME is the name of a binary relation. The first argument to this binary-relation (the frame) is made implicit by the keyword with which the sentence is associated, and each SLOT-VALUE is a second argument to the relation.

During the translation process, Ontolingua will transform such a sentence into the equivalent KIF sentences

    (slot-name frame slot-value-1)
    (slot-name frame slot-value-2)

These resulting sentences will be added to the :AXIOM-DEF, :CONSTRAINTS, :AXIOM-CONSTRAINTS, or :DEFAULT-CONSTRAINTS sentences depending on the keyword with which the original slot-syntax sentences are associated.

The three keywords supported in this manner are as follows:

:CLASS-SLOTS - The associated value should be a list of SLOT-VALUE-SPECs whose frames are taken to be the relation being defined. Thus, the relations corresponding to the slot names are second-order relations (see "Second Order Sentences" above.) Sentences translated from :CLASS-SLOTS are added to the :AXIOM-DEF sentence.

:INSTANCE-SLOTS - This keyword is only valid in the definition of unary relations (or equivalently, classes.) The associated value should be a list of SLOT-VALUE-SPECs sentences whose frames are taken to be individuals for which the unary relation holds. Sentences translated from :INSTANCE-SLOTS are added to the :CONSTRAINTS sentence.

An extended slot syntax is supported for this keyword which allows values for "facets" of slots to be provided. Within the SLOT-VALUE-SPECS any of the slot-values may be a list of the form:

   (facet facet-value1 facet-value2 ...)

Ontolingua will transform these into the equivalent KIF sentences:

   (facet relation slot facet-value1)
   (facet relation slot facet-value2)

:DEFAULT-SLOT-VALUES - This keyword is only valid in the definition of unary relations (or equivalently, classes.) The associated value should be a list SLOT-VALUE-SPECs sentences whose frames are taken to be individuals for which the unary relation holds. Sentences translated form :DEFAULT-SLOT-VALUES are added to the :DEFAULT-CONSTRAINTS sentences, and will therefore hold for each instance of the class until and unless a contrary assertion is made about that instance.