Lambda edits
This commit is contained in:
@ -35,21 +35,24 @@ Write an expression that resolves to itself. \par
|
||||
\vspace{1ex}
|
||||
|
||||
This expression is often called $\Omega$, after the last letter of the Greek alphabet. \par
|
||||
$\Omega$ useless on its own, but it gives us a starting point for recursion.
|
||||
$\Omega$ useless on its own, but it gives us a starting point for recursion. \par
|
||||
|
||||
\begin{solution}
|
||||
$\Omega = M~M = (\lm x . xx) (\lm x . xx)$
|
||||
|
||||
\vspace{1ex}
|
||||
|
||||
\vspace{1mm}
|
||||
|
||||
An uninspired mathematician might call the Mockingbird $\omega$, \say{little omega}.
|
||||
\end{solution}
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
|
||||
\definition{}
|
||||
This is the \textit{Y-combinator}, easily the most famous $\lm$ expression. \par
|
||||
You may notice that it's just $\Omega$, put to work.
|
||||
This is the \textit{Y-combinator}. You may notice that it's just $\Omega$ put to work.
|
||||
$$
|
||||
Y = \lm f . (\lm x . f(x~x))(\lm x . f(x~x))
|
||||
$$
|
||||
@ -58,5 +61,27 @@ $$
|
||||
What does this thing do? \par
|
||||
Evaluate $Y f$.
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\definition{}
|
||||
We say $x$ is a \textit{fixed point} of a function $f$ if $f(x) = x$.
|
||||
|
||||
\problem{}
|
||||
Show that $Y F$ is a fixed point of $F$.
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Let $\theta = (\lm xy . y(xxy))$ and $\Theta = \theta \theta$. \par
|
||||
Let $N = \Theta F$ for an arbitrary lambda expression $F$. \par
|
||||
|
||||
Show that $F N = N$.
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{Bonus}
|
||||
Find a fixed-point combinator that isn't $Y$ or $\Theta$.
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
Reference in New Issue
Block a user