Scope ambiguities, monads and strengths

In this paper, we will discuss three semantically distinct scope assignment strategies: traditional movement strategy, polyadic approach, and continuation-based approach. As a generalized quantifier on a set X is an element of C(X), the value of continuation monad C on X, in all three approaches QPs are interpreted as C-computations. The main goal of this paper is to relate the three strategies to the computational machinery connected to the monad C (strength and derived operations). As will be shown, both the polyadic approach and the continuation-based approach make heavy use of monad constructs. In the traditional movement strategy, monad constructs are not used but we still need them to explain how the three strategies are related and what can be expected of them wrt handling scopal ambiguities in simple sentences.


Scope ambiguities
Multi-quantifier sentences have been known to be ambiguous with different readings corresponding to how various quantifer phrases (QPs) are semantically related in the sentence. For example, (1) Every girl likes a boy admits of the subject wide scope reading (S > O) where each girl likes a potentially different boy, and the object wide scope reading (O > S) where there is one boy whom all the girls like. As the number of QPs in a sentence increases, the number of distinct readings also increases. Thus a simple sentence with three QPs admits of six possible readings, and in general a simple sentence with n QPs will be (at least) n! ways ambiguous (we only consider readings where QPs are linearly ordered -what we will call asymmetric readings).

Monads and strenghts
For unexplained notions related to category theory, we refer the reader to standard textbooks on category theory. We shall be exclusively working in the cartesian closed category of sets Set. The category Set of sets has sets as objects. A morphism in Set from an object (set) X to an object (set) Y is a function f : X → Y from X to Y .

Monads
A monad on Set is a triple (T, η, µ) where T : Set −→ Set is an endofunctor (the underlying functor of the monad), η : 1 Set −→ T and µ : T 2 −→ T are natural transformations (first from identity functor on Set to T , second from the composition of T with itself to T ) making the following diagrams commute. η and µ are often referred to as unit and multiplication of the monad T , respectively. These diagrams express the essence of the algebraic calculations. We shall explain their meaning while describing the list monad below.
Monads can serve many different purposes. Here, we think of a monad as a device to extend the notion of computation. We think of a function f : X −→ Y as a computation that, when given an element of x, provides (computes) an element f (x) of Y . Then the function f : X −→ T (Y ) can be thought of as a computation that, when given an element x in X, provides a computation in T (Y ) that might, in principle, evaluate to an element of Y . We shall illustrate the concept on some examples below, before we focus on the continuation monad -the main notion of computation considered in this paper.
Examples of monads.
1. Identity monad is the simplest possible monad but not very interesting.
In this case the functor T and the natural transformations η and µ are identities. For this monad, the notion of a T -computation in X is just an element of X, as the function f : So T adds to X an additional element ⊥, called bottom or nothing. The component at X of natural transformation η is a function η X : X −→ X + {⊥} such that η X (x) = x, i.e. it sends x to the same x but in the set X + {⊥}. The component at X of natural transformation µ is a function µ X : X +{⊥, ⊥ ′ } −→ X +{⊥} such that, for x ∈ X +{⊥, ⊥ ′ }, i.e. it sends x in X to the same x, and two bottoms ⊥ and ⊥ ′ in T 2 (X) to the only bottom ⊥ in T (X).
For this monad, the notion of a T -computation in X consists of elements of X and an additional computation ⊥ that says that we do not get a value in X. The function f : X −→ T (Y ) is just a partial function f : X֒→Y . So this monad allows to treat partial computations as total.
3. Exception monad is still less trivial than maybe monad. We are given a fixed set of exceptions E and, for a set X, the monad functor is T (X) = X + E, i.e. the disjoint union of X and E. If E is empty, it is the identity monad; if E is a singleton, then it is a maybe monad; otherwise is it like maybe monad but with many options for nothingness. 4. List monad or monoid monad is still more interesting than the previous monad and we shall work it out in detail. It is not needed for the applications in the paper but it provides some intuitions before we move to the continuation monad. To any set X the list monad functor associates the set T (X) of (finite) words over X (treated as an alphabet). This includes the empty word ε. To a function f : X −→ Y the functor T associates the function T (f ) : it sends (the letter) x to the one letter word x in T (X).
The component at X of natural transformation µ is a function µ X : T 2 (X) −→ T (X). Note that T 2 (X) = T (T (X)) is the set of words whose letters are words over the alphabet X. Thus it can be thought of as a list of lists. µ X applied to such a list of lists flattens it to the single list. A three letter word t = (x 1 , x 2 ), (x 3 , x 4 , x 5 ), ε is a typical element of T 2 (X). The result of flattening T is the list . We can think of such a word w as a term/word/computation u = y 1 , y 2 , y 3 in which we intend to substitute the term v 1 = x 1 , x 2 for variable y 1 , the term v 2 = x 3 , x 4 , x 5 for variable y 2 , and the term v 3 = ε for variable y 3 , i.e. u[y 1 \v 1 , y 2 \v 2 , y 3 \v 3 ]. Now the multiplication µ can be thought of as an actual substitution. With this interpretation one can understand the intuitions behind the monad diagrams. In the left triangle, an element of T (X), say and µ X flattens it back to x 1 , x 2 , x 3 , as required for the triangle to commute. In other words, the substitution y[y\v] results in v. In the right triangle, the map T (η x ) sends, say x 1 , x 2 , x 3 , to the letter word (x 1 ), (x 2 ), (x 2 ) with each letter being a single letter word.
Thus again flattening such a list gives x 1 , x 2 , x 3 back, as required.
In other words the substitution y 1 , y 2 , y 3 [y 1 \x 1 , y 1 \x 2 , y 3 \x 3 ] results in x 1 , x 2 , x 3 . Thus the above triangles ensure that if we substitute with either term being a variable, then we get the expected result. The commutation of the square diagram, in this case, expresses the fact if we have a list of lists of lists and we flatten it in two different ways, once starting with the upper two levels of lists and the other time starting with the lower two levels of lists, and then we flatten the results again to get the ordinary lists over X in T (X), these lists coincide. On a more conceptual level, this square expresses the fact that the evaluation commutes with substitution. In this sense these diagrams capture the essence of all algebraic calculations.
For this monad, the notion of a T -computation in X consists of words over X to be evaluated/computed in a monoid when elements of X will be (interpreted) in a monoid. The function f : X −→ T (Y ) is just a function f : X −→ T (Y ) sending elements of X to words over Y . So this monad allows for a list of values, for a given input.
5. See next subsection for unexplained notation.
(Covariant) power-set monad sends set X to power-set P(X) and a function f : The unit η X : X −→ P(X) embeds x in X to the characteristic func- The multiplication µ X : P 2 (X) → P(X) sums elements of elements of elements, i.e. for H ∈ P 2 (X) and x ∈ X, µ X (H)(x) : X → t is a function given by This monad also allows for a set of values, for a given input.

