handouts/Advanced/Lambda Calculus/parts/01 combinators.tex

44 lines
1.1 KiB
TeX
Raw Normal View History

2023-02-05 21:02:05 -08:00
\section{Combinators}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\definition{}
2023-10-04 09:42:09 -07:00
A \textit{free variable} in a $\lm$-expression is a variable that isn't bound to any input. \par
2023-02-05 21:02:05 -08:00
For example, $b$ is a free variable in $\lm a. b$. The same is true of $\star$ in any of the previous pages.
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
A \textit{combinator} is a function with no free variables.
2022-11-13 13:02:25 -08:00
2023-10-16 15:06:51 -07:00
2023-02-05 21:02:05 -08:00
\definition{The Kestrel}
2022-11-13 13:02:25 -08:00
2023-10-04 09:42:09 -07:00
Notable combinators are often named after birds.\hspace{-0.5ex}\footnotemark{} We've already met a few: \par
The \textit{Idiot}, $I = \lm a.a$ \par
The \textit{Mockingbird}, $M = \lm f.ff$ \par
The \textit{Cardinal}, $C = \lm fgx.(~ f(g(x)) ~)$
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\footnotetext{Raymond Smullyan's \textit{To Mock a Mockingbird} is responsible for this.}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\vspace{2ex}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
Another notable combinator is $K$, the \textit{Kestrel}:
$$
K = \lm ab . a
$$
2023-10-16 15:06:51 -07:00
2023-02-05 21:02:05 -08:00
\problem{}
2023-10-04 09:42:09 -07:00
What does the Kestrel do? Explain in plain English. \par
2023-02-05 21:02:05 -08:00
\hint{What is $(K~\heartsuit~\star)$?}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\vspace{2cm}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\problem{}
2023-10-04 09:42:09 -07:00
Reduce $(K~I)$ to derive the \textit{Kite}. How does the Kite compare to the Kestrel? \par
2023-02-05 21:02:05 -08:00
We'll call the Kite KI.
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\begin{solution}
2023-10-04 09:42:09 -07:00
$\text{KI} = \lm ab . b$.
2023-02-05 21:02:05 -08:00
\end{solution}
2022-11-13 13:02:25 -08:00
2023-02-05 21:02:05 -08:00
\vfill
\pagebreak