There are two forms of references in Noos: name references and path references . We already have used identifiers as name references--e. g. John description referred to Nick description as father. Clearly, only named descriptions have identifiers, so anonymous descriptions cannot be referred to by named references. Path references can designate any description by specifying a sequence of feature names that from a named description leads to the target description. The syntax for a path reference is a list that starts with ``>>'' (pronounced chip-chip), following there is a sequence of feature names, and finally the separator ``of'' and the identifier of the named description. For instance, the father of the mother of John (which is David in Example 2.1) is written:
It is clear that this reference is in fact the concatenation of two references: the reference to the mother of John, say X, and then reference to the father of X. We can write this two concatenated references as follows:
In fact, the first expression is just short syntax for the second syntax. Usually, this is not an important difference--except when working with reflective operations--like reify--that do work with syntax itself. The intuitive interpretation of path reference is that of functional composition. As we said, features can be interpreted as functions, as in . Thus, path reference (>> father mother of John) is the functional composition of father and mother functions--namely .
A query engages the system in inference and lazy evaluation determines that only the feature values needed for the query will be expanded. The Listener, however, does not accept named references from the user. The reason is related to this question: What is the meaning of a null length path reference? A null length path reference, like (>> of John), is by definition the name reference to John. So named references are subsumed as a special case of path references, but the shortcut of using only the name is useful in descriptions--but not on the Listener where the null path reference has to be used (see the penultimate line of Example 2.4).
We can distinguish two kinds of path references: absolute and relative . Absolute path references are those we have already introduced: path references that specify a path from an fixed starting point given by the identifier of a named description after the of token. For instance, (>> father mother of John) is an absolute path that leads from John to David. A relative path reference elides the fixed start given by a name and simply specifies a path, e. g. (>> father mother). A relative path reference has to be interpreted also as functional composition --this time over variables, as in . The rules of scope specify how these variables are to be bound.