\documentclass[11pt]{handout}
\usepackage{6044}
\usepackage{time,fullpage}
\usepackage{amsmath}

\begin{document}

\handout{ps1-soln}{Problem Set 1 Solutions}{28 September 1995}

\begin{enumerate}

\item
\texttt{(define x \#t)}.  Then \texttt{(* 1 x)} causes an error.

\item
Let $M$ be
\begin{verbatim}
(define x 0)
(define zero-thunk (lambda() x))
((lambda(x) (zero-thunk)) 1)
\end{verbatim}
which evaluates to~{\tt 0}.  Instantiating \texttt{zero-thunk} without
renaming yields~$N$:
\begin{verbatim}
(define x 0)
(define zero-thunk (lambda() x))
((lambda(x) ((lambda() x))) 1)
\end{verbatim}
which evaluates to~{\tt 1}.

Nitpick: the problem asked for Scheme expressions, but $M$ and $N$ above
are bodies.  To produce expressions with the requisite behavior, use
\Code{((lambda () $M$))} and \Code{((lambda () $N$))}.

\item
Cycle of rules is ``ILIPCIP'' for reflecting the repeated recursion
until steps 33--41: (C,G) (I,G) P (I,G) P (I,G) P (I,G) P.

\item
Operands in a combination are evaulated right-to-left in this
implementation.

\item Actually the simplest example is a {\em self-evaluating} expression
such as \texttt{\#t} or \texttt{1}.

Following the logic of the hint, we consider the ``self-reproducing''
expression
\begin{verbatim}
(make-quoted-self-application 'make-quoted-self-application)
\end{verbatim}
developed in class.  Now just use the body of the procedure instead of its
name:
\begin{verbatim}
((lambda (s) (list s (list 'quote s))) '(lambda (s) (list s (list 'quote s))))
;Value 3:
((lambda (s) (list s (list 'quote s))) '(lambda (s) (list s (list 'quote s))))
\end{verbatim}

\end{enumerate}

\end{document}

