%THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{proof}
\usepackage{hyperref}
\newtheorem{lemma}{Lemma}
\newtheorem{corr}{Corollary}
\newenvironment{hint}{\noindent{\bf (Hint)}}{}
\newtheorem{thm}{Theorem}
\newtheorem{definition}{Definition}
\newtheorem{task}{Task}
\newtheorem{bonus}{Bonus Task}

\newif\ifsol

\newcommand{\makehwtitle}[4]
{{\centering\Large\textbf{Homework #1: #2}
    \normalsize\\
15-814: Types and Programming Languages\\
Fall 2015\\
TA: Evan Cavallo (ecavallo@cs.cmu.edu)\\
\ifsol \solcolor \textbf{SOLUTIONS} \normalcolor \\ \fi \vspace{0.5cm}%
Out: #3\\
Due: #4\\
}}

\newenvironment{proof}{\trivlist \item[\hskip \labelsep{\bf
Proof:}]}{\hfill$\Box$ \endtrivlist}

\newenvironment{sol}{
\trivlist \item[\hskip \labelsep{\bf
Solution:}]}{\endtrivlist}

\newcommand{\solution}[1]{\ifsol \begin{sol} #1 \end{sol} \fi}

\newcommand{\taskpts}[1]{[#1]}

\newenvironment{includeintemplate}{}{}
\newenvironment{noinclude}{}{}
\newcommand{\rulename}[1]{\text{\textsc{(#1)}}}
\newcommand{\einfer}[3]
        {\begin{equation}\label{eq:#1}\infer[]{#2}{#3}\end{equation}}

\allowdisplaybreaks       %mildly permissible to break up displayed equations
%% Propositions
\newtheorem{prop}{Proposition}

%% General
\newcommand{\textbsf}[1]{\textbf{\textsf{#1}}}
\newcommand{\Lang}[1]{\textbsf{#1}}
\newcommand{\kw}[1]{\ensuremath{\mathtt{#1}}}
\newcommand{\kwop}[1]{\ensuremath{\mathop{\mathtt{#1}}}}
\newcommand{\kwbin}[1]{\ensuremath{\mathbin{\mathtt{#1}}}}
\newcommand{\step}{\mapsto}
\newcommand{\G}{\Gamma}
\newcommand{\xv}{\vec{x}}
\newcommand{\entails}{\vdash}
\newcommand{\xvars}{\mathcal{X}}
\newcommand{\cdparens}[1]{\kw{(}{#1}\kw{)}}
\newcommand{\cdsqbracks}[1]{\kw{[}{#1}\kw{]}}
\newcommand{\OpAST}[2]{{#1}\cdparens{#2}}
\newcommand{\AbsAST}[2]{{#1}\cddot{#2}}
\newcommand{\OpABT}[2]{{#1}\cdparens{#2}}
\newcommand{\OpABTp}[3]{{#1}\cdsqbracks{#2}\cdparens{#3}}
\newcommand{\OpABTpp}[4]{{#1}\cdsqbracks{#2}\cdsqbracks{#3}\cdparens{#4}}
\newcommand{\OpABTn}[2]{{#1}\cdsqbracks{#2}}
\newcommand{\OpABTnn}[3]{{#1}\cdsqbracks{#2}\cdsqbracks{#3}}
\newcommand{\AbsABT}[2]{{#1}\cddot{#2}}
\newcommand{\pairff}[2]{{#1}\mathbin{\hookrightarrow}{#2}}
\newcommand{\eqdef}{\mathrel{\triangleq}}
\newcommand{\val}{\;\mathsf{val}}
\newcommand{\lequiv}[1]{\sim_{#1}}
\newcommand{\dom}[1]{\mathit{Dom}(#1)}
\newcommand{\dummy}{\_}
\newcommand{\evals}[3]{#1 \Downarrow^{#2} #3}

%% Types
\newcommand{\tunit}{\mathtt{unit}}
\newcommand{\tsum}[2]{#1 + #2}
\newcommand{\tprod}[2]{#1 \times #2}
\newcommand{\tarrow}[2]{#1 \rightarrow #2}
\newcommand{\tparr}[2]{#1 \rightharpoonup #2}
\newcommand{\tcmd}[1]{\mathtt{cmd}(#1)}
\newcommand{\tnat}{\kw{nat}}
\newcommand{\tint}{\kw{int}}
\newcommand{\tbool}{\kw{bool}}

%% Expressions
\newcommand{\lam}[3]{\lambda #1{:}#2.\ #3}
\newcommand{\lams}[2]{\lambda #1.\ #2}
\newcommand{\ap}[2]{\kw{ap}(#1;#2)}
\newcommand{\inl}[1]{\kw{L} \cdot #1}
\newcommand{\inr}[1]{\kw{R} \cdot #1}
\newcommand{\caseop}{\kw{case}}
\newcommand{\ecase}[5]{\caseop\; #1\; \{#2. #3; #4. #5\}}
\newcommand{\eprod}[2]{\langle #1, #2 \rangle}
\newcommand{\triv}{\langle \rangle}
\newcommand{\projl}[1]{#1 \cdot \kw{L}}
\newcommand{\projr}[1]{#1 \cdot \kw{R}}
\newcommand{\zero}{\kw{z}}
\newcommand{\z}{\zero}
\newcommand{\sucop}{\kw{s}}
\newcommand{\suc}[1]{\OpAST{\sucop}{#1}}
\newcommand{\ifzop}{\kw{ifz}}
\newcommand{\ifz}[4]{\OpABT{\ifzop}{#1; #2; #3. #4}}


%% Cost dynamics
\newcommand{\czero}{\mathbf{0}}
\newcommand{\cunit}{\mathbf{1}}
\newcommand{\cseq}[2]{#1 \oplus #2}
\newcommand{\cpar}[2]{#1 \otimes #2}
\newcommand{\wk}[1]{\mathrm{wk}(#1)}
\newcommand{\dep}[1]{\mathrm{dp}(#1)}
\newcommand{\seqop}{\mathsf{seq}}
\newcommand{\parop}{\mathsf{par}}
\newcommand{\substeps}[3]{#2 \step_{#1} #3}
\newcommand{\subnsteps}[4]{#2 \step^{#3}_{#1} #4}
\newcommand{\seqsteps}{\substeps{\seqop}}
\newcommand{\parsteps}{\substeps{\parop}}
\newcommand{\seqnsteps}{\subnsteps{\seqop}}
\newcommand{\parnsteps}{\subnsteps{\parop}}

%% PCF
\newcommand{\langpcf}{\Lang{PCF}}
\newcommand{\hto}{\hookrightarrow}
\newcommand{\fixop}{\kw{fix}}
\newcommand{\efix}[3]{\OpABTp{\fixop}{#1}{#2 . #3}}

%% Continuations
\newcommand{\contop}{\kw{cont}}
\newcommand{\letccop}{\kw{letcc}}
\newcommand{\throwop}{\kw{throw}}
\newcommand{\tcont}[1]{#1\; \contop}
\newcommand{\econt}[1]{\contop(#1)}
\newcommand{\letcc}[3]{\letccop\{#1\}(#2.#3)}
\newcommand{\throw}[3]{\throwop\{#1\}(#2;#3)}

\newcommand{\evalst}[2]{#1 \rhd #2}
\newcommand{\retst}[2]{#1 \lhd #2}
\newcommand{\stepst}{\longmapsto}
\newcommand{\stackemp}{\epsilon}

\newcommand{\langk}{\Lang{K}}
\newcommand{\langi}{\Lang{I}}
\newcommand{\entailsk}{\entails_{\langk}}
\newcommand{\entailsi}{\entails_{\langi}}
\newcommand{\tr}[1]{\lvert\lvert{#1}\rvert\rvert}
\newcommand{\trdn}[1]{\lvert{#1}\rvert}
\newcommand{\tre}{\hat}
\newcommand{\treJ}[3]{#1 : #2 \rightsquigarrow #3}
