% iman.sty : Isabelle Manual Page Layout
%
\typeout{Document Style iman. Released 17 February 1994}

\hyphenation{Isa-belle man-u-script man-u-scripts ap-pen-dix mut-u-al-ly}
\hyphenation{data-type data-types co-data-type co-data-types }

\let\ts=\thinspace

%usage: \iflabelundefined{LABEL}{if not defined}{if defined}
\newcommand{\iflabelundefined}[1]{\@ifundefined{r@#1}}


%%%INDEXING  use sedindex to process the index
%index, putting page numbers of definitions in boldface
\newcommand\bold[1]{{\bf#1}}
\newcommand\fnote[1]{#1n}
\newcommand\indexbold[1]{\index{#1|bold}}

%for indexing constants, symbols, theorems, ...
\newcommand\cdx[1]{{\tt#1}\index{#1@{\tt#1} constant}}
\newcommand\sdx[1]{{\tt#1}\index{#1@{\tt#1} symbol}}

\newcommand\tdx[1]{{\tt#1}\index{#1@{\tt#1} theorem}}
\newcommand\tdxbold[1]{{\tt#1}\index{#1@{\tt#1} theorem|bold}}

\newcommand\mltydx[1]{{\tt#1}\index{#1@{\tt#1} ML type}}
\newcommand\xdx[1]{{\tt#1}\index{#1@{\tt#1} exception}}

\newcommand\ndx[1]{{\tt#1}\index{#1@{\tt#1} nonterminal}}
\newcommand\ndxbold[1]{{\tt#1}\index{#1@{\tt#1} nonterminal|bold}}

\newcommand\cldx[1]{{\tt#1}\index{#1@{\tt#1} class}}
\newcommand\tydx[1]{{\tt#1}\index{#1@{\tt#1} type}}
\newcommand\thydx[1]{{\tt#1}\index{#1@{\tt#1} theory}}

%for cross-references: 2nd argument (page number) is ignored
\newcommand\see[2]{{\it see \/}{#1}}
\newcommand\seealso[2]{{\it see also \/}{#1}}

%set argument in \tt font; at the sime time, index using * prefix
\newcommand\rmindex[1]{{#1}\index{#1}\@}
\newcommand\ttindex[1]{{\tt#1}\index{*#1}\@}
\newcommand\ttindexbold[1]{{\tt#1}\index{*#1|bold}\@}

%set argument in \bf font and index in ROMAN font (for definitions in text!)
\newcommand\bfindex[1]{{\bf#1}\index{#1|bold}\@}


%%% underscores as ordinary characters, not for subscripting
%%  use @ or \sb for subscripting; use \at for @
%%  only works in \tt font
%%  must not make _ an active char; would make \ttindex fail!
\gdef\underscoreoff{\catcode`\@=8\catcode`\_=\other}
\gdef\underscoreon{\catcode`\_=8\makeatother}
\chardef\other=12
\chardef\at=`\@

% alternative underscore
\def\_{\leavevmode\kern.06em\vbox{\hrule height.2ex width.3em}\hskip0.1em}

%%% \dquotes permits usage of "..." for \hbox{...} -- also taken from under.sty
{\catcode`\"=\active
\gdef\dquotes{\catcode`\"=\active  \let"=\@mathText}%
\gdef\@mathText#1"{\hbox{\mathTextFont #1\/}}}
\def\mathTextFont{\frenchspacing\tt}

%%%% meta-logical connectives

\let\Forall=\bigwedge
\let\Imp=\Longrightarrow
\let\To=\Rightarrow
\newcommand\Var[1]{{?\!#1}}

%%%% ``WARNING'' environment
\def\dbend{\vtop to 0pt{\vss\hbox{\Huge\bf!}\vss}}
\newenvironment{warn}{\medskip\medbreak\begingroup \clubpenalty=10000 
         \small %%WAS\baselineskip=0.9\baselineskip
         \noindent \hangindent\parindent \hangafter=-2 
         \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}%
        {\par\endgroup\medbreak}


%%%% Standard logical symbols
\let\turn=\vdash
\let\conj=\wedge
\let\disj=\vee
\let\imp=\rightarrow
\let\bimp=\leftrightarrow
\newcommand\all[1]{\forall#1.}  %quantification
\newcommand\ex[1]{\exists#1.}
\newcommand{\pair}[1]{\langle#1\rangle}

\newcommand\lbrakk{\mathopen{[\![}}
\newcommand\rbrakk{\mathclose{]\!]}}
\newcommand\List[1]{\lbrakk#1\rbrakk}  %was \obj
\newcommand\vpile[1]{\begin{array}{c}#1\end{array}}

\let\int=\cap
\let\un=\cup
\let\inter=\bigcap
\let\union=\bigcup

\def\ML{{\sc ml}}
\def\OBJ{{\sc obj}}
\def\AST{{\sc ast}}

\def\LCF{{\tt LCF}\@}
\def\FOL{{\tt FOL}\@}
\def\HOL{{\tt HOL}\@}
\def\LK{{\tt LK}\@}
\def\ZF{{\tt ZF}\@}
\def\CTT{{\tt CTT}\@}
\def\Cube{{\tt Cube}}
\def\Modal{{\tt Modal}}

%macros to change the treatment of symbols
\def\relsemicolon{\mathcode`\;="303B}   %treat ; like a relation
\def\binperiod{\mathcode`\.="213A}   %treat . like a binary operator
\def\binvert{\mathcode`\|="226A}     %treat | like a binary operator

%redefinition of \sloppy and \fussy to use \emergencystretch
\def\sloppy{\tolerance2000 \hfuzz.5pt \vfuzz.5pt \emergencystretch=15pt}
\def\fussy{\tolerance200 \hfuzz.1pt \vfuzz.1pt \emergencystretch=0pt}

%%%% \tt things

\def\ttdescriptionlabel#1{\hspace\labelsep \tt #1}
\def\ttdescription{\list{}{\labelwidth\z@ \itemindent-\leftmargin
       \let\makelabel\ttdescriptionlabel}}

\let\endttdescription\endlist

\chardef\ttilde=`\~     % A tilde for \tt font
\chardef\ttback=`\\     % A backslash for \tt font
\chardef\ttlbrace=`\{   % A left brace for \tt font
\chardef\ttrbrace=`\}   % A right brace for \tt font

\newfont{\sltt}{cmsltt10}     %% for output from terminal sessions
\newcommand\out{\ \sltt}

% "itmath.sty" use cmr italic for letters in math mode and get the
%              usual letter spacing of text mode.
%
% Michael Lawley, April 1993
% (lawley@cit.gu.edu.au)
%
% Derived from itma.sty (of unknown origin).
%
% MATHCODES
%
% The mathcodes for the letters A, ..., Z, a, ..., z are changed to
% generate text italic rather than math italic by default. This makes
% multi-letter identifiers look better. The mathcode for character c
% is set to "7000 (variable class) + "400 (text italic) + c.
%
% For NFSS the mathcode is "7000 (variable class) + (hex)\itfam + c
% \itfam is probably equal to 7.
%

\ifx\undefined\hexnumber@
  \def\hexnumber@#1{\ifcase#1 \z@
  \or \@ne \or \tw@ \or \thr@@
  \or 4\or 5\or 6\or 7\or 8\or
  9\or A\or B\or C\or D\or E\or F\fi}
\fi

\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
        \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
        \advance\count0 by1 \advance\count1 by1 \repeat}}

\edef\@tempa{\hexnumber@\itfam}

\@setmcodes{`A}{`Z}{"7\@tempa 41}
\@setmcodes{`a}{`z}{"7\@tempa 61}

\ifx\define@mathgroup\undefined\else
        \define@mathgroup\mv@normal{\itfam}{cmr}{m}{it}\fi
