\typeout{Document Style `John Wiley Contributed Book Style---Wiley'
<Version Sema1 July 1992>, Copyright (C) 1992, John Wiley & Sons Ltd}

%******************************************
%To set up version number
%******************************************
\def\version{Sema1}

%\@twosidetrue

%******************************************
%To set up type sizes
%******************************************
\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
\abovedisplayskip 10pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus3pt\belowdisplayshortskip 6pt}

\def\footnotesize{\@setsize\footnotesize{9pt}\viiipt\@viiipt
\abovedisplayskip 8pt plus 2pt minus 4pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus 1pt\belowdisplayshortskip 4pt plus 2pt minus 2pt
\def\@listi{\topsep 6pt\parsep0pt
\itemsep \parsep}}

\def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\Tiny{\@setsize\tiny{8pt}\viipt\@viipt}
\def\small{\@setsize\small{11pt}\ixpt\@ixpt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
\def\HUGE{\@setsize\HUGE{40pt}\xxxvipt\@xxxvipt}
\font\chapnofont ps-times-b at 72 truept%cmb10 at 48 truept   %for chapter number
\normalsize 

\def\figsize{\@setsize\figsize{10pt}\ixpt\@ixpt}      %for figures
\def\tabsize{\@setsize\tabsize{10pt}\ixpt\@ixpt}      %for tables
\def\headsize{\@setsize\sectsize{11pt}\ixpt\@ixpt}    % for page header
\def\footsize{\@setsize\sectsize{9pt}\viiipt\@viiipt} % for page footer
\def\sectsize{\raggedright\@setsize\sectsize{12pt}\xipt\@xipt\bf} % for first level heads
\def\subsectsize{\raggedright\@setsize\subsectsize{12pt}\xipt\@xipt\bf} % for second level heads
\def\subsubsectsize{\raggedright\@setsize\subsubsectsize{10pt}\ixpt\@ixpt} % for third level heads
\def\subsubsubsectsize{\raggedright\@setsize\subsubsectsize{12pt}\xpt\@xpt\it} % for fourth level heads
\def\captsize{\@setsize\captsize{10pt}\ixpt\@ixpt}   % for captions
\def\captnosize{\@setsize\captnosize{10pt}\ixpt\@ixpt\bf}   % for caption word and number
\def\chaptitlesize{\raggedright\@setsize\chaptitlesize{28pt}\xxvpt\@xxvpt\bf} % chapter title 
\def\authsize{\raggedright\@setsize\authsize{12pt}\xpt\@xpt\bf}  % author size
\def\refsize{\@setsize\refsize{10pt}\ixpt\@ixpt}     % references

\setcounter{secnumdepth}{3}

%******************************************
%To set up weight of rules
%******************************************
\def\medline{\leaders\hrule height 0.8pt\\}
\def\tspace#1{\noalign{\vskip #1}}
\def\ds{\cr\noalign{\vskip 5pt}}
%to set a rule within a table
\def\tabrule{\noalign{\vskip2pt}
             \noalign{\hrule}
             \noalign{\vskip2pt}}
% thick rule to be used at top and bottom of tables
\def\tabruletop{\noalign{\hrule height3pt depth-2.5pt}\noalign{\vskip2pt}}
\def\tabrulebot{\noalign{\vskip2pt}\noalign{\hrule height3pt depth-2.5pt}}


%*****************************************************
%To establish layout of chapter opening page
%*****************************************************
% to print copyright line at base of first page and to keep page to 45 lines
\def\copyrightline{%
\gdef\@titleandauthor{\footsize Term Graph Rewriting: Theory and Practice, eds. M.R.Sleep, M.J.Plasmeijer and M.C. van Eekelen\hfill}
\gdef\@mycopyright{\copyright 1992 John Wiley \& Sons Ltd}
}

\def\chaptitle#1{\gdef\@chaptitle{#1}}

\def\chaptitlesp{\list{}{\leftmargin0pc}\item[]}
\let\endchaptitlesp=\endlist

\def\makechaptitle{\par
 \begingroup
 \def\@makefnmark{\hbox
 to 0pt{$^{\@thefnmark}$\hss}}
 \if@twocolumn 
 \twocolumn[\@makechaptitle] 
 \else \newpage
 \global\@topnum\z@ \@makechaptitle \fi\thispagestyle{plain}\@thanks
 \endgroup
 \let\makechaptitle\relax
 \let\@makechaptitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@chaptitle{}\let\makechaptitle\relax}

\def\@makechaptitle{\newpage
 \null
 \vspace*{30pt}                
 \begin{chaptitlesp}  
  {\raggedright 
\chapnofont\thechapter\par
  \vspace{30pt}
\chaptitlesize \@chaptitle \par}
  \vspace{24pt}                   
  {\authsize \@author \par}
 \end{chaptitlesp}
\copyrightline 
\vspace{36pt}\noindent\ignorespaces                    
}                 


%*****************************************************
%To set up running head details and copyright line on
%first page of each chapter
%*****************************************************
% chapter title for lefthand pages
\def\chaptitlehead#1{\gdef\@chaptitlehead{#1}}

% author name for righthand pages
\def\authorhead#1{\gdef\@authorhead{#1}}

\def\firstpage#1{%
\setcounter{page}{#1}
\newcounter{pageone}
\setcounter{pageone}{#1}
}

\def\myfootnote{%
\vbox{\footnotesize
\hbox{\vrule height 6pt depth 6pt width0pt}
\ifodd\count202\relax\else\ifnum\thepageone=\thepage%
\hbox to \textwidth{\leaders\hrule height 0.4pt\hfill}%
\fi%
\fi
\hbox to \textwidth{\noindent \@titleandauthor \hfill}
\hbox to \textwidth{\noindent \@mycopyright\hfill}}}

% pagestyle
% the definition of \@oddfoot is to get the page length right 
% after the first page. 
\def\ps@jwcbmcfirst{\let\@mkboth\@gobbletwo%
     \def\@oddhead{}%
     \def\@oddfoot{\myfootnote\global\textheight\ntextheight}%
     \let\@evenfoot\@oddfoot}

\let\ps@empty\ps@jwcbmcfirst
\let\ps@plain\ps@jwcbmcfirst

\def\ps@jwcbmc{\let\@mkboth\@gobbletwo%
     \def\@oddhead{\normalsize\rm{\viiipt\@chaptitlehead}\hfil\xpt}%
     \def\@oddfoot{\sysdetails}
     \def\@evenhead{\normalsize\rm\xpt\viiipt\hfil{\@authorhead}}%
     \let\@evenfoot\@oddfoot}

%********************************************************
%Heading levels (allowing variable spacing above heading)
%********************************************************
\def\sectionchap{\@startsection {section}{1}{\z@}{-1pt}{12pt}{\sectsize}}  %24 above 6 below
\def\section{\@startsection {section}{1}{\z@}{-24pt plus -0.5ex minus -0.5ex}{12pt}{\sectsize}}  %24 above 6 below
\def\subsection{\@startsection{subsection}{2}{\z@}{-18pt plus -0.5ex minus -0.5ex}{6pt}{\subsectsize}}  %18 above, 6 below
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-18pt plus -0.5ex minus -0.5ex}{6pt}{\subsubsectsize}}  %18 above, 6 below
\def\subsubsubsection{\@startsection{subsubsubsection}{4}{\z@}{-18pt plus -0.5ex minus -0.5ex}{6pt}{\subsubsubsectsize}}  %

\def\paragraph{\@startsection
{paragraph}{4}{\z@}{-12pt plus -0.5ex minus -0.5ex}{-1em}{\normalsize\it}}



%*****************************************************
%Output routine
%*****************************************************
\def\@outputpage{\begingroup\catcode`\ =10 
     \let\-\@dischyph \let\'\@acci \let\`\@accii \let\=\@acciii
    \if@specialpage 
     \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
     \if@twoside 
       \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
            \let\@themargin\oddsidemargin
          \else \let\@thehead\@evenhead
          \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
     \fi\fi
     \shipout
     \vbox{\normalsize \baselineskip\z@ \lineskip\z@ 
           \let\par\@@par 
           \vskip \topmargin \moveright\@themargin
           \vbox{\setbox\@tempboxa
                   \vbox to\headheight{\vfil \hbox to\textwidth
                                       {\let\label\@gobble \let\index\@gobble
                                         \@thehead}                                     
                                       } 
                 \dp\@tempboxa\z@
                 \box\@tempboxa
                 \vskip \headsep
                 \box\@outputbox
                 \baselineskip\footskip
                 \hbox to\textwidth{\let\label\@gobble 
                           \let\index\@gobble  
                           \@thefoot}}}\global\@colht\textheight
           \endgroup\stepcounter{page}\let\firstmark\botmark
           }

