Roberts, R. Bruce and Ira P. Goldstein "The FRL Primer" MIT AI Lab Memo AIM-408 July 1977 view details
Abstract: The Frame Representation Language (FRL) is an experimental language written to explore the use of frames as a knowledge representation technique. The term 'frame' as used in FRL was inspired by Minsky's [75] development of frame theory. FRL extends the traditional Property List representation scheme by allowing properties to have comments, defaults and constraints, to inherit information from abstract forms of the same type, and to have attached procedures triggered by adding or deleting values, or if a value is needed. We introduce FRL with the aid of a simple example: WHOSIS, a database of AI persons' names, addresses, interests and publications. A second section contains an abridged manual describing FRL's most-used commands and conventions.
External link: Online copy
Extract: The (abridged) FRL Manual
The (abridged) FRL Manual
I. What is a FRAME?
A FRL frame is implemented as nested association lists with at most five levels of embedding. The respective sub-
structures of a Frame are named: Slot, Facet, Datum, Comment and Message. The overall structure of a frame follows:
(framel (slotl (facetl (datuml (labell messagel message? ... more Messages ... )
... more Comments ...) (datum? (
labell messagel ...))
... more Data ...) (facet? (datuml (labell messagel message? ...)))
... more Facets
...)
(slot? (facetl (datuml (labell messagel ...) ...)...)...) ... more Slots ...)
We will refer to the first element in one of
these sub-structures as the indicator (said to name the structure)
and the remaining elements collectively as the bucket (in the case
of a slot, the bucket is a list of facets, for example). A path of
indicators identifies a sub-structure in a frame. The order of
sub-structures at any level in a frame is insignificant. In
practice, facet names conventionally have a prefix "$"; labels, a
suffix ":". This is simply to facilitate their recognition by the
programmer.
2. Adding and Removing Frames.
(FASSERT name slotl slot2 - slotN)
creates a frame name (if it doesn't already
exist) containing the slots slotl ... slotN. If the name frame
exists, the new information in the slots is merged with the
existing slots. The frame is stored as the FRAME property of name
and name is added to *FRAMES*, the list of known frames. FASSERT is
a FEXPR.
The FASSERT switch. If FASSERT is nil, FASSERT
forms are not interpreted. This is convenient for selectively
reading just the code in a file containing intermixed code and
frame definitions.
(FERASE frame)
removes frame from the FRAME property of its
name and its name from the list *FRAME*.
Unless stated otherwise, a frame argument to a
function can be either the name of a frame or the frame structure
itself.
3. Frames and their names.
(FRAME frame)
returns a frame structure. An error if frame is
neither a frame name nor a frame structure.
(FNAME frame)
returns the name of frame. An error if frame is
neither a frame name nor a frame structure
(FSLOTS fame)
returns a list of the slot names in
frame.
4. The AKO and INSTANCE slots.
A slot is a generalization of the
attribute-value pair in the traditional Property List
representation, $VALUE is the slot facet which indicates its
values. Five other "facets" indicate other types of knowledge
associated with the slot. Data in the $DEFAULT facet supplies
defaults. Data in $IF-ADDED and $IF-REMOVED facets are procedures
triggered whenever a slot value is added or removed. $IF-NEEDED
data are procedures which may compute a slot value. The $REQUIRE
facet hold predicates which describe and restrict the value.
Two slots are recognized by FRL system
functions: AKO (A Kind Of) and INSTANCE. These define a relation
between frames along which data is inherited. The AKO relation is
used to establish a conceptual hierarchy of frames in which general
information stored higher in the hierarchy is inherited by more
specialized concepts lower in the hierarchy. The INSTANCE slot is
maintained as an inverse of the AKO pointer; thus
(FPUT 'A 'AKO 'B)
has the side-effect of asserting
(FPUT 'B 'INSTANCE 'A).
(FINSTANTIATE frame {name})
creates an instance of frame; i.e., it possesses
only an AKO link to frame. Its name is derived from the optional
name argument and will be unique. The newly created frame is
returned.
A relation between frames is defined by making
the name of one frame the value of a slot in another frame. The
slot names the relation. A tree of frame relations is possible
since a slot can have many values. Several functions are provided
to examine these relations.
(FCHILDREN frame slot)
returns a list of the immediate inferiors of
frame along the relation named by slot. This is just a list of
values in slot.
(FTREE frame slot)
returns a tree of the form (root subtreel
subtree2 ...) with frame at the root; each subtree's root is a
child of frame along the relation named by slot.
(FDESCENDANTS fame slot)
returns a list of all inferiors of frame along
the relation slot defines. That is, it includes all the frames
occurring in the "tree" of FTREE except the root frame.
(FRINGE frame slot)
returns a list of all "leaves" on the tree of
(FTREE frame slot). (FLINK? relation fl (2)
Does relation connect fl to f2? Relation is a
slot name whose values must be frame names; fl and (2 are frames.
(FLINK? 'AKO 'A 'B) is true only if a path exists from A to B
following only the AKO "link"; i.e, if one of the values of the AKO
slot of A is B, or FLINK? is true for any of these values.
(AKO? f1 f2)
returns T only if f1 is a kind of f2. Equivalent
to (FLINK? 'AKO f1 f2). Similar definitions are possible for any
slot whose value is another frame.
5. Adding and Removing Parts of a Frame.
(FPUT frame slot facet datum label message)
adds the last argument at the point in frame
named by the indicator path (the intervening arguments) and returns
the modified frame. Adding new information to a frame is a merging
process that retains the uniqueness of each indicator. FPUT is a
LEXPR and can take from 2 to 6 arguments. It can be used to add an
element anywhere in a frame, to add a slot name to frame or to put
a message in a comment labeled label.
FPUT has an important side-effect Putting data
items into a $VALUE facet triggers the execution of all procedures
in the $IF-ADDED facet of the slot.
(FREMOVE frame slot facet datum label message )
deletes the sub-structure of frame indicated by
the path slot -> facet -> datum... . It returns the
modified frame. FREMOVE is a LEXPR and can take from 2 to 6
arguments. The structure deleted will have had as its indicator the
final argument to FREMOVE.
FREMOVE, too, has an important side-effect If
any data in a $VALUE facet is deleted by this command, all
procedures in the $IF-REMOVED facet of the slot are
executed.
6. The $IF-ADDED and $IF-REMOVED
procedures.
Data in the $IF-ADDED and $IF-REMOVED facets is
treated as evaluable LISP forms. The forms in the $IF-ADDED facet
will be run whenever a value is added to the slot (i.e., in the
$VALUE facet) by FASSERT or FPUT. The forms in the $IF-REMOVED
facet will be run whenever a value is deleted from a slot (i.e.,
from the $VALUE facet) by FERASE or FREMOVE.
** All local and inherited procedures will be
run.
** No $IF-ADDED procedure will be run if the
value was already there. This serves to eliminate loops.
** No $IF-REMOVED procedure will be run if the
value was not actually there to be removed.
** The procedures will be run in a Frame
Environment in which the following global variables have been
bound:
:FRAME - frame
:SLOT -
- slot
:FACET - $IF-ADDED or $IF-REMOVED (as
appropriate).
In addition, the free variable ":VALUE" will be
bound to the datum whose addition or removal precipitated the
execution of the attached procedures.
7. Retrieving Parts of a Frame.
(FGET frame slot facet datum label message
)
returns a list of all the indicators in the
bucket addressed by the path of arguments. Usually, three arguments
are given. The value of a slot is retrieved by (FGET frame slot
'$VALUE). FGET looks first in the slot of frame. If data exists, a
list of the items is returned. If no data is found, the facet of
the frame named in frame's AKO slot is inspected; and so on until a
frame is found containing data, which is then returned.
An important special case is FGETting from a
$VALUE facet. If still no value is found, FGET repeats, looking in
the $DEFAULT facet instead.
** Inheritance stops at the first frame along
the chain of AKO links that contains data.
** If FGET returns NIL, no data was
found.
** A frame can be a-kind-of more than one other
frame; i.e., have more than one value in its AKO slot. FGET traces
each of the AKO paths, stopping at the first data encountered along
each, and returns a list of all data thus found appended
together.
** The FINHERIT Comment A comment - (FINHERIT:
CONTINUE) - on all datum structures in a facet causes the
inheritance to proceed further along the AKO link as if no data had
been found; it returns the local data appended to that found
further along the link.
8. The $IF-NEEDED procedures.
All data in the $IF-NEEDED facets is treated as
a LISP procedure. It can be run using the following
function.
(FNEED frame slot)
executes the procedures in the IIF-NEEDED facet
of slot in frame. The procedures will be run in a Frame Environment
in which the following free variables have been bound:
:FRAME = frame, :SLOT = slot, :FACET = $IF-
NEEDED
9. Constraining a Value.
Data items in the $REQUIRE facet should be a
Lisp predicates which describe allowable values for the slot There
is an implicit conjunction between all data items present The
predicates are evaluated in the appropriate Frame Environment, like
the other procedural knowledge already discussed. The variable
:VALUES is bound to the list of values in question.
(FCHECK frame slot {value})
returns a poll of all constraints in the
$REQUIRE facet of slot in frame applied to the values of the slot
Both local and inherited constraints are included. If an optional
value is supplied, it is checked against the constraints instead.
Constraints are run in a Frame Environment with :FRAME, :SLOT and
:VALUES bound. A poll is a list of four elements:
(<summary> <list of true predicates>)
<list of false predicates>) <list of error-producing predicates>)
where the <summary> is T only if all are
true, NIL only if some are false and none produce errors, and ?
otherwise.
Two predicates test the classification of a
frame. Frames in an AKO hierarchy are distinguished as being either
GENERIC or INDIVIDUAL by the value of their CLASSIFICATION
slot
(INDIVIDUAL? frame)
returns T only if frame is marked as an
individual. INDIVIDUAL? returns NIL if frame is generic, and ?
otherwise.
(GENERIC? frame)
is defined analoguously to INDIVIDUAL?.
10. Saving and Restoring Frames.
(FDUMP frames file)
outputs to file each frame in the list frames.
Frames so dumped can be read back, into FRL to restore the state of
the these frames in the data base. FDUMP creates a file of DEFRAME
forms.
(DEFRAME name slot1 slot2..._ shift)
defines a frame name containing precisely the
slots slot1 ... slotN. Should name already exist, its previous
definition is destroyed. The frame is stored as the FRAME property
of name and name is added to *FRAMES*, the list of known frames.
DEFRAME is a FEXPR.
The DEFRAME switch. If DEFRAME is nil, DEFRAME
forms are not interpreted. This is convenient when for selectively
reading a file with intermixed code and frame definitions.