18.3.2 Constraint-Based Approaches
NEXT DRAFT HOLE SEMANTICS
18.4 UNIFICATION-BASED APPROACHES TO SEMANTIC ANALYSIS
As mentioned in Sec. 18.2, feature structures and the unification operator provide an effective way to implement syntax-driven semantic analysis. Recall that in Ch. 16 we paired complex feature structures with individual context-free grammar rules to encode syntactic constraints such as number agreement and subcategorization; constraints that were awkward or in some cases impossible to convey directly using context-free grammars. For example, the following rule was used to capture agreement constraints on English noun phrases.
NP $ \rightarrow $ Det Nominal
$$ \langle D e t\ A G R E E M E N T\rangle=\langle N o m i n a l\ A G R E E M E N T\rangle $$
$$ \langle N P\ A G R E E M E N T\rangle=\langle N o m i n a l\ A G R E E M E N T\rangle $$
Rules such as this one serve two functions at the same time: they ensure that the grammar rejects expressions that violate this constraint, and more importantly for our current topic, they create complex structures that can be associated with parts of grammatical derivations. The following structure, for example, results from the
application of the above rule to a singular noun phrase.

We'll use this latter capability to compose meaning representations and associate them with constituents in parse.
In this unification-based approach, our FOL representations and $ \lambda $-based semantic attachments are replaced by complex feature structures and unification equations. To see how this works, let's walk through a series of examples similar to those discussed earlier in Sec. 18.2. Let's start with a simple intransitive sentence with a proper noun as it's subject.
(18.7) Rhumba closed
Using an event-oriented approach, the meaning representation for this sentence should be something like the following.
$$ \exists e\;Closing(e)\land Closed(e,R h u m b a) $$
Our first task will be to show that we can encode representations like this within the feature structure framework. The most straightforward way to approach this task is to simply follow the BNF-style definition of FOL statements given in Ch. 17. The relevant elements of this definition stipulate that FOL formulas come in three varieties: atomic formulas consisting of predicates with the appropriate number of term arguments, formulas conjoined with other formulas via the $ \land $, $ \lor $ and $ \Rightarrow $ operators, and finally quantified formulas which consist of a quantifier, variables and a formula. Using this definition as a guide, we can capture this FOL expression with the following feature structure.

Fig. 18.4 shows this expression using the DAG-style notation introduced in Ch. 16. This figure reveals the way that variables are handled. Instead of introducing explicit FOL variables, we’ll use the path-based feature-sharing capability of feature structures to accomplish the same goal. In this example, the event variable e is captured by the three paths leading to the same shared node.

Our next step is to associate unification equations with the grammar rules involved in this example's derivation. Let's start at the top with the S rule.
$$ S\rightarrow NP VP $$
$$ \langle S\operatorname{SEM}\rangle=\langle NP\operatorname{SEM}\rangle $$
$$ \left\langle V P\operatorname{A R G0}\right\rangle=\left\langle N P\operatorname{I N D E X V A R}\right\rangle $$
$$ \left\langle N P\operatorname{SCOPE}\right\rangle=\left\langle V P\operatorname{SEM}\right\rangle $$
The first line simply equates the meaning representation of the NP (encoded under the SEM feature) with our top-level S. The purpose of the second equation is to assign the subject NP to the appropriate role inside the VP's meaning representation. More concretely, it fills the appropriate role in the VP's semantic representation by unifying the ARG0 feature with a path that leads to a representation of the semantics of the NP. Finally, it unifies the SCOPE feature in the NP's meaning representation with a pointer to the VP's meaning representation. As we'll see, this is a somewhat convoluted way to bring the representation of an event up to where it belongs in the representation. The motivation for this apparatus should become clear in the
ensuing discussion where we consider quantified noun phrases.
Carrying on, let's consider the attachments for the NP and ProperNoun parts of this derivation.
NP $ \rightarrow $ ProperNoun
$$ \langle N P\operatorname{SEM}\rangle=\langle ProperNoun\operatorname{SEM}\rangle $$
$$ \langle N P\operatorname{SCOPE}\rangle=\langle Proper Noun\operatorname{SCOPE}\rangle $$
$$ \langle N P\mathrm{~I N D E X V A R}\rangle=\langle P r o p e r N o u n\mathrm{~I N D E X V A R}\rangle $$
ProperNoun $ \rightarrow $ Rhumba
$$ \langle ProperNoun~SEM~PRED\rangle=RHUMBA $$
$$ \langle{P r o p e r N o u n~I N D E X V A R}\rangle=\langle{P r o p e r N o u n~S E M~P R E D}\rangle $$
As we saw earlier, there isn't much to the semantics of proper nouns in this approach. Here we're just introducing a constant and providing an index variable to point at that constant.
Next, let's move on to the semantic attachments for the VP and Verb rules.
$$ VP\to Verb $$
$$ \langle V P S e m\rangle=\langle V e r b S e m\rangle $$
$$ \langle V P\operatorname{A R G0}\rangle=\langle V e r b\operatorname{A R G0}\rangle $$
Verb $ \rightarrow $ closed
$$ \langle V e r b\;S E M\;Q U A N T\rangle=\exists $$
$$ \langle V e r b\;S E M\;F O R M U L A\;O P\rangle=\Lambda $$
$$ \langle V e r b\;S E M\;F O R M U L A\;F O R M U L A1\;P R E D\rangle=C L O S I N $$
$$ \langle V e r b\;S E M\;F O R M U L A\;F O R M U L A1\;A R G0\rangle=\langle V e r b\;S E M\;V A R\rangle $$
$$ \langle V e r b\;S E M\;F O R M U L A\;F O R M U L A2\;P R E D\rangle=C L O S E D $$
$$ \langle V e r b\;S E M\;F O R M U L A\;F O R M U L A2\;A R G0\rangle=\langle V e r b\;S E M\;V A R\rangle $$
$$ \langle V e r b\;S E M\;F O R M U L A\;F O R M U L A2\;A R G1\rangle=\langle V e r b\;A R G0\rangle $$
The attachments for the VP rule parallel our earlier treatment of non-branching grammatical rules. These unification equations are simply making the appropriate semantic fragments of the Verb available at the VP level. In contrast, the unification equations for the Verb introduce the bulk of the event representation that is at the core of this example. Specifically, it introduces the quantifier, event variable and predications that make up the body of the final expression. What would be an event variable in FOL is captured by the equations unifying the Verb SEM VAR path with the appropriate arguments to the predicates in the body of the formula. Finally, it exposes the single missing argument (the entity being closed) through the $ \langle \text{Verb ARG0} \rangle $ equation.
Taking a step back we can see that these equations serve the same basic functions as the $ \lambda $-expressions in Sec. 18.2; they provide the content of the FOL formula being created, and they serve to expose and name the external arguments that will be filled in later at higher levels in the grammar.
These last few rules also display the division of labor that we've seen several times now; lexical rules introduce the bulk of the semantic content, while higher level grammatical rules assemble the pieces in the right way, rather than introducing content.
Of course, as was the case with the $ \lambda $-based approach things get quite a bit more complex when we look at expressions containing quantifiers. To see this, let's work through the following example.
(18.8) Every restaurant closed
Again, the meaning representation for this expression should be the following
$$ \forall x R e s t a u r a n t(x)\Rightarrow(\exists e C l o s i n g(e)\land C l o s e d(e,x)) $$
which is captured by the following feature structure.

