\setlength{\footheight}{0.0in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topmargin}{0.0in}

\newif\ifpagenumbering
\pagenumberingtrue
\newcommand{\firstpagenumber}{1}
\pagenumberingfalse

%
%  Conditionals for generating different versions
%
\newif\ifabstract
\newif\ifjournal
\newcommand{\mnote}[1]{{\tiny\marginpar[#1]{#1}}}
\newsavebox{\theorembox}
\newsavebox{\lemmabox}
\newsavebox{\claimbox}
\newsavebox{\factbox}
\newsavebox{\defnbox}
\newsavebox{\corollarybox}
\newsavebox{\propositionbox}
\newsavebox{\examplebox}
\newsavebox{\exercisebox}
\newsavebox{\problembox}
\newsavebox{\conjecturebox}
\newsavebox{\oqbox}
\newsavebox{\remarkbox}
\savebox{\theorembox}{\noindent\bf Theorem}
\savebox{\lemmabox}{\noindent\bf Lemma}
\savebox{\claimbox}{\noindent\bf Claim}
\savebox{\factbox}{\noindent\bf Fact}
\savebox{\defnbox}{\noindent\bf Definition}
\savebox{\corollarybox}{\noindent\bf Corollary}
\savebox{\propositionbox}{\noindent\bf Proposition}
\savebox{\examplebox}{\noindent\bf Example}
\savebox{\exercisebox}{\noindent\bf Exercise}
\savebox{\problembox}{\noindent\bf Problem}
\savebox{\conjecturebox}{\noindent\bf Conjecture}
\savebox{\remarkbox}{\noindent\bf Remark}
\savebox{\oqbox}{\noindent\bf Open Question}
\newtheorem{theorem}{\usebox{\theorembox}}
\newtheorem{lemma}{\usebox{\lemmabox}}
\newtheorem{claim}{\usebox{\claimbox}}
\newtheorem{fact}{\usebox{\factbox}}
\newtheorem{remark}{\usebox{\remarkbox}}
\newtheorem{corollary}{\usebox{\corollarybox}}
\newtheorem{proposition}[theorem]{\usebox{\propositionbox}}
\newtheorem{exercise}{\usebox{\exercisebox}}
\newtheorem{problem}{\usebox{\problembox}}
\newtheorem{conjecture}{\usebox{\conjecturebox}}
\newtheorem{oq}{\usebox{\oqbox}}
\newtheorem{defn}{\usebox{\defnbox}}
\def\blackslug{\hbox{\hskip 1pt \vrule width 4pt height 8pt depth 1.5pt
\hskip 1pt}}
\newtheorem{exprime}{Example}%[section]
%\newenvironment{example}{\noindent\exprime\em {\vspace{-0.05 in}}}{
%\hfill $\blackslug$ \par \addvspace{\bigskipamount}{\vspace{0in}}}
\newenvironment{example}{\noindent\exprime\em {\vspace{-0.05 in}}}{
\hfill $\blackslug$ \par \addvspace{\bigskipamount}{\vspace{0in}}}

%Miscellaneous commands for proofs
\newcommand{\qed}{\mbox{}\hspace*{\fill}\nolinebreak\mbox{$\rule{0.7em}{0.7em}$}}
\newenvironment{proof}{\par{\bf Proof:}}{\(\qed\) \par}
\newenvironment{proofsketch}{\par{\bf Proof Sketch:}}{\(\qed\) \par}
\newenvironment{defproof}[1]{\par{\bf Proof #1:}}{\(\qed\) \par}
\newcommand{\case}[1]{{\small \sc Case #1:}}
\newcommand{\subcase}[1]{{\em Case #1:}\/}

\renewcommand{\hat}[1]{\widehat{#1}}
\newcommand{\opt}{\mbox{\footnotesize\sc opt}}
\newcommand{\parent}{\mbox{\sc parent}}
\newcommand{\precstar}{\stackrel{\mbox{\raisebox{-0.5ex}[0pt][0pt]{\tiny$\star$}}}{\prec}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% ALGORITHM ENVIRONMENT STUFF

\newcommand{\step}[1]{\item[{\bf #1}]}	%macro for steps

  % Boxing command (especially for algorithms)
\long\gdef\boxit#1{\vspace{5mm}\begingroup\vbox{\hrule\hbox{\vrule\kern3pt
      \vbox{\kern3pt#1\kern3pt}\kern3pt\vrule}\hrule}\endgroup}

  %Rajeev's environment for outermost block in an algorithm
\newenvironment{algorithm}[3]%
  { \begin{flushleft}%
   \begin{minipage}[b]{0.95\textwidth}%   %minipage keeps algorithm on same page
      %To allow it to break, use \leftmargin and \rightmargin below.
   \noindent{\bf The #1 Algorithm\/}: \vspace*{-0.1in}%
   \begin{description}
    {\setlength{\listparindent}{-2.5mm}%
     %\addtolength{\leftmargin}{0.1in}%
     \setlength{\parskip}{0ex}%
     \setlength{\itemsep}{0in}
     \setlength{\parsep}{\parskip}%
     \setlength{\topsep}{-0.45in}%
     \setlength{\partopsep}{0in}}%
     \item[{\bf Input:}] #2 \vspace*{-0.1in}
     \item[{\bf Output:}] #3 \vspace*{-0.1in}
   \end{description}
   \begin{description}{}%
    {\setlength{\listparindent}{-2.5mm}%
     %\addtolength{\leftmargin}{0.1in}%
     \setlength{\parskip}{0ex}%
     \setlength{\itemsep}{0in}
     \setlength{\parsep}{\parskip}%
     \setlength{\topsep}{-0.45in}%
     \setlength{\partopsep}{0in}}%
   %\item[]%
  }%
  {\end{description}%
   \end{minipage}%
   \end{flushleft}%
  }

  %Rajeev's environment for indented block in an algorithm
\newenvironment{block}%
  {\begin{list}{}%
     {\addtolength{\leftmargin}{0.1in}%
     \setlength{\listparindent}{-2.5mm}%
     \setlength{\parskip}{0ex}%
     \setlength{\parsep}{\parskip}%
     \setlength{\itemsep}{0in}%
     \setlength{\partopsep}{0in}%
     \setlength{\topsep}{-0.1in}}%
     \vspace*{-0.1in}
     \item[]%
  }%
  {\end{list}%\vspace*{-0.1in}%
  }

  %Algorithm keywords
\newcommand{\Algorithm}{{\bf algorithm\ }}
\newcommand{\Procedure}{{\bf procedure\ }}
\newcommand{\Function}{{\bf function\ }}
\newcommand{\Var}{{\bf var\ }}
\newcommand{\Comment}{{\bf comment:\ }}
\newcommand{\Begin}{{\bf begin\ }}
\newcommand{\End}{{\bf end\ }}
\newcommand{\If}{{\bf if\ }}
\newcommand{\Or}{{\bf \ or\ }}
\newcommand{\And}{{\bf \ and\ }}
\newcommand{\Not}{{\bf not\ }}
\newcommand{\Then}{{\bf then\ }}
\newcommand{\Else}{{\bf else\ }}
\newcommand{\Repeat}{{\bf repeat\ }}
\newcommand{\Times}{{\bf times\ }}
\newcommand{\Forever}{{\bf forever\ }}
\newcommand{\For}{{\bf for\ }}
\newcommand{\While}{{\bf while\ }}
\newcommand{\Until}{{\bf until\ }}
\newcommand{\From}{{\bf from\ }}
\newcommand{\To}{{\bf to\ }}
\newcommand{\By}{{\bf by\ }}
\newcommand{\All}{{\bf all\ }}
\newcommand{\Such}{{\bf such\ }}
\newcommand{\That}{{\bf that\ }}
\newcommand{\Do}{{\bf do\ }}
\newcommand{\Existentially}{{\bf existentially\ }}
\newcommand{\Universally}{{\bf universally\ }}
\newcommand{\Choose}{{\bf choose\ }}
\newcommand{\Guess}{{\bf guess\ }}
\newcommand{\Accept}{{\bf accept}}
\newcommand{\Reject}{{\bf reject}}
\newcommand{\Halt}{{\bf halt}}
\newcommand{\Return}{{\bf return\ }}
\newcommand{\Send}{{\bf send\ }}
\newcommand{\Receive}{{\bf receive}}
\newcommand{\Returns}{{\bf returns\ }}
\newcommand{\Case}{{\bf case }}
\newcommand{\Of}{{\bf of }}
\newcommand{\Let}{{\bf let }}
\newcommand{\Goto}{{\bf go to }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


