* 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 our starting set `u` with \[[∃xPx]] as:
u >>=set \[[∃x]] >>=set \[[Px]]

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]]`. GS&V continue: > 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'` as there are entities `d` which in the possible world of `i` have the property P. Deferring the "property P" part, this corresponds to:
u updated with \[[∃x]] ≡
let extend_one = fun (one_dpm : bool dpm) ->
List.map (fun d -> bind_dpm one_dpm (new_peg_and_assign 'x' d)) domain
in bind_set u extend_one

where `new_peg_and_assign` is the operation we defined in [hint 3](/hints/assignment_7_hint_3): let new_peg_and_assign (var_to_bind : char) (d : entity) = (* we want to return a function that we can bind to a bool dpm *) fun (truth_value : bool) -> fun ((r, h) : assignment * store) -> (* first we calculate an unused index *) let new_index = List.length h (* next we store d at h[new_index], which is at the very end of h *) (* the following line achieves that in a simple but inefficient way *) in let h' = List.append h [d] (* next we assign 'x' to location new_index *) in let r' = fun var -> if var = var_to_bind then new_index else r var (* we pass through the same truth_value that we started with *) in (truth_value, r', h') What's going on in this representation of `u` updated with \[[∃x]]? For each `bool dpm` in `u`, we collect `dpm`s that are the result of passing through their `bool`, but extending their input `(r, h)` by allocating a new peg for entity `d`, for each `d` in our whole domain of entities, and binding the variable `x` to the index of that peg. A later step can then filter out all the `dpm`s where the entity `d` we did that with doesn't have property P. So if we just call the function `extend_one` defined above \[[∃x]], then `u` updated with \[[∃x]] updated with \[[Px]] is just:
u >>= \[[∃x]] >>= \[[Px]]

or, being explicit about which "bind" operation we're representing here with `>>=`, that is:
bind_set (bind_set u \[[∃x]]) \[[Px]]

\[[Q]] ≡ lift q
\[[x]] ≡ getx
\[[Qx]] ≡ \[[Q]] \[[x]] ≡
fun r ->
let obj = getx r
in unit_reader (q obj)