From 4e38540a3d46c09c41f6c4591ab9b39b401ce050 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Thu, 18 Nov 2010 13:08:08 -0500 Subject: [PATCH 1/1] assignment7 tweaks Signed-off-by: Jim Pryor --- hints/assignment_7_hint_1.mdwn | 6 +----- hints/assignment_7_hint_2.mdwn | 30 ++++++++++++++++++++++++++++++ hints/assignment_7_hint_3.mdwn | 2 ++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 hints/assignment_7_hint_3.mdwn diff --git a/hints/assignment_7_hint_1.mdwn b/hints/assignment_7_hint_1.mdwn index 1c91401b..f7d5d288 100644 --- a/hints/assignment_7_hint_1.mdwn +++ b/hints/assignment_7_hint_1.mdwn @@ -1,17 +1,13 @@ -* Where Groenendijk and Stockhof and Veltman (GSV) say "peg", that translates in our terminology into a new "reference cell" or "location" in a store. +* Where Groenendijk, Stockhof and Veltman (GS&V) say "peg", that translates in our terminology into a new "reference cell" or "location" in a store. * Where they represent pegs as natural numbers, that corresponds to our representing locations in a store by their indexes in the store. -* Where they work with sets of blahs, you should generally think in terms of functions from blahs to bools. - * Where they say "reference system," which they use the leter `r` for, that corresponds to what we've been calling "assignments", and use the letter `g` for. * Where they say `r[x/n]`, that's our `g{x:=n}`. * Their function `g`, which assigns objects from the domain to pegs, corresponds to our store function, which assigns entities to indexes. -* What does their &exists;x correspond to in the framework we've been talking about? - * [More hints](/hints/assignment_7_hint_2). diff --git a/hints/assignment_7_hint_2.mdwn b/hints/assignment_7_hint_2.mdwn index 8b137891..9a208c78 100644 --- a/hints/assignment_7_hint_2.mdwn +++ b/hints/assignment_7_hint_2.mdwn @@ -1 +1,31 @@ +* GS&V's semantics involves elements from several different monads we've been looking at. First, they're working with (epistemic) modalities, so there are worlds playing a role like they did in [[Reader Monads for Intensionality]]. But we're going to ignore the modal element for this exercise. There's also variable binding, which is another reader monad. Next, there is a notion of a store, which some operations add new reference cells to. We implement this with a state monad (and so too do they, in effect, though they don't conceive of what they're doing in those terms). So we'll be working with a combination of both a reader monad for the variable binding and a state monad to keep track of the new "pegs" or reference cells. + + There are systematic ways to layer different monads together. If you want to read about these, a keyword is "monad transformers." Ken Shan discusses them in [his paper](http://arxiv.org/abs/cs/0205026v1) that we recommended earlier. + + However, since we haven't studied these, we will just combine the reader monad and the state monad in an ad hoc way. The easiest way to do this is to think of the assignment function and the store of reference cells as a combined state, which gets threaded through the computations in the same way that simple states did in your earlier homeworks. + + We'll call these "discourse possibility monads," and let them have the following type: + + type entity = Bob | Carol | Ted | Alice;; + type store = entity list;; + type assignment = char -> int;; (* variables are bound to indexes into the store *) + type 'a discourse_possibility = + (* we ignore worlds *) + assignment * store -> 'a * assignment * store + + Although we're leaving worlds out of the picture, each of these monadic objects still represents a different discourse possibility: which entities might be being talked about, using which variables. + +* We notice though that GS&V don't just work with discourse possibilities (or more broadly, epistemic possibilities), they work with what they call "information states," which are *sets* of possibilities. OK, a set is just another monadic layer. For simplicity, we'll represent sets using lists: + + type 'a set = 'a list;; + let empty_set : 'a set = [];; + let unit_set (x: 'a) : 'a set = [x];; + let bind_set (u: 'a set) (f: 'a -> 'b set) = + List.concat (List.map f u);; + +* So GS&V's information states, which they notate using `s`, are set-monads, whose elements in turn are discourse possibilities, which they notate using `i`, which are state monads that keep track of which entities have been introduced as objects of discourse, and which variables are bound to them, in a given discourse possibility. + + +* [More hints](/hints/assignment_7_hint_3). + diff --git a/hints/assignment_7_hint_3.mdwn b/hints/assignment_7_hint_3.mdwn new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/hints/assignment_7_hint_3.mdwn @@ -0,0 +1,2 @@ + + -- 2.11.0