X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week2.mdwn;h=f7bb440907c470964678e60658a453a8aa4d79cc;hp=8de3aab92723df4b58f55c96613be9319b57ead4;hb=9ef074920c539db8a664e273dc17394b59b68716;hpb=d2fa64a9e75f27c2d8fdaeae2f25eb29da82e760 diff --git a/week2.mdwn b/week2.mdwn index 8de3aab9..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-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of `false`. -> **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. +> **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`.) -> **get-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of **false**. +> **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.) -> **ω** is defined to be: `\x. x x` +> **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,30 +57,27 @@ 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](http://lambda.jimpryor.net/szabolcsi-reflexive.jpg) +![reflexive](http://lambda.jimpryor.net/szabolcsi-reflexive.jpg) -Notice that the semantic value of *himself* is exactly W. +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): +Note that `W <~~> S(CI)`: - S(CI) = - S((\fxy.fyx)(\x.x)) = - S(\xy.(\x.x)yx) = - (\fgx.fx(gx))(\xy.yx) = - \gx.[\xy.yx]x(gx) = - \gx.(gx)x = - W +
``````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``````