% cs221-style.tex
%
% Macros for handouts and homework.  Put the following
% command at the top of the tex file:
%
%    \input{../cs221-style}
%

\addtolength{\textheight}{1.5in}
\addtolength{\topmargin}{-0.75in}
\oddsidemargin 0.25in
\evensidemargin 0.25in
\textwidth 6.0in
\parskip 5pt

\newlength{\indentwid}
\addtolength{\indentwid}{1\textwidth}
\addtolength{\indentwid}{-1\parindent}

\usepackage{times}

%
% \handout{number}{date}{title}
%
\newcommand{\handout}[3]{%
  \begin{center}
    \framebox{\framebox{
    \parbox{5.5in}{\bf
      \begin{center}
        \begin{tabular}{lcr}
          CS 221	& Programming Languages & Handout #1 \\
          Fall 2005	&			& #2 \\
          \multicolumn{1}{p{1.25in}}{} &
          \multicolumn{1}{p{2.25in}}{} &
          \multicolumn{1}{p{1.25in}}{} \\
        \end{tabular} \\
        {\Large \bf #3}
      \end{center}}
    }}\vspace{0.5in}
  \end{center}%
}

%
% \homework{number}{due-date}
%
\newcommand{\homework}[2]{%
  \begin{center}
    \framebox{\framebox{
    \parbox{5.5in}{\bf
      \begin{center}
        \begin{tabular}{lcr}
          CS 221	& Programming Languages & Homework #1 \\
          Fall 2004	&			& Due: #2 \\
          \multicolumn{1}{p{1.25in}}{} &
          \multicolumn{1}{p{2.25in}}{} &
          \multicolumn{1}{p{1.25in}}{} \\[-1em]
        \end{tabular}
      \end{center}}
    }}\vspace{0.5in}
  \end{center}%
}

%
% \solution{number}{due-date}
%
\newcommand{\solution}[2]{%
  \begin{center}
    \framebox{\framebox{
    \parbox{5.5in}{\bf
      \begin{center}
        \begin{tabular}{lcr}
          CS 221	& Programming Languages & Homework Solution #1 \\
          Fall 2004	&			& Due #2 \\
          \multicolumn{1}{p{1.25in}}{} &
          \multicolumn{1}{p{2.25in}}{} &
          \multicolumn{1}{p{1.25in}}{} \\[-1em]
        \end{tabular}
      \end{center}}
    }}\vspace{0.5in}
  \end{center}%
}

\newcommand{\ie}{\textit{i.e.}}
\newcommand{\SET}[1]{\ensuremath{\{#1\}}}
%               
% inference rules                                                           
\newcommand{\infer}[2]{\frac{\;{#2}\;}{\;{#1}\;}}
\newcommand{\inferl}[3]{\frac{\;{#3}\;}{\;{#2}\;} \quad (#1)}
\newcommand{\INFER}[3][]{%       
  \begin{equation}\label{#1}     
      \infer{#2}{#3}                     
  \end{equation}}                          

\newcommand{\INFERL}[3][]{%       
  \begin{displaymath}
      \infer{#2}{#3} \quad (#1)
  \end{displaymath}}                          
