## Using Attributes and Constraints

We spoke informally of linguistic categories having properties, for example, that a noun has the property of being plural. Let's make this explicit:

In (9), we have introduced some new notation which says that the category N has a (grammatical) feature called NUM (short for "number") and that the value of this feature is pl (short for "plural"). We can add similar annotations to other categories, and use them in lexical entries:

(10) Det[NUM=sg] -> 'this' Det[NUM=pl] -> 'these'

N[NUM=sg] -> 'dog' N[NUM=pl] -> 'dogs' V[NUM=sg] -> 'runs' V[NUM=pl] -> 'run'

Does this help at all? So far, it looks just like a slightly more verbose alternative to what was specified in (8). Things become more interesting when we allow variables over feature values, and use these to state constraints:

(11) S -> NP[NUM=?n] VP[NUM=?n] NP[NUM=?n] -> Det[NUM=?n] N[NUM=?n] VP[NUM=?n] -> V[NUM=?n]

We are using ?n as a variable over values of NUM; it can be instantiated either to sg or pl, within a given production. We can read the first production as saying that whatever value NP takes for the feature NUM, VP must take the same value.

In order to understand how these feature constraints work, it's helpful to think about how one would go about building a tree. Lexical productions will admit the following local trees (trees of depth one):

Now NP[NUM=?n] -> Det[NUM=?n] N[NUM=?n] says that whatever the NUM values of N and Det are, they have to be the same. Consequently, this production will permit (12a) and (13a) to be combined into an NP, as shown in (14a), and it will also allow (12b) and (13b) to be combined, as in (14b). By contrast, (15a) and (15b) are prohibited because the roots of their subtrees differ in their values for the NUM feature; this incompatibility of values is indicated informally with a FAIL value at the top node.

these dogs