From: Jim Pryor Date: Wed, 17 Nov 2010 18:48:39 +0000 (-0500) Subject: post assignment7 X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=02ef3d4dfa3eed39f90326c37db8b23a6c3b07e7;hp=4572bc12ce49240e3e446af2a0940f76ef0b9986 post assignment7 Signed-off-by: Jim Pryor --- diff --git a/assignment5.mdwn b/assignment5.mdwn index 39899289..f402ec61 100644 --- a/assignment5.mdwn +++ b/assignment5.mdwn @@ -121,7 +121,7 @@ and that "bool" is any boolean. Then we can try the following: or of `match`. That is, you must keep the `let` statements, though you're allowed to adjust what `b`, `y`, and `n` get assigned to. - [[Hint assignment 5 problem 3]] + [[hints/assignment 5 hint 1]] Booleans, Church numerals, and v3 lists in OCaml ------------------------------------------------ diff --git a/assignment7.mdwn b/assignment7.mdwn new file mode 100644 index 00000000..f6372bbc --- /dev/null +++ b/assignment7.mdwn @@ -0,0 +1,19 @@ + +1. Make sure that your operation-counting monad from [[assignment6]] is working. Modify it so that instead of counting operations, it keeps track of the last remainder of any integer division. You can help yourself to any of the functions: + + let div x y = x / y;; + let mod x y = x mod y;; + let divmod x y = (div x y, mod x y);; + +you like. Write a monadic operation that enables you to retrieve the last-saved remainder, at any arbitrary later point in the computation. + +2. For the next assignment, read the paper [coreference-and-modality](/coreference-and-modality.pdf). Your task will be to re-express the semantics they offer in the terms we're now working with. You'll probably want to review the lecture notes from this week's meeting, which we haven't yet been able to post. We will do that soon. In the meantime, you can get started reading the paper. + +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'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. Conceptually, though, it's sometimes useful to switch back and forth between the "implicitly represented" model and the "explicitly represented" model. + +* Here are some [hints](hints/Assignment 7 Hint 1). + diff --git a/coreference-and-modality.pdf b/coreference-and-modality.pdf new file mode 100644 index 00000000..8dc69f53 Binary files /dev/null and b/coreference-and-modality.pdf differ diff --git a/hint_assignment_5_problem_3.mdwn b/hint_assignment_5_problem_3.mdwn deleted file mode 100644 index c3b92d52..00000000 --- a/hint_assignment_5_problem_3.mdwn +++ /dev/null @@ -1,3 +0,0 @@ -Use thunks! - -[[Hint assignment 5 problem 3 hint]] diff --git a/hints/assignment_5_hint_1.mdwn b/hints/assignment_5_hint_1.mdwn new file mode 100644 index 00000000..339f8fb8 --- /dev/null +++ b/hints/assignment_5_hint_1.mdwn @@ -0,0 +1,3 @@ +Use thunks! + +[[hints/assignment 5 hint 2]] diff --git a/hint_assignment_5_problem_3_hint.mdwn b/hints/assignment_5_hint_2.mdwn similarity index 100% rename from hint_assignment_5_problem_3_hint.mdwn rename to hints/assignment_5_hint_2.mdwn diff --git a/hints/assignment_7_hint_1.mdwn b/hints/assignment_7_hint_1.mdwn new file mode 100644 index 00000000..9c22165d --- /dev/null +++ b/hints/assignment_7_hint_1.mdwn @@ -0,0 +1,15 @@ + +* 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 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? + diff --git a/index.mdwn b/index.mdwn index a84ea489..ac9ce98a 100644 --- a/index.mdwn +++ b/index.mdwn @@ -55,6 +55,9 @@ preloaded is available at [[assignment 3 evaluator]]. (8 Nov) Lecture notes for [[Week8]]. +(15 Nov) Lecture notes are coming; [[Assignment7]] is here. + + [[Upcoming topics]] [[Advanced Topics]] diff --git a/week9.mdwn b/week9.mdwn new file mode 100644 index 00000000..2d08b801 --- /dev/null +++ b/week9.mdwn @@ -0,0 +1,17 @@ +[[!toc]] + +The seminar is now going to begin talking about more **imperatival** or **effect**-like elements in programming languages. The only effect-like element we've encountered so far is the possibility of divergence, in languages that permit fixed point combinators and so have the full power of recursion. What it means for something to be effect-like, and why this counts as an example of such, will emerge. + +Other effect-like elements in a language include: printing (recall the [[damn]] example at the start of term), continuations (also foreshadowed in the [[damn]] example) and exceptions, and **mutation**. We'll focus on this last notion this week. + +What is mutation? It's helpful to build up to this in a series of fragments... + + +Different grades of mutation involvement... + + +loops instead of recursion + +before, order never mattered except to avoid divergence. Also, we've give up "referential transparency". + +