A Quantifier Scoping Algorithm 
without A Free Variable Constraint 
Inn L ew in 
Department o.\[ Artificial Intelligence 
University of Edinburgh 
80 South Bridge 
Edinburgh EH1 1HN 
emaih il@aipna.ed.ac.uk 
Abstract 
Three recent demands on quantifier scoping al- 
gorithms have been that they should be explic- 
itly stated, they should be sound and complete 
with respect to the input sentence \[Hobbs and 
Shieber 1987\] and they should not employ a 'Free 
Variable Constraint' \[Pereira 1989\]. The first de- 
mand is for good academic practice. The second 
is to ask for an algorithm that generates all and 
only the possible scopings of a sentence. The 
third demand is for an algorithm that avoids 
appealing to the syntax of logical form in or- 
der to determine possible scopings. I present a 
modified version of \[Hobbs and Shieber 1987\], 
which simplifies its operation, and can be con- 
sidered sound and complete, depending on what 
interpretations of English sentences are deemed 
possible. Finally, any doubts concerning the use 
of logical form syntax are avoided. 
1 Introduction 
\[Hobbs and Shieber 1987\] presented an algorithm 
to generate quantifier scopings from a represen- 
tation of "predicate-argument relations and the 
relations of grammatical subordination" (pg 49). 
This representation is successively modified by 
a recursive algorithm until all the quantifiers 
present in the input have been dealt with and 
given scope over some part of the output. A 
sample input representation is, 
i. Ioves(<a x woman(x)> <every y man(y)>) 
where representations of quantified noun phrases, 
called complex terms, are left as arguments to 
the verb. A sample output is 
2. (a x woman(x) (every y man(y) lovesCx,Y))) 
which uses a four-part quantifier notation, and 
in which no complex terms are present. In con- 
verting 1) into 2) the recursive procedure may 
be called upon representations of intermediate 
format, eg 
(a woman( )loves(  <every y man(y)>)) 
where a four part quantifier phrase has an em- 
bedded complex term. 
The algorithm is claimed to be more successful 
than previous accounts in dealing with complex 
noun phrases such as "every representative of a 
company" and in coping with certain 'opaque' 
predicates such as negation. 1 
Two properties of an algorithm which Hobbs 
and Shieber (H&S) approve of are completeness 
and soundness. An algorithm with these prop- 
erties might be used as a benchmark for other 
algorithms designed for efficiency or the use of 
heuristics governing the plausibility of the vari- 
ous interpretations. Unfortunately, demonstrat- 
ing that H&S's algorithm is sound requires a 
semantics for the input language and the inter- 
mediate forms. That is not straightforward. 
I present a modified algorithm which avoids such 
intermediate forms. The input to the algorithm 
consists of English syntax. The steps of the al- 
gorithm retrace steps through a truth definition 
for the input language. Clearly, the algorithm is 
sound and complete with respect to that. The 
algorithm is also sound and complete with re- 
spect to English, if you agree that the input 
1They acknowledge \[Keller 1986\] as a similar solution 
190 
language fairly represents the actual language 
of English speakers. Furthermore, the algorithm 
is somewhat simpler than H&S's algorithm and 
makes no appeal to logical syntax. There is a 
Prolog implementation of the algorithm. 
2 Quantification in Logic 
Semantic theories generally recurse over the syn- 
tax of the object language. For example, fol- 
lowing the procedure and notation of \[Tennant 
1978\], '~ we say that 
g satisfies"(Vxf(x))" 
iff for every 0, g(x --+ o) satisfies "f(x)" 
Thus, the satisfaction of "(Y x f(x))" is given in 
terms of the satisfaction of formulae of the form 
"f(x)". Truth is defined as satisfaction by the 
null assignment, N. Given the following axiom 
g(x -* a) satisfies "f(x)" iff f'(a) 
then we can produce the following proof 
"( V x f(x))" is true 
iff N satisfies "(V x f(x))" 
for every o, N(x o) satisfies "fix)" 
iff \[or every o, f'(a) 
Finally~ formalising our meta.language gives 
"(V z f(x))" is true iff (V c~ f'(a)) 
This idea can be extended to structurally am- 
biguous sentences of English. Suppose C is some 
environment containing a complex term such as 
"<a y woman(y)>", then 
g satisties C(< all y woman (y) >) 
if (All a g(y --~ a) satisfies "woman(y)" 
g(y a) satisfies c(y)) 
Here, C(y) indicates the environment C(<a y 
woman(y) >) with y replacing the complex term. 
The extension involves two key changes. First, 
we employ a four part notation in the meta- 
language. Let us say that (All x f(x) g(x)) ab- 
breviates the English: for every object x such 
~We assume g is an assignment from variables to ob- 
jects dealing with all variables required, g(x --~ a) is g 
modified so that x is assigned to ~. Greek letters are 
reserved for meta-language variables. 
that f(x) holds, g(x) alsoholds. Secondly, we use 
a simple conditional rather than a bi-conditional 
in the rule. The reason for this is simply that 
an ambiguous sentence such as 1) is true in ei- 
ther of two conditions. The theory will predict 
"(loves <a x woman(x)> <every y man(y)>)" 
is true if 
(a a woman'(a) (every /9 man'(f/) loves'(c%fl)) 
and also that 
"(loves <a x woman(x)> <every y man(y)>)" 
is true if 
(every 0 man'(a) (a fl woman'(f~) loves'(a,/9)) 
We ensure 1) is not true in any other condi- 
tions by adopting a general exclusion clause that 
a sentence is not true except in virtue of the 
clauses of the given theory. 
3 Comparison and Illustration 
The primitive operation of our algorithm will 
be to apply a complex term to a formula con- 
taining it, e.g. to apply <q x r(x)> to p(<q x 
r(x)>). The result of application is a new four 
part quantifier expression whose first two parts 
are q and x, whose third part is the result of 
recursing on r(x) and whose fourth part is the 
result of recursing on p(x) (the formula itself 
with the complex term replaced by the variable 
it restricts). 
For example, by choosing <a x woman(x)> first 
in 1), the algorithm will construct a new expres- 
sion derived from "a", "x" and recursions on 
"woman(x)" and "loves(x <every y man(y)>)". 
The first recursion will result in woman(x). The 
second will build yet another term from "ev- 
ery", "y" and further recursion on "man(y)" and 
"loves(x,y)". The final result will be 
( a x woman(x) (every y man(y) loves(x,y))) 
Clearly, by choosing <every y man(y)> first, the 
alternative reading of the sentence would have 
been produced. Quantifiers chosen earlier re- 
ceive wider scope. We work our way through 
the formula outside-in. \[Woods 1968\] explained 
the advantages of a top-down treatment of quan- 
tified noun phrases. 
191 
The basic operation of H&S is similar. An ap- 
plication builds a four part term whose first two 
parts are q and x, whose third part is r(x) and 
whose fourth part is the formula with x replac- 
ing <q x r(x)>). The result is then recursed 
upon in order to deal with other complex terms 
in the formula. 
Now consider complex noun phrases such as "ev- 
ery representative of a company". These are 
success cases for H&S. The new algorithm deals 
with them without alteration. For example ~ 
3. arrived( <every x 
and(rep(x), 
of(x, <a y company(y)>)>) 
We allow "every" to take wide scope as follows. 
First, we construct a new term from "every" ,"x" 
and recursions on "arrived(x)" and "and(rep(x), 
> " of(x, <a y company(y) )) . The recursion on 
"arrived(x)" simply produces "arrived(x)". The 
recursion on 
"and(rep(x), of(x, <a y company(v)>))" 
will lead us to construct a new term from "a', 
"y" and the results of recursions on "company (y)" 
and "and(rep(x),of(x,y))". These last two re- 
cursions are again simple cases, 4 resulting in 
(a y company(y) 
and(rep(x), of(x,y))) 
for "and(rep(z), of(x, <a y company(y)>))". 
With this result, we can complete our analysis 
of 3 itself. 
(every x 
(a y company(y) 
and(rep(x), of(x,y))) 
arrived(x)) 
for the whole input. 
In comparison, H&S use a much more complex 
mechanism. They do this because otherwise deal- 
ing with <a y company(y)> first results in 
3I assume H&S's syntactic analysis 
4Actually, there is an issue concerning "and", forced 
on us by H&S's syntactic analysis. The issue is whether 
quantifiers can be extracted across conjunctions. For 
present purposes, I assume they can - indeed, that the 
recursive rule for "and" only applies when the environ- 
ments C and D in "and((,D)" contain no complex terms. 
(a y company(y) 
arrived(<every x and(rep(x), of(x,y))>) 
and recursion on this produces 
(every x and(rep(x), of(x,y)) 
(a y company(y)arrived(x))) 
which is not the required reading of the sen- 
tence. It also contains a free variable. H&S 
therefore forbid the algorithm to apply complex 
terms which are embedded within other complex 
terms. Also, the restrictions of complex terms 
are recursively scoped with a flag set so that 
this call of the procedure returns partial results 
(still containing complex terms), as well as full 
results. 
4 Negation 
There are two readings of the sentence 
4. Everyone isn't here 
depending on whether "not" or "every" takes 
wider scope. In ordinary logic we have 
"not(p)" is true 
iff it is not the case that "p" is true 
Suppose C is an environment containing an oc- 
currence of "not", then 
g satisfies C(..not..) 
if it is not the case that g satisfies C( .... ) 
Here the formula on the right-hand-side is just 
that on the left, with the occurrence of "not" 
removed. The ambiguity in 4) arises in exactly 
the same manner as quantifier scope ambigu- 
ities. Using one rule (negation) before another 
(quantification) leads to wider scope for the first 
application. 
In contrast, H&S analyse 4 syntactically as 
not(here(<every x person(x)>)) 
and mark "not" as being opaque in its only ar- 
gument. The rule for opaque arguments allows 
them to be scoped first thus giving H&S the nar- 
row scope "every" reading. 
192 
This use of the terrn "opaque" is somewhat non- 
standard since "not" is not usually considered to 
be opaque. 
5 Pronouns 
Introduchlg complex noun phrase led to increased 
complexity in the H&S algorithm. The intro- 
duction of structure such as 
5. Every man saw a plcture of himself 
where "him" is bound by "every man" leads to 
yet more. Take the representation of 5. as 
6. saw(<,,very x man(x)>,<a y picture(y,x)>) 
Applying <every x man(x)> first, via the H&S 
mechanism, gives 
(every x man(x) saw(x,<a y picture(y,z)>)) 
Application of <a y picture(y,x)> would now 
lead to "x" being free. H&S prevent this by stip- 
ulating that a complex term is applicable only 
if all free variables in the term are also free in 
the containing formula. \[Pereira 1989\] calls this 
'The Free; Variable Constraint' and complains of 
an appeal to logical syntax. 
Our own methodology avoids this. First, note 
that 6) is supposed l;o be a purely syntactic 
structure. The occurrence of "x" in "picture(y,x)" 
represents the pronoun "himself", and the fact 
that "x" also occurs in "<every x man(x)>" 
represents the grammatical relation holding be- 
f~ween "<every x man(x)>" and "himselP'. Coin- 
dexing is used here just to indicate certain gram- 
matical relations. ~ Tile following notation is 
clearer. 
saw( <every x man(x)>, 
<a y picture(y,himself-x)> ) 
Now, we alter our quantification rule so that if 
C is an environment containing <q x r(x)>, our 
new term is constructed from "q", "x", and re- 
cursions on "r(x)" and C where <q x r(z)> and 
all embedded coindexed reflexives are replaced 
by "x". 
~;uppose vce choose to apply 
~This is one area where H&S'e analysis is d\]fflcult to 
follow - wh~t is the role of variables in the input and 
intermediate forms ? 
<a y picture(y,himself-x)> 
first to 6). Then we construct our result from 
"a', "y" and recursions on both "saw(<every 
x man(x)>,y)" and "picture(y,himself-x)" ;the 
final recursion cannot proceed however, for we 
have no rule to interpret a reflexive in this posi- 
tion. There is no appeal to logical syntax, only 
English syntax. 
The same holds true of non-reflexives as in 
7. Every man saw a friend of his 
where "every man" and "his" are co-indexed. 6 
6 Summary and Conclusion 
A modification to the algorithm of \[Hobbs and 
Shieber 1987\] based on a hint from standard 
logical theory has led to a simpler algorithm, 
and one which makes no illegitimate appeal to 
tile syntax of logical form. The algorithm is 
sound and complete with respect to the input 
language since it retraces the semantic defini- 
tion of that language. The degree to which it 
matches our intuitions concerning English deter- 
mines how good a contribution to natural lan- 
guage processing it is. 
Acknowledgement~ 
Helpful comments on this work have been made 
by Robin Cooper, Graeme Ritchie and audiences 
at both the A.I. Natural Language Group and 
the Cognitive Science Formal Semantics Work- 
shop in Edinburgh. 
Tile research was supported by SERC research 
studentship no. 88304590 
6There are other uses of pronouns not treated in the 
version of the algorithm glven here. For example, there 
i~ a possible deictie use of "his" in 7). Nor do we aceotmt 
for "donkey" pronouns tmeh ~ts Every woman who saw a 
man disliked him. 
193 

References 

Hobbs J.R., and Shieber S.M., 1987, 'An 
Algorithm for Generating Quantifier Scop- 
lugs' Computational Linguistics 13,num- 
bers 1-2, January-June 1987. 

Keller W., 1986, 'Nested Cooper Storage ~ 
Natural Language Parsing and Linguistic 
Theory edited by U.Reyle and C.Rohrer 
432-447, Studies in Linguistics and Philos- 
ophy volume 35, Dordrecht Reidel, Dor- 
drecht. 

Pereira F.C.N., 1989 'A Calculus for Se- 
mantic Composition and Scoping' 27th An- 
nual Meeting of A CL 26-29 June 1989 Van- 
couver, British Columbia, 152-160. 

Tennant N.W., 1978, Natural Logic Edin- 
burgh University Press 

Woods W.A., 1968, Procedural Semantics 
for a Question Answering Machine AFIPS 
Natl. Comput. Conf. Ezpo., Conference 
Proceedings 33, 457-471. 
