From 2cd4b4e5483426695baf3ebb112259db012cf6a7 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 18 Oct 2023 09:16:29 -0700 Subject: [PATCH] Fixed Kestrel problems --- .../Lambda Calculus/parts/01 combinators.tex | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Advanced/Lambda Calculus/parts/01 combinators.tex b/Advanced/Lambda Calculus/parts/01 combinators.tex index bfb3a95..fd39f7d 100755 --- a/Advanced/Lambda Calculus/parts/01 combinators.tex +++ b/Advanced/Lambda Calculus/parts/01 combinators.tex @@ -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{} +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 \ No newline at end of file