Notation
Before we explain the notion of computation coming with the continuation monad, we restate the monad in a more functional way. To do this, we need to introduce some notation. As Set is a cartesian closed category, it is customary to denote functions between sets using λ notation. One can think of it as if we were to work in the internal language of Set, i.e. λ theory where all functions have their names represented. For sets X and Y , we shall use X × Y to denote the binary product of X and Y and X ⇒ Y to denote the set of functions from X to Y . As it is customary, we associate ⇒ to the right, i.e. X ⇒ Y ⇒ Z means X ⇒ (Y ⇒ Z) and this set is naturally bijective with (X × Y ) ⇒ Z. If we have a function we denote its exponential adjunction, i.e. the function from X to the set of functions Y ⇒ Z such that, for an element x ∈ X, λy :Y .f (x) is a function from Y to Z such that, for an element y ∈ Y , (λy :Y .f )(x)(y) is by definition equal f (x, y). Note that in the expression (λy :Y .f )(x)(y) the first occurrence of y is an occurrence of a variable (as it is part of the name of a function), whereas the second occurrence of y in this expression denotes an element of the set Y . π i will denote the projection on i-component from the product. Any function σ : {1, . . . m} → {1, . . . , n} induces a generalized projection denoted π σ = π σ(1) , . . . , π σ(m) : X 1 × . . . × X n −→ X 1 × . . . × X m . We will use this notation mainly for σ's being bijections, i.e. when π σ is just permutation of the component for the product.
We have a distinguished set of truth values t = {true, false}. We shall use the usual (possibly infinitary) operations on this set. For a set X, we put P(X) = X ⇒ t, i.e. the (functional) powerset of X.

