X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=reader_monad_for_variable_binding.mdwn;h=b9fd816d439ee693e26d2ae9173264d856085651;hp=2e24babb24737cf3a95031cf91a55a4c7533b56e;hb=9597d0f4796382fd4b18e85f2c5eb37a5f60e715;hpb=26ef3ad43ed5d4e912bed99daccb990c0840052c
diff --git a/reader_monad_for_variable_binding.mdwn b/reader_monad_for_variable_binding.mdwn
index 2e24babb..b9fd816d 100644
--- a/reader_monad_for_variable_binding.mdwn
+++ b/reader_monad_for_variable_binding.mdwn
@@ -1,3 +1,5 @@
+[[!toc]]
+
Substitution versus Environment-based Semantics
-----------------------------------------------
@@ -155,7 +157,10 @@ Here we'll use a different monad. It's called the **Reader monad**. We define it
(* here's our bind operation; how does it work? *)
let bind (u : 'a reader) (f: 'a -> 'b reader) : 'b reader =
- fun (e : env) -> f (u e) e
+ (* this can be written more compactly, but having it spelled out
+ like this will be useful down the road *)
+ fun (e : env) -> let a = u e in let u' = f a in u' e
+
(* we also define two special-purpose operations on our reader-monad values *)
@@ -218,7 +223,7 @@ In Heim and Kratzer's textbook Semantics in Generative Grammar, the
-Now the normal way in which the nodes of such trees are related to each other is that the semantic value of a parent node is the result of applying the functional value of one of the daughter nodes to the value of the other daughter node. (The types determine which side is the function and which side is the argument.) One exception to this general rule is when multiple adjectives are joined together, as happens in \[[interprets complex English phrases]]. We'll ignore that though.
+Now the normal way in which the nodes of such trees are related to each other is that the semantic value of a parent node is the result of applying the functional value of one of the daughter nodes to the value of the other daughter node. (The types determine which side is the function and which side is the argument.) One exception to this general rule concerns intersective adjectives. (How does \[[complex]] combine with \[[phrases]]?) We'll ignore that though.
Another exception is that Heim and Kratzer have to postulate a special rule to handle lambda abstraction. (This is their "Predicate Abstraction Rule.") Not only is it a special rule, but it's arguably not even a compositional rule. The basic idea is this. The semantic value of: