+ <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 [week7](
+/reader_monad_for_variable_binding).)
+
+ type assignment = char -> entity;;
+ type 'a reader = assignment -> 'a;;
+
+ let unit_reader (value : 'a) : 'a reader = fun r -> value;;
+
+ let bind_reader (u : 'a reader) (f : 'a -> 'b reader) : 'b reader =
+ fun r ->
+ let a = u r
+ in let u' = f a
+ in u' r;;
+
+ Here the type of a sentential clause is:
+
+ type clause = bool reader;;
+
+ Here are meanings for singular terms and predicates:
+
+ let getx : entity reader = fun r -> r 'x';;
+
+ type lifted_unary = entity reader -> bool reader;;
+
+ let lift (predicate : entity -> bool) : lifted_unary =
+ fun entity_reader ->
+ fun r ->
+ let obj = entity_reader r
+ in unit_reader (predicate obj)
+
+ 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 : clause) : lifted_unary =
+ fun entity_reader ->
+ fun r ->
+ 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 : lifted_unary) ->
+ 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]] )