\iffalse

INSTRUCTIONS: (if this is not ps1, use the right file name)

  Clip out the ********* INSERT HERE ********* bits below and insert
appropriate TeX code.  Once you are done with your file, run

  ``latex template.tex''

from the Athena shell.  If your TeX code is clean, the latex will exit
back to a prompt.  Once this is done, run

  ``dvips template.dvi -o template.ps''

which should print your file to the nearest printer.  There will be
residual files called ps1.log, ps1.aux, and ps1.dvi.  All these can be
deleted, but do not delete ps1.tex.

\fi
\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{graphicx}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}
\setlength{\parindent}{0pt}
%\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

\newcommand{\var}[0]{
  \textrm{var}
}

\newcommand{\E}[0]{
  \mathbf{E}
}

\newcommand{\cov}[0]{
  \textrm{cov}
}

\newcommand{\handout}[5]{
   \renewcommand{\thepage}{\arabic{page}}
   \noindent
   \begin{center}
   \framebox{
      \vbox{
    \hbox to 5.78in { {\bf 6.001 SICP Spring 2004} \hfill #2 }
       \vspace{4mm}
       \hbox to 5.78in { {\Large \hfill #5  \hfill} }
       \vspace{2mm}
       \hbox to 5.78in { {\it #3 \hfill #4} }
      }
   }
   \end{center}
   \vspace*{4mm}
}

\newcommand{\ho}[5]{\handout{#1}{#2}{Instructor:
#3}{Teaching Assistant: #4}{Handout #1: #5}}
\newcommand{\al}{\alpha}
\newcommand{\Z}{\mathbb Z}

\begin{document}
\handout{P1}{3/8/2004}
{} % {Problem Set 4}
{} % {Instructor: foo}
{Tutorial 5} %{Bryan Russell}

\section*{Topics}
Symbols and Quotation

\section*{Upcoming Deadlines}

\begin{itemize}
\item Problem set 4 due Tuesday, 3/9 at midnight
\item Lecture 10 due Wednesday, 3/10 at 9am
\item Lecture 11 due Friday, 3/12 at 9am
\item Project 3 due Friday, 3/19 at 6pm
\end{itemize}

\section*{Symbolic Manipulation - Boolean Formula Evaluation}

Some constructors, accessors, and predicates:

\begin{verbatim}
(define variable? symbol?)
(define (make-variable var)
  var)
(define (variable-name exp)
  exp)

(define (or? exp)
  (and (pair? exp) (eq? (car exp) 'or)))
(define (make-or exp1 exp2)
  (list 'or exp1 exp2))
(define (or-first exp)
  (cadr exp))
(define (or-second exp)
  (caddr exp))

(define (and? exp)
  (and (pair? exp) (eq? (car exp) 'and)))
(define (make-and exp1 exp2)
  (list 'and exp1 exp2))
(define (and-first exp)
  (cadr exp))
(define (and-second exp)
  (caddr exp))
\end{verbatim}

\subsection*{Exercise 1}
Write predicate, constructor, and accessor for not.

\subsection*{Exercise 2}
Given a formula and a list of variable assignments, decide whether the
formula is ${\verb+#t+}$ or ${\verb+#f+}$.  Assume that you have a
procedure ${\verb+(variable-value bindings vname)+}$, which takes a
list of assignments and a variable name and returns the value assigned
to the variable.

\begin{verbatim}
(define (formula-value exp bindings)
\end{verbatim}

\end{document}
