X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week2.mdwn;h=f7bb440907c470964678e60658a453a8aa4d79cc;hp=37b717787fa0d2eca16ee42b9fe6c66900a722de;hb=9ef074920c539db8a664e273dc17394b59b68716;hpb=42db6a206c30f67c0693e8b367c46d5c86e65d9b diff --git a/week2.mdwn b/week2.mdwn index 37b71778..f7bb4409 100644 --- a/week2.mdwn +++ b/week2.mdwn @@ -1,3 +1,6 @@ +[[!toc]] + + Syntactic equality, reduction, convertibility ============================================= @@ -30,16 +33,22 @@ Lambda expressions that have no free variables are known as **combinators**. Her > **I** is defined to be `\x x` -> **K** is defined to be `\x y. x`, That is, it throws away its +> **K** is defined to be `\x y. x`. That is, it throws away its second argument. So `K x` is a constant function from any (further) argument to `x`. ("K" for "constant".) Compare K - to our definition of **true**. + to our definition of `true`. + +> **get-first** was our function for extracting the first element of an ordered pair: `\fst snd. fst`. Compare this to K and `true` as well. -> **get-first** was our function for extracting the first element of an ordered pair: `\fst snd. fst`. Compare this to **K** and **true** as well. +> **get-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of `false`. -> **get-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of **false**. +> **B** is defined to be: `\f g x. f (g x)`. (So `B f g` is the composition `\x. f (g x)` of `f` and `g`.) -> **ω** is defined to be: `\x. x x` +> **C** is defined to be: `\f x y. f y x`. (So `C f` is a function like `f` except it expects its first two arguments in swapped order.) + +> **W** is defined to be: `\f x . f x x`. (So `W f` accepts one argument and gives it to `f` twice. What is the meaning of `W multiply`?) + +> **ω** (that is, lower-case omega) is defined to be: `\x. x x` It's possible to build a logical system equally powerful as the lambda calculus (and readily intertranslatable with it) using just combinators, considered as atomic operations. Such a language doesn't have any variables in it: not just no free variables, but no variables at all. @@ -48,19 +57,122 @@ One can do that with a very spare set of basic combinators. These days the stand There are some well-known linguistic applications of Combinatory Logic, due to Anna Szabolcsi, Mark Steedman, and Pauline Jacobson. Szabolcsi supposed that the meanings of certain expressions could be -insightfully expressed in the form of combinators. A couple more -combinators: - - **C** is defined to be: `\f x y. f y x` [swap arguments] +insightfully expressed in the form of combinators. - **W** is defined to be: `\f x . f x x` [duplicate argument] For instance, Szabolcsi argues that reflexive pronouns are argument duplicators. -![test](./szabolcsi-reflexive.png) +![reflexive](http://lambda.jimpryor.net/szabolcsi-reflexive.jpg) + +Notice that the semantic value of *himself* is exactly `W`. +The reflexive pronoun in direct object position combines first with the transitive verb (through compositional magic we won't go into here). The result is an intransitive verb phrase that takes a subject argument, duplicates that argument, and feeds the two copies to the transitive verb meaning. + +Note that `W <~~> S(CI)`: + +
S(CI) ≡
+S((\fxy.fyx)(\x.x)) ~~>
+S(\xy.(\x.x)yx) ~~>
+S(\xy.yx) ≡
+(\fgx.fx(gx))(\xy.yx) ~~>
+\gx.(\xy.yx)x(gx) ~~>
+\gx.(gx)x ≡
+W