%*****************************************************
%Page and text dimensions
%*****************************************************
\headheight 24pt \headsep 14pt

\marginparwidth 0pt
\oddsidemargin  0.75 in
\evensidemargin 0.75 in
\marginparsep 0pt

\topmargin   0pt

\newdimen\ftextheight
\newdimen\ntextheight
\textwidth 372pt \ntextheight 564pt
\ftextheight\ntextheight
\advance\ftextheight -24pt

\pagestyle{jwcbmc}

%*****************************************************
%Footnotes
%*****************************************************
\count202=0
\def\footnoterule{\global\advance\count202 by 1\kern-3\p@
  \hrule height 0.4pt\kern 2.2\p@} 

\long\def\@makefntext#1{\ifnum\thefootnote<10\hangindent8pt\else\hangindent10pt\fi
$^{\@thefnmark}$ #1}

%*****************************************************
%Footline system details
%*****************************************************
\newcount\hour
\newcount\minute
\hour=\time
\divide\hour by 60
\minute=\hour
\multiply\minute by 60
\advance\minute by -\time
\minute=-\minute

% print integer as a zero filled 2 digit field
\def\twodigits#1{\ifnum #1 < 10{0#1}\else{#1}\fi}

\def\sysdetails{\hss\number\day/\number\month/\number\year\ %
\twodigits{\number\hour}:\twodigits{\number\minute}\stage\jobname\hss}
\def\stage{\hbox{---PAGE PROOFS for John Wiley \& Sons Ltd (using \version)---}}

