% define page layout
%\setlength{\textwidth}{5.7in}
%\setlength{\textheight}{8.5in}
%\setlength{\topmargin}{-0.125in}
%\setlength{\oddsidemargin}{18pt}
%\setlength{\evensidemargin}{18pt}
%\setlength{\columnseprule}{.4pt}
%\setlength{\headheight}{19pt}
%\setlength{\headsep}{18pt}
%\setlength{\footheight}{16pt}
%\setlength{\footskip}{34pt}
%\setlength{\headrulewidth}{2pt}
%\setlength{\footrulewidth}{0pt}

\renewcommand{\sectionmark}[1]{ }
\renewcommand{\subsectionmark}[1]{ }

\def\HDRULE{\rule[-.6\baselineskip]{\textwidth}{1pt}}
\newsavebox{\HDRULEBOX}
\savebox{\HDRULEBOX}[0pt]{\HDRULE}

%\lhead[]{{\sc Modelling Bit Vectors}}
%\chead[]{\usebox{\HDRULEBOX}}
%\rhead[]{{\sl\thepage\hspace{.5em}}}
%\cfoot[]{}


\input holmacs
\input{tokmac}

\newtokmac{mlname}{\tt}
\newtokmac{CONST}{\constfont}
\newtokmac{KEYWD}{\keyfont}
\newtokmac{para}{\tt}
\newtokmac{cmd}{\constfont}

\makeatletter
%\def\verb{\begingroup \catcode``=13 \@noligs
%\verbatim@font \let\do\@makeother \dospecials
%\@ifstar{\@sverb}{\@verb}}
%
%% Definitions of \@sverb and \@verb changed so \verb+ foo+  does not lose
%% leading blanks when it comes at the beginning of a line.
%% Change made 24 May 89. Suggested by Frank Mittelbach and Rainer Sch\"opf.
%%
%\def\@sverb#1{\def\@tempa ##1#1{\leavevmode\null##1\endgroup}\@tempa}
%
%\def\@verb{\@vobeyspaces \frenchspacing \@sverb}
%
\def\wordn{\verb|:word|$n$}
\def\word{\@ifnextchar[{\@word}{\@word[*]}}
\def\@word[#1]{\verb|:(#1)word|}
\def\sect{\@startsection {subsection}{1}{\z@}{-3.5ex plus -1ex minus
 -.2ex}{1.5ex plus .2ex}{\normalsize\bf}}
\def\subsect{\@startsection {subsubsection}{2}{\z@}{-3.5ex plus -1ex minus
 -.2ex}{-1em}{\footnotesize\bf}}
\def\inputmlfile#1{\begingroup \footnotesize \input#1 \endgroup}

%\renewenvironment{theindex}{\begin{multicols}{2}[\section*{\indexname}]%
% \columnseprule \z@ \columnsep 35\p@
% \parindent\z@ \parskip\z@ plus.3\p@\relax\let\item\@idxitem}{\end{multicols}}
%
%\def\@idxitem{\par\hangindent 40\p@}
%
%\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
%
%\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
%
%\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
%
\makeatother


\def\NBWORD#1#2{\CONST{NBWORD}\,\CONST{#1}\,\CONST{#2}}
\def\SEG#1#2#3{\CONST{SEG}\,\CONST{#1}\,\CONST{#2}\,#3}
\def\T{\CONST{T}}

%\def\dotoken#1#2{\mbox{#1#2}\endgroup}
%\def\idxname#1{\begingroup\makeulother\dotoken#1}
%\def\dotokenidx#1#2{\mbox{#1#2}\index{#2@\string\idxname{#1}{#2}}\endgroup}
%\def\mlname{\begingroup\makeulother\dotokenidx{\tt}}
%\def\CONST{\begingroup\makeulother\dotokenidx{\constfont}}
%\def\KEYWD{\begingroup\makeulother\dotoken{\keyfont}}
%
%\def\idxmlname{\begingroup\makeulother\dotoken{\tt}}
%\def\idxconst{\begingroup\makeulother\dotoken{\constfont}}
%\def\ul#1{\relax\ifmmode\underline#1\else$\underline{#1}$\fi}

% define environment for HOL definitions and theorems
\def\makeulother{\catcode`\_=12\relax}
\def\makeulsub{\catcode`\_=8\relax}
%\begingroup
% \makeulother
% \gdef\_{\ul}
%\endgroup
\def\doholdef#1{\par\vspace*{5pt}\index{#1@\string\idxname{\tt}{#1}|ul}%
 \flushleft{\bf HOL Definition }({\tt#1})\label{def-#1}\endgroup}
\def\holdef{\begingroup\makeulother\doholdef}
\let\endholdef=\endflushleft

\def\doholthm#1{\par\index{#1@\string\idxname{\tt}{#1}|ul}%
 \flushleft{\bf HOL Theorem }({\tt#1})\label{thm-#1}\endgroup}
\def\holthm{\begingroup\makeulother\doholthm}
\let\endholthm=\endflushleft

\font\sfc=cmssc12 \def\constfont{\sfc}
\def\ul#1{$\underline{#1}$}