tweaks
[lambda.git] / intensionality_monad.mdwn
index 526404c..5598e42 100644 (file)
@@ -1,9 +1,9 @@
 Now we'll look at using monads to do intensional function application.
-This really is just another application of the reader monad, not a new monad.
+This really is just another application of the Reader monad, not a new monad.
 In Shan (2001) [Monads for natural
 language semantics](http://arxiv.org/abs/cs/0205026v1), Ken shows that
 making expressions sensitive to the world of evaluation is conceptually
-the same thing as making use of the reader monad.
+the same thing as making use of the Reader monad.
 This technique was beautifully re-invented
 by Ben-Avi and Winter (2007) in their paper [A modular
 approach to
@@ -24,11 +24,11 @@ First, the familiar linguistic problem:
           Ann believes [Bill left].
           Ann believes [Cam left].
 
-We want an analysis on which all four of these sentences can be true
-simultaneously.  If sentences denoted simple truth values or booleans,
-we have a problem: if the sentences *Bill left* and *Cam left* are
-both true, they denote the same object, and Ann's beliefs can't
-distinguish between them.
+We want an analysis on which the first three sentences can be true at
+the same time that the last sentence is false.  If sentences denoted
+simple truth values or booleans, we have a problem: if the sentences
+*Bill left* and *Cam left* are both true, they denote the same object,
+and Ann's beliefs can't distinguish between them.
 
 The traditional solution to the problem sketched above is to allow
 sentences to denote a function from worlds to truth values, what
@@ -55,18 +55,18 @@ generalized quantifiers.
 The main difference between the intensional types and the extensional
 types is that in the intensional types, the arguments are functions
 from worlds to extensions: intransitive verb phrases like "left" now
-take intensional concepts as arguments (type s->e) rather than plain
+take so-called "individual concepts" as arguments (type s->e) rather than plain
 individuals (type e), and attitude verbs like "think" now take
 propositions (type s->t) rather than truth values (type t).
 In addition, the result of each predicate is an intension.
 This expresses the fact that the set of people who left in one world
 may be different than the set of people who left in a different world.
-Normally, the dependence of the extension of a predicate to the world
+(Normally, the dependence of the extension of a predicate to the world
 of evaluation is hidden inside of an evaluation coordinate, or built
 into the the lexical meaning function, but we've made it explicit here
-in the way that the intensionality monad makes most natural.
+in the way that the intensionality monad makes most natural.)
 
-The intenstional types are more complicated than the intensional
+The intensional types are more complicated than the extensional
 types.  Wouldn't it be nice to make the complicated types available
 for those expressions like attitude verbs that need to worry about
 intensions, and keep the rest of the grammar as extensional as
@@ -77,32 +77,26 @@ division-by-zero problems as much as possible.
 
 So here's what we do:
 
-In OCaml, we'll use integers to model possible worlds:
+In OCaml, we'll use integers to model possible worlds. Characters (characters in the computational sense, i.e., letters like `'a'` and `'b'`, not Kaplanian characters) will model individuals, and OCaml booleans will serve for truth values:
 
        type s = int;;
        type e = char;;
        type t = bool;;
 
-Characters (characters in the computational sense, i.e., letters like
-`'a'` and `'b'`, not Kaplanian characters) will model individuals, and
-OCaml booleans will serve for truth values.
+       let ann = 'a';;
+       let bill = 'b';;
+       let cam = 'c';;
 
-<pre>
-let ann = 'a';;
-let bill = 'b';;
-let cam = 'c';;
-
-let left1 (x:e) = true;; 
-let saw1 (x:e) (y:e) = y < x;; 
+       let left1 (x:e) = true;; 
+       let saw1 (x:e) (y:e) = y < x;; 
 
-left1 ann;;
-saw1 bill ann;; (* true *)
-saw1 ann bill;; (* false *)
-</pre>
+       left1 ann;; (* true *)
+       saw1 bill ann;; (* true *)
+       saw1 ann bill;; (* false *)
 
 So here's our extensional system: everyone left, including Ann;
-and Ann saw Bill, but Bill didn't see Ann.  (Note that Ocaml word
-order is VOS, verb-object-subject.)
+and Ann saw Bill (`saw1 bill ann`), but Bill didn't see Ann.  (Note that the word
+order we're using is VOS, verb-object-subject.)
 
 Now we add intensions.  Because different people leave in different
 worlds, the meaning of *leave* must depend on the world in which it is
@@ -133,8 +127,8 @@ Now we are ready for the intensionality monad:
 
 <pre>
 type 'a intension = s -> 'a;;
-let unit x (w:s) = x;;
-let bind m f (w:s) = f (m w) w;;
+let unit x = fun (w:s) -> x;;
+let bind u f = fun (w:s) -> f (u w) w;;
 </pre>
 
 Then the individual concept `unit ann` is a rigid designator: a
@@ -142,8 +136,8 @@ constant function from worlds to individuals that returns `'a'` no
 matter which world is used as an argument.  This is a typical kind of
 thing for a monad unit to do.
 
-Then combining a prediction like *left* which is extensional in its
-subject argument with a monadic subject like `unit ann` is simply bind
+Then combining a predicate like *left* which is extensional in its
+subject argument with an intensional subject like `unit ann` is simply bind
 in action:
 
     bind (unit ann) left 1;; (* true: Ann left in world 1 *)
@@ -158,20 +152,20 @@ to the extensional predicate *left*.
 We can arrange for an extensional transitive verb to take intensional
 arguments:
 
-    let lift f u v = bind u (fun x -> bind v (fun y -> f x y));;
+    let lift2 f u v = bind u (fun x -> bind v (fun y -> f x y));;
 
 This is the exact same lift predicate we defined in order to allow
 addition in our division monad example.
 
 <pre>
-lift saw (unit bill) (unit ann) 1;;  (* true *)
-lift saw (unit bill) (unit ann) 2;;  (* false *)
+lift2 saw (unit bill) (unit ann) 1;;  (* true *)
+lift2 saw (unit bill) (unit ann) 2;;  (* false *)
 </pre>
 
 Ann did see bill in world 1, but Ann didn't see Bill in world 2.
 
 Finally, we can define our intensional verb *thinks*.  *Think* is
-intensional with respect to its sentential complement, but extensional
+intensional with respect to its sentential complement, though still extensional
 with respect to its subject.  (As Montague noticed, almost all verbs
 in English are extensional with respect to their subject; a possible
 exception is "appear".)
@@ -189,8 +183,8 @@ So in world 1, Ann thinks that Bill left (because in world 2, Bill did leave).
 
     bind (unit ann) (thinks (bind (unit cam) left)) 1;;
 
-But even in world 1, Ann doesn't believe that Cam left (even though he
-did: `bind (unit cam) left 1 == true`).  Ann's thoughts are hung up on
+But in world 1, Ann doesn't believe that Cam left (even though he
+did leave in world 1: `bind (unit cam) left 1 == true`).  Ann's thoughts are hung up on
 what is happening in world 2, where Cam doesn't leave.
 
 *Small project*: add intersective ("red") and non-intersective
@@ -198,3 +192,5 @@ what is happening in world 2, where Cam doesn't leave.
  will be extensional with respect to the nominal they combine with
  (using bind), and the non-intersective adjectives will take
  intensional arguments.
+
+