Fixed Kestrel problems
This commit is contained in:
parent
b0bb202225
commit
2cd4b4e548
@ -2,43 +2,41 @@
|
||||
|
||||
\definition{}
|
||||
A \textit{free variable} in a $\lm$-expression is a variable that isn't bound to any input. \par
|
||||
For example, $b$ is a free variable in $\lm a. b$. The same is true of $\star$ in any of the previous pages.
|
||||
For example, $b$ is a free variable in $(\lm a.a)~b$.
|
||||
|
||||
A \textit{combinator} is a function with no free variables.
|
||||
\definition{Combinators}
|
||||
A \textit{combinator} is a lambda expression with no free variables.
|
||||
|
||||
|
||||
|
||||
\definition{The Kestrel}
|
||||
\vspace{1mm}
|
||||
|
||||
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)) ~)$
|
||||
|
||||
\footnotetext{Raymond Smullyan's \textit{To Mock a Mockingbird} is responsible for this.}
|
||||
|
||||
\vspace{2ex}
|
||||
|
||||
Another notable combinator is $K$, the \textit{Kestrel}:
|
||||
$$
|
||||
K = \lm ab . a
|
||||
$$
|
||||
The \textit{Kestrel}, $K = \lm ab . a$
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
What does the Kestrel do? Explain in plain English. \par
|
||||
\hint{What is $(K~\heartsuit~\star)$?}
|
||||
If we give the Kestrel two arguments, it does something interesting: \par
|
||||
It selects the first and rejects the second. \par
|
||||
Convince yourself of this fact by evaluating $(K~\heartsuit~\star)$.
|
||||
|
||||
\vspace{2cm}
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Reduce $(K~I)$ to derive the \textit{Kite}. How does the Kite compare to the Kestrel? \par
|
||||
We'll call the Kite KI.
|
||||
\problem{}<kitedef>
|
||||
Modify the Kestrel so that it selects its \textbf{second} argument and rejects the first. \par
|
||||
|
||||
\begin{solution}
|
||||
$\text{KI} = \lm ab . b$.
|
||||
$\lm ab . b$.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
We'll call the combinator from \ref{kitedef} the \textit{Kite}, $KI$. \par
|
||||
Show that we can also obtain the kite by evaluating $(K~I)$.
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
Loading…
x
Reference in New Issue
Block a user