\thispagestyle{jwcbmcfirst}
\textheight\ftextheight

%*****************************************************
%To set up figure and table caption style and number
%of floats allowed per page
%*****************************************************
\textfloatsep 6pt                      
\@maxsep 6pt                           

\setcounter{topnumber}{2}
\def\topfraction{1.0}
\setcounter{bottomnumber}{2}
\def\bottomfraction{1.0}
\setcounter{totalnumber}{4}
\def\textfraction{0.125}

\long\def\@makecaption#1#2{
 \vskip 10pt
 \setbox\@tempboxa\hbox{\captsize{\captnosize #1}\quad #2\xpar}  
 \ifdim \wd\@tempboxa >\hsize \unhbox\@tempboxa \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil}
 \fi}

\def\thefigure{\thechapter.\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure \thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\def\thetable{\thechapter.\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table \thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

%*****************************************************
%To set up layout for lists
%*****************************************************
\leftmargini 12pt
\leftmarginii 14pt   
\leftmarginiii 18.7pt 
\leftmarginiv 17pt 
\leftmarginv 10pt
\leftmarginvi 10pt
\leftmargin\leftmargini
\labelsep 6pt
\labelwidth\leftmargini\advance\labelwidth-\labelsep
\def\@listI{\leftmargin\leftmargini
\topsep 8pt plus 2pt minus 4pt}
\let\@listi\@listI
\@listi 
\def\@listii{\leftmargin\leftmarginii
 \labelwidth\leftmarginii\advance\labelwidth-\labelsep
 \topsep 6pt plus 2pt minus 1pt
 \itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
 \topsep 6pt plus 2pt minus 1pt 
 \parsep 0pt %\z@ \partopsep 0pt% plus 0pt minus 1pt
 \itemsep \topsep}
\def\@listiv{\leftmargin\leftmarginiv
 \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
\def\@listv{\leftmargin\leftmarginv
 \labelwidth\leftmarginv\advance\labelwidth-\labelsep}
\def\@listvi{\leftmargin\leftmarginvi
 \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}

%*****************************************************
%To set up style for verse
%*****************************************************
\def\verse{\let\\=\@centercr  
  \list{}{\itemsep\z@ \itemindent -1em\ixpt\baselineskip11pt
  \listparindent \itemindent
          \rightmargin\leftmargin
          \advance\leftmargin 2.25em
          \advance\rightmargin 1.5em}\item[]}
\let\endverse\endlist

%*****************************************************
%To set up style for quotations
%*****************************************************
%   Fills lines; indents paragraph
\def\quotation{\list{}{\listparindent 1em\ixpt\baselineskip11pt
    \itemindent\listparindent
    \rightmargin\leftmargin
    \advance\leftmargin .5em
    \advance\rightmargin .5em\parsep 0pt}\item[]}
\let\endquotation=\endlist

%*****************************************************
%To set up style for quotes
%*****************************************************
%   Fills lines; no paragraph indentation
\def\quote{\list{}{\rightmargin\leftmargin
           \advance\leftmargin .5em
           \advance\rightmargin .5em}\ixpt\baselineskip11pt\item[]}
\let\endquote=\endlist

%*****************************************************
%To set up style for description
%*****************************************************
%  To change the formatting of the label, you must redefine 
%  \descriptionlabel.  

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
       \let\makelabel\descriptionlabel}}

\let\enddescription\endlist

\newdimen\descriptionmargin
\descriptionmargin=3em

%*****************************************************
%To set up bibliography style
%*****************************************************
\def\thebibliography#1{\section*{REFERENCES}
\refsize\list
 {[\arabic{enumi}]}
 {\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000\interlinepenalty=100
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
\def\@biblabel#1{[#1]\hfill}
\def\@cite#1{\thinspace[{#1}]}

%*****************************************************
%To redefine citation style to put spaces after commas
%*****************************************************
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\ }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
\hbox{\csname b@\@citeb\endcsname}}}{#1}}

% here is a useful little macro that lets you access citation numbers
% use it as in \citestr{CiteKey}
\def\citestr#1{\nocite{#1}\csname b@#1\endcsname}

%*****************************************************
%Specials
%*****************************************************
\newcount\lecurrentfam
\def\LaTeX{\lecurrentfam=\the\fam \leavevmode L\raise.42ex
	\hbox{$\fam\lecurrentfam\scriptstyle\kern-.3em A$}\kern-.15em\TeX}
\def\Scribe{{\sl Scribe}}
\def\AmSTeX{$\cal A$\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em
     $\cal S$-\TeX}
\def\BibTeX{{\sc Bib}\TeX}

%*****************************************************
%Initialization
%*****************************************************
\pagenumbering{arabic}     
\onecolumn                  
\parsep=0pt
\parskip=0pt
\parindent=10pt
\itemsep=0pt
\tolerance=5000
\frenchspacing
\let\xpar=\par
\widowpenalty=10000
\clubpenalty=0

%******************************************
%SEMAGRAPH MODIFICATIONS TO WILEY STYLE 31.7.92
%******************************************
\firstpage{1} %needed by Wiley.sty commands, but do not appear
%******************************************
%theorem like environments
%******************************************
\newtheorem{definition}{\mbox{\sc Definition}}[section] 
\newtheorem{example}[definition]{\mbox{\sc Example}}
\newtheorem{remark}[definition]{\mbox{\sc Remark}}
\newtheorem{theorem}[definition]{\mbox{\sc Theorem}}
\newtheorem{lemma}[definition]{\mbox{\sc Lemma}}
\newtheorem{proposition}[definition]{\mbox{\sc Proposition}}

%******************************************
%modifications to counters
%******************************************
\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\theenumii}{\arabic{enumii}}

