+ <pre><code>bind_set (bind_set u \[[∃x]]) \[[Px]]
+ </code></pre>
+
+* Let's compare this to what \[[∃xPx]] would look like on a non-dynamic semantics, for example, where we use a simple reader monad to implement variable binding. Reminding ourselves, we'd be working in a framework like this. (Here we implement environments or assignments as functions from variables to entities, instead of as lists of pairs of variables and entities. An assignment `r` here is what `fun c -> List.assoc c r` would have been in [week6](
+/reader_monad_for_variable_binding).)
+
+ type assignment = char -> entity;;
+ type 'a reader = assignment -> 'a;;
+
+ let unit_reader (x : 'a) = fun r -> x;;
+
+ let bind_reader (u : 'a reader) (f : 'a -> 'b reader) =
+ fun r ->
+ let a = u r
+ in let u' = f a
+ in u' r;;
+
+ let getx = fun r -> r 'x';;
+
+ let lift (predicate : entity -> bool) =
+ fun entity_reader ->
+ fun r ->
+ let obj = entity_reader r
+ in unit_reader (predicate obj)
+
+ `lift predicate` converts a function of type `entity -> bool` into one of type `entity reader -> bool reader`. The meaning of \[[Qx]] would then be:
+
+ <pre><code>\[[Q]] ≡ lift q
+ \[[x]] ≡ getx
+ \[[Qx]] ≡ \[[Q]] \[[x]] ≡
+ fun r ->
+ let obj = getx r
+ in unit_reader (q obj)
+ </code></pre>
+
+ Recall also how we defined \[[lambda x]], or as [we called it before](/reader_monad_for_variable_binding), \\[[who(x)]]:
+
+ let shift (var_to_bind : char) (clause : bool reader) =
+ (* we return a lifted predicate, that is a entity reader -> bool reader *)
+ fun entity_reader ->
+ fun (r : assignment) ->
+ let new_value = entity_reader r
+ (* remember here we're implementing assignments as functions rather than as lists of pairs *)
+ in let r' = fun var -> if var = var_to_bind then new_value else r var
+ in clause r'
+
+ Now, how would we implement quantifiers in this setting? I'll assume we have a function `exists` of type `(entity -> bool) -> bool`. That is, it accepts a predicate as argument and returns `true` if any element in the domain satisfies that predicate. We could implement the reader-monad version of that like this:
+
+ fun (lifted_predicate : entity reader -> bool reader) ->
+ fun r -> exists (fun (obj : entity) -> lifted_predicate (unit_reader obj) r)
+
+ That would be the meaning of \[[∃]], which we'd use like this:
+
+ <pre><code>\[[∃]] \[[Q]]