Continuation monad
Continuation monad, the most important for us, denoted C, has some similarities to the power-set monad but it also differs in a substantial way. At the level of objects, it is just twice iterated power-set construction, i.e. for set X, C(X) = P 2 (X), but at the level of morphisms, it is an inverse image of an inverse image, i.e., function f : X → Y induces an inverse image function between powersets Taking again an inverse image function, we have for Q ∈ C(X). The unit η X : X → C(X) is given by η X (x) = λh :P(X) .h(x).
In other words, µ X (F) : P(X) → t is a function such that for F : P 3 (X) → t and h : X → t. In λ-notation, we write µ X (F)(h) = F(λD :C(X) .D(h)). Now we can look at the notion of computation related the continuation monad. Consider the function By exponential adjunction (uncurrying) it corresponds to a function and again by exponential adjunction (currying) it corresponds to a function Thus a C-computation from X to Y is a function that sends functions from P(Y ) = Y ⇒ t to functions in P(X). So instead of having a direct answer for a given element x ∈ X what is the value f (x) in Y , we are given for every continuation function c : Y −→ t a value in the answer type t that could be thought of as c(f (x)) (if there were an element in Y that could be reasonably called f (x)). We can draw the picture illustrating the situation Instead of 'procedure' f ? computing y's from x's (that we don't have), we provide a continuation f (c) for any continuation (of the computation) c. If f ? would be indeed a genuine function f ? : X −→ Y , then f (c) would be the composition c • f ?.

Bi-strong monads
As the notion of strength is new in this context, we shall briefly recall its history. There are three manifestations of strength on a functor. Historically, the first one was the notion of enrichment of a functor (c.f. [8]). The tensorial strength (i.e., natural transformation of a kind X ⊗ T (Y ) −→ T (X ⊗ Y ) used in this paper) was introduced in [12] and further developed in [14]. The cotensorial strength (i.e., natural transformation of a kind T (X ⇒ Y ) → X ⇒ T (Y )) introduced in [13] also proved useful in some contexts. In symmetric monoidal closed categories these concepts are equivalent, (c.f. [13]).
As it was noticed in [18], a monad, in order to have a well behaved notion of computation, has to be strong. Fortunately, all monads on Set are strong. More precisely, all monads on set can be canonically equipped with two strengths, left and right, and moreover these strengths are compatible in a precise technical sense. This additional structure on the continuation monad will be essential when we shall analyze the meaning of multiple quantified sentences.
Let (T, η, µ) be a monad on Set. The left strength is a natural transformation with components for sets X and Y , making the diagrams The right strength is a natural transformation with components for sets X and Y , making the diagrams The monad (T, η, µ) on Set together with two natural transformations st l and st r of right and left strength is a bi-strong monad if, for any sets X, Y , Z, the square

commutes.
As we already mentioned, each monad (T, η, µ) on Set is bi-strong. We shall define the right and left strength. Fix sets X and Y . For x ∈ X and y ∈ Y , we have functions such that l y (x) = x, y , and r x (y) = x, y .
The left and right strength respectively. We drop indices X,Y when it does not lead to confusion. It is not difficult to verify that the above defines left (st l ) and right (st r ) strength on the monad T and since, for any x ∈ X and z ∈ Z, the square commutes, they are compatible and make the monad T bi-strong. Note that these strengths are related by the following diagram Examples of strength on monads in Set.
Right strength is similar.
Right strength is similar.
3. Continuation monad. We shall describe the strength morphisms by lambda terms. The left strength is and the right strength is

Combining computations in arbitrary monad T on Set
Using both strengths, we can define two pile up natural transformations, the left and right. For any sets X and Y , the left pile up pile ′ up l X,Y is defined from the diagram In the above diagram, the function pile ′ up l X,Y is defined as a composition of three operations: the first is taking the T -computation on X 'outside' to be a computation on X × T (Y ), the second is taking the T -computation on Y 'outside' to be a T -computation on X × Y . In this way, we have Tcomputations coming from X on T -computations coming from Y on X × Y . Now the last morphism µ X×Y flattens these two levels to one, i.e. the Tcomputation on T -computations to T -computations.
The right pile up pile ′ up r X,Y is defined from the diagram This operation takes out the T -computations in a reverse order and so they pile up in the other way.
If these pile up operations agree for all sets X and Y , the monad is called commutative. On our list of monads, identity, maybe and covariant powerset monads are commutative. The exception, list and continuation monads are not commutative. Most monads, including the continuation monad C, are not commutative. It should be noticed that even if the monad T is not commutative, both lift morphisms agree on pairs in which at least one component comes from the actual value (not an arbitrary T -computation). In other words, the functions morphisms. Both pile ′ up l and pile ′ up r are associative. All this is shown in the Appendix.
Examples of pile ′ up-operations.
1. Maybe monad. The left and right pile'up's coincide in this case, as in any commutative monad. We have is given by pile ′ up l ( x 1 , . . . , x n , y 1 , . . . , y m ) = = x 1 , y 1 , x 1 , y 2 , . . . , x 1 , y m , x 2 , y 1 , . . . , x n , y m−1 , x n , y m and the right pile'up pile ′ up r : 3. (Covariant) power-set monad. The left and right pile'up's coincide in this case. We have for U ∈ P(X) and V ∈ P(Y ).
4. Continuation monad. Both pile'up operations can be defined, for M ∈ C(X) and N ∈ C(Y ), by lambda terms as and The calculations for these operations are in the Appendix.
Thus in the case of the continuation monad 'piling up' computations one on top of the other is nothing but putting (interpretations of) quantifiers (= computations in the continuation monad) in order, either first before the second or the second before the first.

T -transforms on arbitrary monad T on Set
There are two (binary) T -transformations, right and and left. For a function pile ′ up l µ Z and the right T -transform is defined as the composition The most popular CPS-transforms are for the evaluation morphism ev : X × (X ⇒ Y ) → Y but there are also other morphisms having useful transforms.
Examples of T -transforms and in particular CPS-transforms.
1. The evaluation map ev : X × (X ⇒ Y ) → Y gives rise to application transforms In case T is the continuation monad C, they are the usual CPStransforms CPS l (ev), CPS r (ev) : for M ∈ C(X) and N ∈ C(X ⇒ Y ). Right version is similar.
2. Various epsilon maps are typically defined as maps from a product. Thus they give rise to various T -transforms. We list some of them below mainly to introduce notation that will be used later. The definitions are given by lambda terms.

Scope assignment strategies
Using the notions connected to the continuation monad introduced above, we shall now precisely state and compare three strategies (A, B, C) for determining the meaning of multi-quantifier sentences.

General remarks
In each strategy, the starting point is the Surface Structure Tree of a sentence. This tree is rewritten so as to obtain Formal Structure Trees that correspond to all and only the available meanings of the sentence. Finally, we relabel those trees to obtain Computation Trees 1 that provide the semantics for the sentence in each of its reading. Rewriting. Scope assignment strategies can be divided into two families: movement analyses (rewriting rules include QR, Predicate Collapsing and possibly Rotation) and in situ analyses (no rewriting rules). Below we define three rewrite rules on trees: QR Rule, Predicate Collapsing and Rotation.
• QR (Quantier Raising) Rule applies when we have a chosen QP in a leaf of a tree; adjoins QP to S; indexes S with the variable bound by the raised QP. collapses the whole subtree with the root S to a single leaf labeled with the variables x 1 , x 2 , x 3 from the leaves under S-node. S x 1 β applies to a tree with two distinguished nodes labeled with S'es superscriped with some variables: the mother labeled S x and its right daughter labeled S y ; it rotates left the subtree with root labeled S x ; the root of this subtree is labeled S x y and the (new) leftt daughter is labeled P olyadic.
Relabelling. In each scope assignment strategy, the leaves in the Computation Tree have the same labels: QPs are interpreted as C-computations, and predicates are interpreted as usual or lifted. The main difference among the three approaches consists in the shape of the Formal Structure Trees and the operations (eps'es, mos'es, pile ′ up'es, CPS'es) used as labels of the inner nodes of the Computation Trees.

Strategy A
In the traditional movement strategy (as variously implemented in [16], [19]) • Surface Structure Tree gets rewritten (disambiguated) as Formal Structure Trees (Logical Forms) via -QR Rule; -Predicate Collapsing.
• Formal Structure Trees (LFs) are relabelled as Computation Trees as follows -S x (root of a subtree representing a formula) is interpreted as a suitably typed mos-operation (the only operation allowed); -S (leaf of a tree) is interpreted as a predicate; -QP (leaf of a tree) is interpreted as a generalized quantifier Q quantifying over a set X (i.e. as a C-computation on X).
We will illustrate each strategy on the examples involving one, two and three QPs.
Sentence with one QP, e.g. Every kid (most kids) entered. In this case, there is one such map -thus Strategy A yields one reading for a sentence with one QP.
Sentence with two QPs, e.g. Every girl likes a boy.
The Computation Tree in (A2) gives rise to the following general map, with σ ∈ S 2 (where S 2 is the set of permutations of the set {1, 2}) strat 2,σ A : whereπ σ(i) is the projection on the 1st factor if σ(i) = 1 and on the 3rd factor if σ(i) = 2, i.e. as it should be. This convention will be used in all similar diagrams without any further explanations. There are two such maps corresponding to the two permutations σ of {1, 2}. These maps are different in general. Thus Strategy A yields two (both) asymmetric readings for a sentence with two QPs.
Sentence with three QPs, e.g. Some teacher gave every student most books.
and the corresponding Computation Tree The Computation Tree in (A3) gives rise to the following general map, with σ ∈ S 3 (where S 3 is the set of permutations of the set {1, 2, 3}) strat 3,σ A : There are six such maps corresponding to six permutations σ of {1, 2, 3}. These maps are different in general. Thus Strategy A yields 6 asymmetric readings for a sentence with three QPs.
• Formal Structure Trees (PLFs) are relabelled as Computation Trees as follows -P olyadic (root of a subtree representing a polyadic quantifier) is interpreted as a suitably typed pile ′ up-operation (we can choose globally whether we use only pile ′ up l or pile ′ up r and then consequently stick to it).
-S x , S, QP are interpreted as above.
Sentence with one QP, e.g. Every kid (most kids) entered.
S -x 1 -x 2and the corresponding Computation Tree The Computation Tree in (B2) gives rise to the following general map, with σ ∈ S 2 strat 2,σ B : There are two such maps corresponding to the two permutations σ of {1, 2} combined with pile ′ up l -operation (in that case, alternatively, we can use pile ′ up l and pile ′ up r ). These maps are different in general. Thus Strategy B yields two (both) asymmetric readings for a sentence with two QPs.
Sentence with three QPs, e.g. Some teacher gave every student most books.
(B3) Surface Structure Tree and the corresponding Computation Tree The Computation Tree in (B3) gives rise to the following general map, with σ ∈ S 3 strat 3,σ B : There are six such maps corresponding to six permutations σ of {1, 2, 3} combined with pile ′ up l -operation (in that case we can choose globally whether we use only pile ′ up l or pile ′ up r and then consequently stick to it). These maps are different in general. Thus Strategy B yields 6 asymmetric readings for a sentence with three QPs.

Strategy C
In the continuation-based strategy approach (as proposed in [1]) C(X) × P(X) We use CPS ? when it does not matter whether we apply CPS l or CPS r . This is the case when one of the arguments is a lifted element (like interpretations of predicates in this strategy). Strategy C yields one reading for a sentence with one QPs.
Sentence with two QPs, e.g. Every girl likes a boy.
(C2) Surface Structure Tree and the corresponding Computation Tree The Computation Tree in (C2) gives rise to the following general map strat 2,ε C : with ε ∈ {l, r}. Depending on whether we use CPS l or CPS r , we get either one or the other of the two asymmetric readings for a sentence with two QPs. Strategy C yields two readings for a sentence with two QPs corresponding to the two CPS'es.
Sentence with three QPs, e.g. Some teacher gave every student most books.
(C3) Surface Structure Tree and the corresponding Computation Tree The Computation Tree in (C3) gives rise to the following general map Strategy C provides four asymmetric readings for the sentence such that QP in subject position can be placed either first or last only (corresponding to the four possible combinations of the two CPS'es). Thus it yields four out of six readings accounted for by strategies A and B.
The tables below summarize the main features of the three approaches.
The semantics for sentences with intransitive and transitive verbs, as defined by the strategies A, B, and C, are equivalent. The semantics for sentences with ditransitive verbs, as defined by the strategies A, B, are equivalent. They provide six asymmetric readings of the sentence. The semantics for sentences with ditransitive verbs, as defined by the strategy C, provides four asymmetric readings of the sentence such that QP in subject position can be placed either first or last only. Thus they correspond to four out of six readings accounted for by strategies A and B. The proofs are given in the Appendix.

The continuation monad
In this subsection, we gather all the basic facts (sometimes repeated from the text) of the continuation monad C on Set. We have an adjunction where both P and P op are the contravariant powerset functors 2 with the domains and codomains as displayed. In particular, for f : X → Y , the function P(f ) = f −1 : P(Y ) → P(X) is given by Function η X : X → C(X), the component at set X of the unit of this adjunction η : 1 Set → PP op = C, is given by Function ε X : X → C(X), the component at set X of the counit of this adjunction ε : 1 Set → P op P, is given by (essentially the same formula) The monad induced by this adjunction is the continuation monad. Its multiplication is given by the counit of the above adjunction transported back to Set, i.e. µ = P op (ε P ). For X in Set, the function for R ∈ C 2 (X).
The left strength for the monad C is for M ∈ C(X) and y ∈ Y , given by st l (M, y) = λc :P(X×Y ) .M (λx :X .c(x, y)) : P(X × Y ) → t and the right strength, for x ∈ X and n ∈ C(Y ), is given by The left pile'up operation is the following composition and, for d ∈ C(X × C(Y )), U ∈ PC(X × Y ), we have Now, using the above formulas, we can calculate pile ′ up l as the composition on Q ∈ C(X), Q ′ ∈ C(Y ), and c ∈ P(X × Y ) as follows Similarly, we can show that pile ′ up r (Q, Q ′ )(c) = Q ′ (λy :Y Q(λx :X c(x, y))).
One can easily verify that pile'ups are related by Proof. We have to show that the functions

Some properties of pile'up operations
To show the remaining equation, we notice that we can continue the penultimate formula above as follows Proof. The corollary states that, for any sets X, Y , Z and a function f : X × Y → Z, both morphisms This immediately follows from the above lemma and the definition of CPS'es. ♦ Using binary pile'up operations, we can define eight ternary pile'up operation out of the following diagram However, both pile ′ up l and pile ′ up r operations are associative (Proposition 4.3 below) and hence only six of them are different, in general. Proof. In case of a sentence with an intransitive verb the semantics are defined by morphisms strat 1 A , strat 1 B , and strat 1 C . We need to show that they are equal. We have

Arity one: intransitive verbs
strat 1 C is the composition of the following morphisms C(X) × P(X) C(X) × CP(X) 1 × η P(X) C(t) CPS l (eps r X ) t ev id t Thus we need to show that this composition is equal to mos l X . Consider the following diagram The left triangle commutes, as a consequence of Lemma 4.1. To see that the mid triangle commutes, we take M ∈ C(X) and h ∈ P(X), and calculate ev eps r X • st r (Q, h) = = ev eps r X (λD :P(X×P(X)) M (λx :X D(x, h))) = = M (λx :X eps r X (x, h)) = = M (λx :X h(x)) = = N (h) = mos l (N, h).
Finally, to see that the right triangle commutes, we take N ∈ C(X × P(X)) and calculate ev id t • C(eps r X )(N ) = = ev id t (λc :P(t) N (c • eps r X )) = = N (eps r X ) = ev eps r X (N ). Thus the whole diagram commutes, and hence strat 1 C = mos l X , as required. ♦ The above proof shows also the following technical lemma.
Lemma 4.5 For any set X, the diagram C(X × P(X)) C(t) C(eps r X )

Arity two: transitive verbs
Proposition 4.6 The semantics for sentences with transitive verbs, as defined by the strategies A, B, and C, are equivalent. They provide two asymmetric readings of the sentence.

B
In the above calculations we used: the definition of CPS'es, naturality of pile ′ up ε , relations between eps morphisms, associativity of pile ′ up ε (Proposition 4.3), properties of product morphisms, pile'up lemma, and finally Lemma 4.5.
Here and below CPS ? , pile ′ up ? stands for either CPS l , pile ′ up l or CPS r , pile ′ up r whatever is more convenient at the moment as it does not influence the end result. ♦ 4.5 Arity three: ditransitive verbs Proposition 4.7 The semantics for sentences with ditransitive verbs, as defined by the strategies A, B, are equivalent. They provide six asymmetric readings of the sentence.