# 13.6.5 Enforcing Constraints

Natural language imposes constraints which, for example, disallow sentences such as “A students eat.” Words in a sentence must satisfy some agreement criteria. “A students eat.” fails to satisfy the criterion of number agreement, which specifies whether the nouns and verbs are singular or plural.

Number agreement can be enforced in the grammar by parametrizing the non-terminals by the number and making sure that the numbers of the different parts of speech agree. You only need to add an extra argument to the relevant non-terminals.

###### Example 13.38.

The grammar of Figure 13.10 does not allow “a students,” “the student eat,” or “the students eats,” because all have number disagreement, but it allows “a green student eats,” “the students,” or “the student,” because “the” can be either singular or plural.

To parse the sentence “the student eats,” you issue the query

 $\mbox{{ask}~{}}~{}sentence([the,student,eats],[\,],Num,T)$

 $\displaystyle{Num=singular,}$ $\displaystyle{T=s(np(definite,[\,],student,nopp),vp(eat,nonp,nopp)).}$

To parse the sentence “the students eat,” you issue the query

 $\mbox{{ask}~{}}~{}sentence([the,students,eat],[\,],Num,T)$

 $\displaystyle{Num=plural,}$ $\displaystyle{T=s(np(definite,[\,],student,nopp),vp(eat,nonp,nopp)).}$
 $\mbox{{ask}~{}}~{}sentence([a,student,eats],[\,],Num,T)$
 $\displaystyle{Num=singular,}$ $\displaystyle{T=s(np(indefinite,[\,],student,nopp),vp(eat,nonp,nopp)).}$