From fbf7eb4bd166b7bdf656f1c5f12528a39954dc51 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Thu, 18 Nov 2010 18:36:01 -0500 Subject: [PATCH] assignment7 tweaks Signed-off-by: Jim Pryor --- assignment7.mdwn | 2 +- hints/assignment_7_hint_1.mdwn | 2 +- hints/assignment_7_hint_2.mdwn | 7 +++++-- hints/assignment_7_hint_3.mdwn | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/assignment7.mdwn b/assignment7.mdwn index dd325bb2..0d5d45af 100644 --- a/assignment7.mdwn +++ b/assignment7.mdwn @@ -10,7 +10,7 @@ Some advice: - * You don't need to re-express the epistemic modality part of their semantics, just the treatment of indefinites. Though extra credit if you do the whole thing. + * You don't need to re-express the epistemic modality part of their semantics, just their treatment of extensional predicate logic. Though extra credit if you want to do the whole thing. * You'll want to use the implementation of "implicitly represented" mutable variables that we discussed at the end of this week's meeting, or the "state monad" Chris presented, which is a simple version of the former. diff --git a/hints/assignment_7_hint_1.mdwn b/hints/assignment_7_hint_1.mdwn index 6725def2..0d67cd91 100644 --- a/hints/assignment_7_hint_1.mdwn +++ b/hints/assignment_7_hint_1.mdwn @@ -3,7 +3,7 @@ * Where they represent pegs as natural numbers, that corresponds to our representing locations in a store by their indexes in the store. -* 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 "reference system," which they use the leter `r` for, that corresponds to what we've been calling "assignments", and have been using the letter `g` for. * Where they say `r[x/n]`, that's our `g{x:=n}`. diff --git a/hints/assignment_7_hint_2.mdwn b/hints/assignment_7_hint_2.mdwn index 16e66e19..0b1c59ff 100644 --- a/hints/assignment_7_hint_2.mdwn +++ b/hints/assignment_7_hint_2.mdwn @@ -5,11 +5,14 @@ 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: + We'll call these "discourse possibility monads," and type them as follows: type entity = Bob | Carol | Ted | Alice;; + let domain = [Bob; Carol; Ted; Alice];; + type var = char;; + type assignment = var -> int;; (* variables are bound to indexes into the store *) 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 diff --git a/hints/assignment_7_hint_3.mdwn b/hints/assignment_7_hint_3.mdwn index ed6bc36a..49511008 100644 --- a/hints/assignment_7_hint_3.mdwn +++ b/hints/assignment_7_hint_3.mdwn @@ -3,7 +3,7 @@ * They say the denotation of a predicate is whatever extension the world `w` associates with the predicate. Since we don't have worlds, this will just be an extension. -* They say the denotation of a variable is the object which the store `g` assigns to the index that the assignment function `r` assigns to the variable. In other words, if the variable is `'x'`, its denotation wrt `(r, g, w)` is `g[r['x']]`. +* They say the denotation of a variable is the object which the store `g` assigns to the index that the assignment function `r` assigns to the variable. In other words, if the variable is `'x'`, its denotation wrt `(r, g, w)` is `g[r['x']]`. In our OCaml implementation, that will be `List.nth g (r 'x')`. We're going to keep all of that, except dropping the worlds. And instead of talking about -- 2.11.0