previous up contents next
Left: Lexical tokens Up: Syntax Right: Sentences

Right-hand-side expressions

 The expressions that may appear as the right-hand-sides of DATR equations are sequences of zero or more descriptors. DATR makes a distinction between a path not having a value (i.e., being undefined) and a path having the empty sequence as a value:
        <two> ==
        <one> == one.
In this example, NUM:<one> has the value one, NUM:<two> has the empty sequence as its value, and NUM:<three> is simply undefined. Descriptors are defined recursively, and come in seven kinds. The simplest descriptor is just an atom or variable:

Then there are three kinds of local inheritance descriptor: a node, an (evaluable) path, and a node/path pair. Nodes are primitive tokens, paths are descriptor sequences (defined below) enclosed in angle brackets and node/path pairs consist of a node and a path separated by a colon:

    <desc1 desc2 desc3 ...>
    Node1:<desc1 desc2 desc3 ...>

Finally there are three kinds of global inheritance descriptor, which are quoted variants of the three local types just described:

    "<desc1 desc2 desc3 ...>"
    "Node1:<desc1 desc2 desc3 ...>"

A descriptor sequence is a (possibly empty) sequence of descriptors. A descriptor containing an evaluable path may include nested descriptors which are either local or global. Our use of the local/global terminology always refers to the outermost descriptor of an expression. The recursive definition of evaluable paths in terms of descriptor sequences allows arbitrarily complex expressions to be constructed, such as:

    "Node1:<"<atom1>" Node2:<atom2>>"
    "<"<"<Node1:<atom1 atom2> atom3>" Node2 "<atom4 atom5>" <> >">"
But the value sequences determined by such definitions are flat: they have no structure beyond the simple sequence and in particular do not reflect the structure of the descriptors that define them.

We shall sometimes refer to descriptor sequences containing only atoms as simple values, and similarly (unquoted) path expressions containing only atoms as simple paths.


previous up contents next
Left: Lexical tokens Up: Syntax Right: Sentences
Copyright © Roger Evans, Gerald Gazdar & Bill Keller, Tuesday 10 November 1998