%%
%% fuzz.sty
%% Version 2.3
%% Copyright (c) J. M. Spivey 1988, 1991
%%
%% $Id: fuzz209.sty,v 1.1 2002/11/13 13:10:51 mike Exp $
%%

\typeout{Style Option 'fuzz'. Mon Mar 17 16:06:33 1997.}

\def\fuzz{{\large\it f\kern0.1em}{\normalsize\sc uzz}}

%
% 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-character identifiers look better. The mathcode for 'c'
% is set to "7000 (variable family) + "400 (text italic) + c.
%

% \setmcodes{begin}{end}{base} -- assign successive mathcode to
% characters BEGIN thru END, starting at BASE.
\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
  \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
  \advance\count0 by1 \advance\count1 by1 \repeat}}

\@setmcodes{`A}{`Z}{"7441}
\@setmcodes{`a}{`z}{"7461}

%
% COMMON SYMBOLS
%
% Here are some math symbols and conventions that are independent of
% the symbol font.
%

% ~ gives a \, space in math mode
\def~{\ifmmode\,\else\penalty\@M\ \fi}

% Semicolon is active in math mode; it inserts a thick space
\mathcode`\;="8000 % Makes ; active in math mode
{\catcode`\;=\active \gdef;{\mathchar"3B\;}}

% \@myop makes an operator, with a strut to defeat TeX's vertical adjustment.
% (see TeXbook, Appendix G, verse 13, p. 444)
\def\@myop#1{\mathop{\mathstrut{#1}}\nolimits}

% This underscore is a bit wider than the one in Plain, and doesn't
% have the little kern. In math mode, it still suffers from italic
% corrections inserted because a preceding letter is not marked as a
% text symbol (see TeXbook, Appendix G, verse 14, p. 444 and
% verse 17, p. 445). But in such cases, you can write e.g. $"DISK\_POOL"$.
\def\_{\leavevmode \ifmmode\else\kern0.06em\fi \vbox{\hrule width0.5em}}
\mathcode`\"="8000
\def\@kwote#1"{\hbox{\it #1}}
{\catcode`\"=\active \global\let"=\@kwote}

% @ and | are re-defined to produce \spot and \mid.
\mathchardef\spot="320F
\mathcode`\@=\spot
\mathcode`\|=\mid

% \bsup and \esup for superscripts
\def\bsup#1\esup{^{#1}}

% \inrel for underlined relations
\def\inrel#1{\mathrel{\underline{#1}}}

%
% SCHEMAS, Etc.
%
% Here are environments for the various sorts of
% displays which occur in Z documents. All displays are set
% flush left, indented by \zedindent, by default \leftmargini.
% schemas, etc, are made just wide enough to give equal margins
% left and right.
%
% Some environments (schema, etc.) must not be split,
% and others (argue) may be split arbitrarily. All generate alignment
% displays, and penalties are used to control page breaks.
%

% Style parameters
\newdimen\zedindent	\zedindent=\leftmargini
\newdimen\zedleftsep	\zedleftsep=1em
\newdimen\zedtab	\zedtab=2em
\newdimen\zedbar	\zedbar=6em
\newskip\zedskip	\zedskip=0.5\baselineskip plus0.333333\baselineskip
				minus0.333333\baselineskip
\def\zedsize{}

% Internal variables
\newcount\interzedlinepenalty \interzedlinepenalty=10000
\newcount\preboxpenalty \preboxpenalty=0
\newif\ifzt@p		\zt@pfalse

\def\@jot{0.5\zedskip}

\def\@narrow{\advance\linewidth by-\zedindent}

\def\@zrulefill{\leaders\hrule height\arrayrulewidth\hfill}

\def\@topline#1{\hbox to\linewidth{%
  \vrule height\arrayrulewidth width\arrayrulewidth
  \vrule height0pt depth\@jot width0pt
  \hbox to\zedleftsep{\@zrulefill\thinspace}%
  #1\thinspace\@zrulefill}}

\def\@zedline{\omit \vrule height\arrayrulewidth width\linewidth \cr}

\def\where{\@zskip\@jot
  \omit \vrule height\arrayrulewidth width\zedbar \cr
  \@zskip\@jot}

\def\also{\crcr \noalign{\penalty\interdisplaylinepenalty \vskip\zedskip}}
\def\@zskip#1{\crcr \omit \vrule height#1 width\arrayrulewidth \cr}
\def\@zlign{\tabskip\z@skip\everycr{}} % \@lign missing in SliTeX

% This new \t allows braces around numbers 10 and up but doesn't need them
\let\tie=\t
\def\t#1{\afterassignment\@t\count@=#1}
\def\@t{\hskip\count@\zedtab}

% \@setzsize allows size changing in math mode
\def\@setzsize{\let\next=\@nomath\def\@nomath##1{}%
  \skip0=\abovedisplayskip\skip1=\belowdisplayskip
  \zedsize \let\@nomath=\next 
  \abovedisplayskip=\skip0\belowdisplayskip=\skip1}

\def\@zed{\ifvmode\@zleavevmode\fi
  $$\global\zt@ptrue
  \@setzsize
  \advance\linewidth by-\zedindent
  \advance\displayindent by\zedindent
  \def\\{\crcr}% Must have \def and not \let for nested alignments.
  \let\par=\relax
  \tabskip=0pt}

\def\@znoskip{\offinterlineskip
  \everycr={\noalign{\ifzt@p \global\zt@pfalse
    % Simulate interline glue
      \ifdim\prevdepth>-1000pt \skip0=\normalbaselineskip
        \advance\skip0by-\prevdepth \advance\skip0by-\ht\strutbox
        \ifdim\skip0<\normallineskiplimit \vskip\normallineskip
        \else \vskip\skip0 \fi\fi
    \else \penalty\interzedlinepenalty \fi}}}

\def\zed{\@zed\@znoskip\halign to\linewidth\bgroup
  \strut$\@zlign##$\hfil \tabskip=0pt plus1fil\cr}
\def\endzed{\crcr\egroup$$\global\@ignoretrue}

\def\[{\begingroup\zed}
\def\]{\crcr\egroup$$\endgroup\ignorespaces}

\def\axdef{\def\also{\@zskip\zedskip}%
  \predisplaypenalty=\preboxpenalty
  \@zed\@znoskip \halign to\linewidth\bgroup
    \strut \vrule width\arrayrulewidth \hskip\zedleftsep
    $\@zlign##$\hfil \tabskip=0pt plus1fil\cr}
\let\endaxdef=\endzed

\def\schema#1{\@ifnextchar[{\@schema{#1}}{\@nschema{#1}}}
\def\@schema#1[#2]{\@nschema{#1[#2]}}
\def\@nschema#1{\@narrow\axdef \omit\@topline{$\strut#1$}\cr}
\def\endschema{\@zskip\@jot \@zedline \endzed}

\@namedef{schema*}{\@narrow\axdef \@zedline \@zskip\@jot}
\expandafter\let\csname endschema*\endcsname=\endschema

\def\gendef{\@ifnextchar[{\@gendef}{\@ngendef}}
\def\@gendef[#1]{\@narrow\axdef \omit \setbox0=\hbox{$\strut[#1]$}%
  \rlap{\raise\doublerulesep\@topline{\hskip\wd0}}\@topline{\box0}\cr}
\def\@ngendef{\@narrow\axdef \@zedline \omit \hbox to\linewidth{\vrule
  height\doublerulesep width\arrayrulewidth \@zrulefill}\cr \@zskip\@jot}
\let\endgendef=\endschema

\def\argue{\@zed \interzedlinepenalty=\interdisplaylinepenalty
  \openup\@jot \halign to\linewidth\bgroup
    \strut$\@zlign##$\hfil \tabskip=0pt plus1fil
    &\hbox to0pt{\hss[\@zlign##\unskip]}\tabskip=0pt\cr
    \noalign{\vskip-\@jot}}
\let\endargue=\endzed

% \because gives a reason in \argue on a line of its own.
\def\because#1{\noalign{\vskip-\jot}&#1\cr}

\def\syntax{\@zed\@znoskip \halign\bgroup
  \strut$\@zlign##$\hfil &\hfil$\@zlign{}##{}$\hfil
  &$\@zlign##$\hfil\cr}
\let\endsyntax=\endzed

% `infrule' environment: used for inference rules. The horizontal line is
% generated by \derive: an optional argument contains the side-conditions
% of the rule.
\def\infrule{\@zed\@znoskip \halign\bgroup
  \strut\quad$\@zlign##$\quad\hfil&\quad\@zlign##\hfil\cr}
\let\endinfrule=\endzed

\def\derive{\crcr \noalign{\vskip\@jot} \omit\@zrulefill
  \@ifnextchar[{\@xderive}{\@yderive}}
\def\@xderive[#1]{&$\smash{\lower 0.5ex\hbox{$[\;#1\;]$}}$\cr 
  \noalign{\vskip\@jot}}
\def\@yderive{\cr \noalign{\vskip\@jot}}

% \@zleavevmode -- Enter horizontal mode, taking account of possible
% interaction with lists and section heads:
%	1	After a \item, use \indent to get the label (this
%		fails to run in even short labels).
%	2	After a run-in heading, use \indent.
%	3	After an ordinary heading, throw away the \everypar
%		tokens, reset \@nobreak, and use \noindent with \parskip
%		zero. Set \abovedisplayskip to zero.
%	4	Otherwise, use \noindent with \parskip zero
\def\@zleavevmode{\if@inlabel \indent
  \else\if@noskipsec \indent
  \else\if@nobreak \global\@nobreakfalse
      \everypar={}\abovedisplayskip=0pt\fi
    {\parskip=0pt\noindent}\fi\fi}

%
% FONTS
%
% The Z symbol font is loaded.
%

\newfam\oxfam

\ifx\slide\undefined
  % Old-fashioned LaTeX
  \font\fivox=oxsz5
  \font\sixox=oxsz6
  \font\sevox=oxsz7
  \font\egtox=oxsz8
  \font\ninox=oxsz9
  \font\tenox=oxsz10
  \font\elvox=oxsz10 scaled\magstephalf
  \font\twlox=oxsz10 scaled\magstep1
  \font\frtnox=oxsz10 scaled\magstep2
  \font\svtnox=oxsz10 scaled\magstep3
  \font\twtyox=oxsz10 scaled\magstep4
  \font\twfvox=oxsz10 scaled\magstep5

  \@addfontinfo\@vpt{\textfont\oxfam=\fivox
    \scriptfont\oxfam=\fivox \scriptscriptfont\oxfam=\fivox}
  \@addfontinfo\@vipt{\textfont\oxfam=\sixox
    \scriptfont\oxfam=\sixox \scriptscriptfont\oxfam=\sixox}
  \@addfontinfo\@viipt{\textfont\oxfam=\sevox
    \scriptfont\oxfam=\sixox \scriptscriptfont\oxfam=\fivox}
  \@addfontinfo\@viiipt{\textfont\oxfam=\egtox
    \scriptfont\oxfam=\sixox \scriptscriptfont\oxfam=\fivox}
  \@addfontinfo\@ixpt{\textfont\oxfam=\ninox
    \scriptfont\oxfam=\sixox \scriptscriptfont\oxfam=\fivox}
  \@addfontinfo\@xpt{\textfont\oxfam=\tenox
    \scriptfont\oxfam=\sevox \scriptscriptfont\oxfam=\fivox}
  \@addfontinfo\@xipt{\textfont\oxfam=\elvox
    \scriptfont\oxfam=\egtox \scriptscriptfont\oxfam=\sixox}
  \@addfontinfo\@xiipt{\textfont\oxfam=\twlox
    \scriptfont\oxfam=\egtox \scriptscriptfont\oxfam=\sixox}
  \@addfontinfo\@xivpt{\textfont\oxfam=\frtnox
    \scriptfont\oxfam=\tenox \scriptscriptfont\oxfam=\sevox}
  \@addfontinfo\@xviipt{\textfont\oxfam=\svtnox
    \scriptfont\oxfam=\twlox \scriptscriptfont\oxfam=\tenox}
  \@addfontinfo\@xxpt{\textfont\oxfam=\twtyox
    \scriptfont\oxfam=\frtnox \scriptscriptfont\oxfam=\twlox}
  \@addfontinfo\@xxvpt{\textfont\oxfam=\twfvox
    \scriptfont\oxfam=\twtyox \scriptscriptfont\oxfam=\svtnox}
  \@normalsize
\else
  % SliTeX
  \font\fourteenox=oxsz10 scaled\magstep2
  \font\seventeenox=oxsz10 scaled\magstep3
  \font\twentyox=oxsz10 scaled\magstep4
  \font\twentyfourox=oxsz10 scaled\magstep5
  \font\twentynineox=oxsz10 scaled 2986 %\magstep6
  \font\thirtyfourox=oxsz10 scaled 3583 %\magstep7
  \def\@slifontinfo#1#2{{\def\def{\noexpand\def\noexpand}
    \let\rm=\relax \let\it=\relax \let\bf=\relax
    \let\tt=\relax \let\lasy=\relax \let\sc=\relax
    \xdef#1{#1#2}}}
  \@slifontinfo\fourteenpt{\textfont\oxfam=\fourteenox
    \scriptfont\oxfam=\fourteenox \scriptscriptfont\oxfam=\fourteenox}
  \@slifontinfo\seventeenpt{\textfont\oxfam=\seventeenox
    \scriptfont\oxfam=\fourteenox \scriptscriptfont\oxfam=\fourteenox}
  \@slifontinfo\twentypt{\textfont\oxfam=\twentyox
    \scriptfont\oxfam=\seventeenox \scriptscriptfont\oxfam=\fourteenox}
  \@slifontinfo\twentyfourpt{\textfont\oxfam=\twentyfourox
    \scriptfont\oxfam=\twentyox \scriptscriptfont\oxfam=\seventeenox}
  \@slifontinfo\twentyninept{\textfont\oxfam=\twentynineox
    \scriptfont\oxfam=\twentyfourox \scriptscriptfont\oxfam=\twentyox}
  \@slifontinfo\thirtyfourpt{\textfont\oxfam=\thirtyfourox
    \scriptfont\oxfam=\twentynineox \scriptscriptfont\oxfam=\twentyfourox}
  \normalsize
\fi

\edef\@fz{\ifcase\oxfam 0\or 1\or 2\or 3\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}

%
% Z SYMBOLS
%

\let\@mc=\mathchardef

% In the same order as the Z reference manual ...

% Chapter 2
\@mc \lblot	"4\@fz09
\@mc \rblot	"5\@fz0A
\@mc \bind      "2\@fz01

% Chapter 3
\def \defs	{\mathrel{\widehat=}}
\def \power	{\@myop{\mathchar"\@fz0B}}
\let \cross	\times
\def \lambda	{\@myop{\mathchar"115}}
\def \mu	{\@myop{\mathchar"116}}
\@mc \lbag	"4\@fz0E
\@mc \rbag	"5\@fz0F
\def \lnot	{\neg\;}
\@mc \land	"325E
\@mc \lor	"325F
\let \implies	\Rightarrow
\let \iff	\Leftrightarrow
\def \forall	{\@myop{\mathchar"238}}
\def \exists	{\@myop{\mathchar"239}}
\@mc \hide	"326E
\@mc \project	"3\@fz02
\def \pre	{{\rm pre}\;}
\@mc \semi	"3\@fz1C
\@mc \ldata	"4\@fz12
\@mc \rdata	"5\@fz13
\let \shows	\vdash
\def \pipe      {\mathrel{\mathchar"13E\!\!\mathchar"13E}}
\def \LET       {{\bf let}\;}
\def \IF	{{\bf if}\;}
\def \THEN	{\mathrel{\bf then}}
\def \ELSE	{\mathrel{\bf else}}

% Chapter 4
\@mc \emptyset	"0\@fz1E
\@mc \rel	"2\@fz23
\def \dom	{\mathop{\rm dom}}
\def \ran	{\mathop{\rm ran}}
\def \id	{\mathop{\rm id}}
\@mc \comp	"2\@fz1C
\@mc \dres	"2\@fz03
\@mc \rres	"2\@fz04
\@mc \ndres	"2\@fz05
\@mc \nrres	"2\@fz06
\def \inv	{^\sim}
\@mc \limg	"4\@fz10
\@mc \rimg	"5\@fz11
\@mc \pfun	"2\@fz14
\@mc \fun	"2\@fz22
\@mc \pinj	"2\@fz19
\@mc \inj	"2\@fz18
\@mc \psurj	"2\@fz17
\@mc \surj	"2\@fz16
\@mc \bij	"2\@fz1B
\@mc \nat	"0\@fz0D
\@mc \num	"0\@fz1D
\def \div	{\mathbin{\sf div}}
\def \mod	{\mathbin{\sf mod}}
\def \upto	{\mathbin{\ldotp\ldotp}}
\def \plus	{^+}
\def \star	{^*}
\def \finset	{\@myop{\mathchar"\@fz0C}}
\@mc \ffun	"2\@fz15
\@mc \finj	"2\@fz1A
\def \seq	{\mathop{\rm seq}}
\def \iseq	{\mathop{\rm iseq}}
\@mc \cat	"2\@fz1F
\@mc \filter	"2\@fz02
\def \dcat	{\mathop{\cat/}}
\def \bag	{\mathop{\rm bag}}
\def \bcount	{\mathbin{\sharp}}
\@mc \inbag	"3\@fz08
\let \subbageq  \sqsubseteq
\def \disjoint  {{\sf disjoint}\;}
\def \partition {\mathrel{\sf partition}}
\def \prefix    {\mathrel{\sf prefix}}
\def \suffix    {\mathrel{\sf suffix}}
\def \inseq     {\mathrel{\sf in}}
\@mc \extract   "2\@fz20
\@mc \uminus    "2\@fz21
