18.5.1 Sentences
To this point, we've only dealt with simple declarative sentences. This section expands our coverage to include the other sentence types first introduced in Ch. 12: imperatives, yes-no-questions, and wh-questions. Let's start by considering the following examples:
(18.10) Flight 487 serves lunch.
(18.11) Serve lunch.
(18.12) Does Flight 207 serve lunch?
(18.13) Which flights serve lunch?
The meaning representations of these examples all contain propositions concerning the serving of lunch on flights. However, they differ with respect to the role that these propositions are intended to serve in the settings in which they are uttered. More specifically, the first example is intended to convey factual information to a listener, the second is a request for an action, and the last two are requests for information. To capture these differences, we will introduce a set of operators that can be applied to FOL sentences in the same way that belief operators were used in Ch. 17. Specifically, the operators DCL, IMP, YNQ, and WHQ will be applied to the FOL representations of declaratives, imperatives, yes-no-questions, and wh-questions, respectively.
Producing meaning representations that make appropriate use of these operators requires the right set of semantic attachments for each of the possible sentence types. For declarative sentences, we can simply alter the basic sentence rule we have been using as follows:
$$ S\to NP~VP\qquad\{DCL(NP.sem(VP.sem))\} $$
The normal interpretation for a representation headed by the DCL operator would be as a factual statement to be added to the current knowledge-base.
Imperative sentences begin with a verb phrase and lack an overt subject. Because of the missing subject, the meaning representation for the main verb phrase will consist of a $ \lambda $-expression with an unbound $ \lambda $-variable representing this missing subject. To deal with this, we can simply supply a subject to the $ \lambda $-expression by applying a final $ \lambda $-reduction to a dummy constant. The IMP operator can then be applied to this representation as in the following semantic attachment:
$$ S\to VP\qquad\{IMP(VP.sem(DummyYou))\} $$
Applying this rule to example (18.11), results in the following representation:
$$ IMP(\exists e Serving(e)\land Server(e,DummyYou)\land Served(e,Lunch) $$
As will be discussed in Ch. 23, imperatives can be viewed as a kind of speech act.
As discussed in Ch. 12, yes-no-questions consist of a sentence-initial auxiliary verb, followed by a subject noun phrase and then a verb phrase. The following semantic attachment simply ignores the auxiliary, and with the exception of the YNQ operator, constructs the same representation that would be created for the corresponding declarative sentence:
$$ S\toAux\,N P\,V P\quad\left\{Y N Q(V P.s e m(N P.s e m))\right\} $$
The use of this rule with for example (18.12) produces the following representation:
$$ Y N Q(\exists e S e r v i n g(e)\land S e r v e r(e,F l t207)\land S e r v e d(e,L u n c h)) $$
Yes-no-questions should be thought as asking whether the propositional part of its meaning is true or false given the knowledge currently contained in the knowledge-base. Adopting the kind of semantics described in Ch. 17, yes-no-questions can be answered by determining if the proposition is in the knowledgebase, or can be inferred from it.
Unlike yes-no-questions, wh-subject-questions ask for specific information about the subject of the sentence rather than the sentence as a whole. The following attachment produces a representation that consists of the operator WHQ, the variable corresponding to the subject of the sentence, and the body of the proposition:
$$ S\rightarrow WhWord NP VP\qquad\{WHQ(NP.sem.var,VP.sem(NP.sem))\} $$
The following representation is the result of applying this rule to example (18.13):
$$ \begin{array}{c} WHQ(x,\exists e,x Isa(e,Serving)\land Server(e,x)\\ \land Served(e,Lunch)\land Isa(x,Flight))\end{array} $$
Such questions can be answered by returning a set of assignments for the subject variable that make the resulting proposition true with respect to the current knowledge-base.
Finally, consider the following wh-non-subject-question:
(18.14) How can I go from Minneapolis to Long Beach?
In examples like this, the question is not about the subject of the sentence but rather some other argument, or some aspect of the proposition as a whole. In this case, the representation needs to provide an indication as to what the question is about. The following attachment provides this information by providing the semantics of the auxiliary as an argument to the WHQ operator:
$$ S\to\operatorname{\sf W h W o r d A u x N P}V P\setminus\{\operatorname{\sf W H Q}(\operatorname{\sf W h W o r d.s e m}V P.s e m(N P.s e m))\} $$
The following representation would result from an application of this rule to example (18.14):
$$ \begin{array}{c} WHQ(How,\exists e~Isa(e,Going)\land Goer(e,User)\\ \land Origin(e,Minn)\land Destination(e,LongBeach))\end{array} $$
As we'll see in Ch. 23, correctly answering this kind of question involves a fair amount of domain specific reasoning. For example, the correct way to answer example (18.14) is to search for flights with the specified departure and arrival cities. Note, however, that there is no mention of flights or flying in the actual question. The question-answerer, therefore, has to apply knowledge specific to this domain to the effect that questions about going places are really questions about flights to those places.
Finally, we should make it clear that this particular attachment is only useful for rather simple wh-questions without missing arguments or embedded clauses. As discussed in Ch. 16, the presence of long-distance dependencies in these questions requires additional mechanisms to determine exactly what is being asked about. Woods (1977) and Alshawi (1992) provide extensive discussions of general mechanisms for handling wh-non-subject questions.