\documentclass[12pt]{article}

\usepackage{times,mathptm}
\pagestyle{myheadings}



\parindent 0in
\setlength{\parindent}{0in}
\setlength{\parskip}{1ex}

\topmargin -0.1in \headheight\baselineskip
\textheight 8.5in         % 1in top and bottom margin
\textwidth 6.5in        % 1in left and right margin
\oddsidemargin 0in
\evensidemargin 0in




\usepackage{amsmath}
\usepackage{amssymb}


% \setlength{\itemsep}{0pt}

\markright{\footnotesize CS 451 Programming Paradigms, Spring 2001}

\begin{document}

\section*{Homework set 8: $\lambda$-calculus --- due Monday 26 February}

Total number of points available on this homework is 100. Full credit
is equivalent to 100 points.

\begin{enumerate}






\item (10 pts.)      
Identify the bound and free variables of each of the following lambda 
expressions:
\begin{enumerate}
\item $(\lambda x. x \, y) (\lambda y. y)$
\item $(\lambda x.\lambda y. x \, z (y \, z)) \, (\lambda x. y (\lambda y.y))$
\end{enumerate}



\item (30 pts.)      
For each of the following $\lambda$-expressions (with predefined arithmetic):
\begin{enumerate}
\item $\lambda x.\lambda y. (\lambda z. z) x (+ \: y \: 1)$
\item $(\lambda h. (\lambda x. h (x \, x)) (\lambda x. h (x \, x))) \, ((\lambda x. x)(+ \: 1 \: 5))$
\end{enumerate}
do the following:
\begin{itemize}
\item underline all of the redexes indicating whether they 
are $\beta$, $\eta$, or $\delta$ redexes;
\item identify the leftmost-outermost and leftmost-innermost redexes;
\item write down the normal form of each, showing the
reduction steps required to reach them, assuming normal-order reduction.
\end{itemize}



\item (20 pts.)    
The three fundamental combinators are:
\begin{quote}
$\textsf{\textbf{I}} \triangleq \lambda x. x$ \\
$\textsf{\textbf{K}} \triangleq \lambda xy. x$ \\
$\textsf{\textbf{S}} \triangleq \lambda xyz. xz (yz)$
\end{quote}
Show that $\textsf{\textbf{S}} \textsf{\textbf{K}} \textsf{\textbf{K}} = \textsf{\textbf{I}}$.



\item (40 pts.)      
Find the normal form of:
\begin{enumerate}
\item $\textsf{\textbf{K}} (\textsf{\textbf{S}} \textsf{\textbf{I}} \textsf{\textbf{I}})$
\item $\textsf{\textbf{S}} (\textsf{\textbf{S}} (\textsf{\textbf{K}}\textsf{\textbf{S}})(\textsf{\textbf{K}}\textsf{\textbf{I}})) (\textsf{\textbf{K}}\textsf{\textbf{I}})$
\end{enumerate}





\end{enumerate}


\end{document}