As we saw earlier with the $ \lambda $-based approach, the outer structure for expressions like this comes largely from the subject noun phrase. Recall that schematically this semantic structure has the form $ \forall x P(x) \Rightarrow Q(x) $ where the $ P $ expression is traditionally referred to as the restrictor and is provided by the head noun and $ Q $ is referred to as the nuclear scope and comes from the verb phrase.
This structure gives rise to two distinct tasks for our semantic attachments: the semantics of the VP semantics must be unified with the nuclear scope of the subject noun phrase, and the variable representing that noun phrase must be assigned to the ARG1 role of the CLOSED predicate in the event structure. The following rules involved in the derivation of Every restaurant address these two tasks
NP $ \rightarrow $ Det Nominal
$ \langle NP SEM \rangle = \langle Det SEM \rangle $
$ \langle NP SEM VAR \rangle = \langle NP INDEXVAR \rangle $
$ \langle NP SEM FORMULA FORMULA1 \rangle = \langle Nominal SEM \rangle $
$ \langle NP SEM FORMULA FORMULA2 \rangle = \langle NP SCOPE \rangle $
Nominal $ \rightarrow $ Noun
$ \langle Nominal SEM \rangle = \langle Noun SEM \rangle $
$ \langle Nominal INDEXVAR \rangle = \langle Noun INDEXVAR \rangle $
Noun $ \rightarrow $ restaurant
$ \langle Noun SEM PRED \rangle = \langle RESTAURANT \rangle $
$ \langle Noun INDEXVAR \rangle = \langle Noun SEM PRED \rangle $
Det $ \rightarrow $ every
$ \langle Det SEM QUANT \rangle = \forall $
$ \langle Det SEM FORMULA OP \rangle = \Rightarrow $
As one final exercise, let's walk through an example with a transitive verb phrase.
(18.9) Franco opened a restaurant
This example has the following meaning representation.
$ \exists x \text{ Resaurant}(x) \land \exists e \text{ Opening}(e) \land \text{Opener}(e, \text{Franco}) \land \text{Opened}(e, x) $

The only really new element that we need to address in this example is the following transitive VP rule.
$$ VP\ \to\operatorname{Verb}NP $$
$$ \langle V P S e m\rangle=\langle V e r b S e m\rangle $$
$$ \left\langle N P\operatorname{SCOPE}\right\rangle=\left\langle V P\operatorname{SEM}\right\rangle $$
$$ \langle V e r b~A R G1\rangle=\langle N P~I N D E X V A R\rangle $$
This rule has the two primary tasks that parallel those in our S rule: it has to fill the nuclear scope of the object NP with the semantics of the VP, and it has to insert the variable representing the object into the right role in the VP's meaning representation.
One obvious problem with the approach we just described is that it fails to generate all the possible ambiguous representations arising from quantifier scope ambiguities. Fortunately, the approaches to underspecification described earlier in Sec. 18.3 can be adapted to the unification-based approach.
18.5 SEMANTIC ATTACHMENTS FOR A FRAGMENT OF ENGLISH
This section describes a set of semantic attachments for a small fragment of English, the bulk of which are based on those used in the Core Language Engine (Alshawi, 1992). As in the rest of this chapter, to keep the presentation simple, we omit the feature structures associated with these rules when they are not needed. Remember that these features are needed to ensure that the correct rules are applied in the correct situations. Most importantly for this discussion, they are needed to ensure that the correct verb entries are being employed based on their subcategorization feature structures.