- So that's how \[[x]] should operate on a single `dpm`. How should it operate on a set of them? Well, we just have to take each member of the set and return a `unit_set` of the operation we perform on each of them. The `bind_set` operation takes care of joining all those `unit_set`s together. So, where `u` is the set of `dpm`s we start with, we have:
-
- let handle_each = fun v ->
- (* as above *)
- let getx = fun (r, h) ->
- let obj = List.nth h (r 'x')
- in (obj, r, h)
- in let result = bind_dpm v (fun _ -> getx)
- (* we return a unit_set of each result *)
- in unit_set result
- in bind_set u handle_each
-
- This is a computation that takes a bunch of `_ dpm`s and returns `dpm`s that return their input discourse possibilities unaltered, together with the entity those discouse possibilities associate with variable 'x'. We can take \[[x]] to be the `handle_each` function defined above.
-
-
-* They say the denotation of a variable is the entity which the store `h` assigns to the index that the assignment function `r` assigns to the variable. In other words, if the variable is `'x'`, its denotation wrt `(r, h, w)` is `h[r['x']]`. In our OCaml implementation, that will be `List.nth h (r 'x')`.
-
-
-
-* Now how shall we handle \[[∃x]]. As we said, GS&V really tell us how to interpret \[[∃xPx]], but what they say about this breaks naturally into two pieces, such that we can represent the update of `s` with \[[∃xPx]] as:
-
- <pre><code>s >>= \[[∃x]] >>= \[[Px]]
- </code></pre>
-
- What does \[[∃x]] need to be here? Here's what they say, on the top of p. 13:
-
- > Suppose an information state `s` is updated with the sentence ∃xPx. Possibilities in `s` in which no entity has the property P will be eliminated.
-
- We can defer that to a later step, where we do `... >>= \[[Px]]`.
-
- > The referent system of the remaining possibilities will be extended with a new peg, which is associated with `x`. And for each old possibility `i` in `s`, there will be just as many extensions `i[x/d]` in the new state `s'` and there are entities `d` which in the possible world of `i` have the property P.
-
- Deferring the "property P" part, this says:
-
- <pre><code>s updated with \[[∃x]] ≡
- s >>= (fun (r, h) -> List.map (fun d -> newpeg_and_bind 'x' d) domain)
- </code></pre>
-
- That is, for each pair `(r, h)` in `s`, we collect the result of extending `(r, h)` by allocating a new peg for entity `d`, for each `d` in our whole domain of entities (here designated `domain`), and binding the variable `x` to the index of that peg.
-
- A later step can then filter out all the possibilities in which the entity `d` we did that with doesn't have property P.
-
- So if we just call the function `(fun (r, h) -> ...)` above \[[∃x]], then `s` updated with \[[∃x]] updated with \[[Px]] is just:
-
- <pre><code>s >>= \[[∃x]] >>= \[[Px]]
- </code></pre>
-
- or, being explicit about which "bind" operation we're representing here with `>>=`, that is: