From 56875febe11ea5c63e753b64c546a7a45f28e343 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Fri, 19 Nov 2010 21:23:38 -0500 Subject: [PATCH] assignment7 tweaks Signed-off-by: Jim Pryor --- hints/assignment_7_hint_3.mdwn | 4 +- hints/assignment_7_hint_4.mdwn | 2 +- hints/assignment_7_hint_5.mdwn | 88 +++++++++++++++++++++++++++--------------- 3 files changed, 60 insertions(+), 34 deletions(-) diff --git a/hints/assignment_7_hint_3.mdwn b/hints/assignment_7_hint_3.mdwn index ad6d7ea8..bfac14e3 100644 --- a/hints/assignment_7_hint_3.mdwn +++ b/hints/assignment_7_hint_3.mdwn @@ -33,8 +33,8 @@ It will be useful to have a shorthand way of referring to this operation: let new_peg_and_assign (var_to_bind : char) (d : entity) = - (* we want to return not a function that we can bind to a bool dpm *) - fun (truth_value : bool) : bool dpm -> + (* 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 diff --git a/hints/assignment_7_hint_4.mdwn b/hints/assignment_7_hint_4.mdwn index 5cf19d6d..253ee96f 100644 --- a/hints/assignment_7_hint_4.mdwn +++ b/hints/assignment_7_hint_4.mdwn @@ -1,5 +1,5 @@ -* At the top of p. 13 (this is in between defs 2.8 and 2.9), GS&V give two examples, one for \[[∃xPx]] and the other for \[[Qx]]. In fact it will be most natural to break \[[∃xPx]] into two pieces, \[[∃x]] and \[[Px]]. But first we need to get clear on expressions like \[[Px]]. +* At the top of p. 13 (this is in between defs 2.8 and 2.9), GS&V give two examples, one for \[[∃xPx]] and the other for \[[Qx]]. In fact it will be most natural to break \[[∃xPx]] into two pieces, \[[∃x]] and \[[Px]]. But first we need to get clear on expressions like \[[Qx]]. * GS&V say that the effect of updating an information state `s` with the meaning of "Qx" should be to eliminate possibilities in which the entity associated with the peg associated with the variable `x` does not have the property Q. In other words, if we let `q` be the function from entities to `bool`s that gives the extension of "Q", then `s` updated with \[[Qx]] should be `s` filtered by the function `fun (r, h) -> let obj = List.nth h (r 'x') in q obj`. When `... q obj` evaluates to `true`, that `(r, h)` pair is retained, else it is discarded. diff --git a/hints/assignment_7_hint_5.mdwn b/hints/assignment_7_hint_5.mdwn index 1b2ee6a9..af3c9476 100644 --- a/hints/assignment_7_hint_5.mdwn +++ b/hints/assignment_7_hint_5.mdwn @@ -8,9 +8,9 @@ > 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]]`. + 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'` and there are entities `d` which in the possible world of `i` have the property P. + > 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: @@ -23,8 +23,8 @@ 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 not a function that we can bind to a bool dpm *) - fun (truth_value : bool) : bool dpm -> + (* 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 @@ -76,7 +76,7 @@ `lift predicate` converts a function of type `entity -> bool` into one of type `entity reader -> bool reader`. The meaning of \[[Qx]] would then be:
\[[Q]] ≡ lift q
-	\[[x]] & equiv; getx
+	\[[x]] ≡ getx
 	\[[Qx]] ≡ \[[Q]] \[[x]] ≡
 		fun r ->
 			let obj = getx r
@@ -85,16 +85,18 @@
 
 	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) entity_reader (v : 'a 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 v r'
+		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) : bool reader ->
+		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:
@@ -109,45 +111,69 @@
 
  	If we wanted to compose \[[∃]] with \[[lambda x]], we'd get:
 
-		let shift var_to_bind entity_reader v =
-			fun r ->
+		let shift var_to_bind clause =
+			fun entity_reader r ->
 				let new_value = entity_reader r
 				in let r' = fun var -> if var = var_to_bind then new_value else r var
-				in v r'
+				in clause r'
 		in let lifted_exists =
 			fun lifted_predicate ->
 				fun r -> exists (fun obj -> lifted_predicate (unit_reader obj) r)
-		in fun bool_reader -> lifted_exists (shift 'x' getx bool_reader)
+		in fun bool_reader -> lifted_exists (shift 'x' bool_reader)
 
-	which we can simplify to:
+	which we can simplify as:
 
-		let shifted v =
-			fun r ->
-				let new_value = r 'x'
+		let shifted clause =
+			fun entity_reader r ->
+				let new_value = entity_reader r
 				in let r' = fun var -> if var = 'x' then new_value else r var
-				in v r'
+				in clause r'
 		in let lifted_exists =
 			fun lifted_predicate ->
 				fun r -> exists (fun obj -> lifted_predicate (unit_reader obj) r)
 		in fun bool_reader -> lifted_exists (shifted bool_reader)
 
-	and simplifying further:
+		fun bool_reader ->
+			let shifted' =
+				fun entity_reader r ->
+					let new_value = entity_reader r
+					in let r' = fun var -> if var = 'x' then new_value else r var
+					in bool_reader r'
+			in fun r -> exists (fun obj -> shifted' (unit_reader obj) r)
 
 		fun bool_reader ->
-			let shifted v =
-				fun r ->
-					let new_value = r 'x'
+			let shifted'' r obj =
+					let new_value = (unit_reader obj) r
 					in let r' = fun var -> if var = 'x' then new_value else r var
-					in v r'
-			let lifted_predicate = shifted bool_reader
-			in fun r -> exists (fun obj -> lifted_predicate (unit_reader obj) r)
+					in bool_reader r'
+			in fun r -> exists (fun obj -> shifted'' r obj)
 
 		fun bool_reader ->
-			let lifted_predicate = fun r ->
-					let new_value = r 'x'
+			let shifted'' r obj =
+					let new_value = obj
 					in let r' = fun var -> if var = 'x' then new_value else r var
 					in bool_reader r'
-			in fun r -> exists (fun obj -> lifted_predicate (unit_reader obj) r)
+			in fun r -> exists (shifted'' r)
+
+		fun bool_reader ->
+			let shifted'' r new_value =
+					let r' = fun var -> if var = 'x' then new_value else r var
+					in bool_reader r'
+			in fun r -> exists (shifted'' r)
+
+	This gives us a value for \[[∃x]], which we use like this:
+
+	
\[[∃x]]reader ( \[[Qx]] )
+	
+ + Contrast the way we use \[[∃x]] in GS&V's system. Here we don't have a function that takes \[[Qx]] as an argument. Instead we have a operation that gets bound in a discourse chain: + +
u >>= \[[∃x]] >>= \[[Qx]]
+	
+ + The crucial difference in GS&V's system is that the distinctive effect of the \[[∃x]]---to allocate new pegs in the store and associate variable `x` with the objects stored there---doesn't last only while interpreting clauses supplied as arguments to \[[∃x]]. Instead, it persists through the discourse, possibly affecting the interpretation of claims outside the logical scope of the quantifier. This is how we're able to interpret claims like: + + > If ∃y (farmer y and ∃x y owns x) then (y beats x). * Can you figure out how to handle \[[not φ]] on your own? If not, here are some [more hints](/hints/assignment_7_hint_6). But try to get as far as you can on your own. -- 2.11.0