% VirginiaLake LaTeX macros by Alessio Guglielmi
%
% Many thanks to Ross Moore (Macquarie University) for suggestions leading 
% to \vlupdate

\NeedsTeXFormat{LaTeX2e}%
\ProvidesPackage{virginialake}[2015/08/30 v3.0]
\newif\ifvirginialakeusesxy
        \virginialakeusesxytrue
\DeclareOption{noxy}{\virginialakeusesxyfalse}%
\newif\ifvirginialakegoodsyntax
        \virginialakegoodsyntaxfalse
\DeclareOption{goodsyntax}{\virginialakegoodsyntaxtrue}%
\newif\ifvirginialakelutzsyntax
        \virginialakelutzsyntaxfalse
\DeclareOption{lutzsyntax}{\virginialakelutzsyntaxtrue}%
\ProcessOptions
\@ifclassloaded{beamer}%
               {\RequirePackage{etex}}%
               {}%
\let\circledS\undefined\RequirePackage{amssymb}%
\RequirePackage{stmaryrd}%
\RequirePackage{ifthen}%
\RequirePackage{ifpdf}%
\RequirePackage{etoolbox}%
\newif\ifvirginialakepdflatex\ifpdf\virginialakepdflatextrue\else
                                   \virginialakepdflatexfalse\fi
\@ifpackageloaded{fp-basic}%
                 {\relax}%
                 {\RequirePackage{fp-basic}\FPmessagesfalse}%
\@ifpackageloaded{xcolor}%
                 {\relax}%
                 {\RequirePackage[usenames]{xcolor}}%
\ifvirginialakeusesxy
    \ifvirginialakepdflatex
       \RequirePackage[line,arrow,curve,frame,color,crayon,pdf]{xy}%
       \newxycolor{afbackground}{0 0 0 0.12 cmyk}%
       \makeatletter\renewcommand\xywarning@[1]{\relax}\catcode`@=11
       \W@{}%
       \W@{VirginiaLake Warning: Xy-pic warnings are suppressed in PDF mode.}%
       \W@{}%
    \else
       \RequirePackage[line,arrow,curve,frame,color,crayon,ps,dvips]{xy}%
       \newxycolor@{afbackground}{0 0 0 0.12}{cmyk}{}{}%
   \fi
\fi
\newif\ifetex
\AtBeginDocument{\@ifpackageloaded{etex}{\etextrue}{\etexfalse}}%

%----------------------------------------------------------------------- IFMTARG
% Code from ifmtarg.sty, reproduced below with permission - A.G.
%
% ifmtarg.sty
%
% Provides an if-then-else command for an empty macro argument
% (empty = zero or more spaces only)
% Use as \@ifmtarg{arg1}{Code for arg1 empty}{Code for arg1 not empty}%
%
% author: Peter Wilson (CUA)
%         (now at peter.r.wilson@boeing.com)
% Copyright Peter Wilson, 1996
% Copyright Peter Wilson and Donald Arseneau, 2000
% Released under the LaTeX Project Public License
%
%% Commands by Donald Arseneau
\begingroup
\catcode`\Q=3
\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}%
\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4}%
\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil}%
\endgroup
%---------------------------------------------------------------- END OF IFMTARG

%------------------------------------------------------------ MACROS FOR SYMBOLS

  \newcommand\one{{\mathsf 1}}%
  \newcommand\zer{{\mathsf 0}}%
  \newcommand\fff{{\mathsf f}}%
  \newcommand\ttt{{\mathsf t}}%
  \newcommand\sw {{\mathsf s}}%
  \newcommand\me {{\mathsf m}}%
  \newcommand\iD {{\mathsf i}{\downarrow}}%
  \newcommand\iU {{\mathsf i}{  \uparrow}}%
  \newcommand\cD {{\mathsf c}{\downarrow}}%
  \newcommand\cU {{\mathsf c}{  \uparrow}}%
  \newcommand\wD {{\mathsf w}{\downarrow}}%
  \newcommand\wU {{\mathsf w}{  \uparrow}}%
  \newcommand\qD {{\mathsf q}{\downarrow}}%
  \newcommand\qU {{\mathsf q}{  \uparrow}}%
  \newcommand\BV {{\mathsf {BV}}}%
  \newcommand\SBV{{\mathsf{SBV}}}%
  \newcommand\KS {{\mathsf {KS}}}%
  \newcommand\SKS{{\mathsf{SKS}}}%

%---------------------------------------------------------------- END OF SYMBOLS

%------------------------------------------------ MACROS FOR FORMULAE/STRUCTURES

\newif\ifvlsmallops\vlsmallopsfalse

\newcommand\vlbin[1]{\ifvlsmallops\mathchoice
      {\mathbin{\raise.2ex \hbox{$\scriptstyle      #1$}}}%
      {\mathbin{\raise.2ex \hbox{$\scriptstyle      #1$}}}%
      {\mathbin{\raise.12ex\hbox{$\scriptscriptstyle#1$}}}%
      {\mathbin{           \hbox{$\scriptscriptstyle#1$}}}\else\mathbin{#1}\fi}%

\newif\ifvllinear\vllinearfalse

\newcommand{\vlor}{\ifvllinear\vlbin\varoplus\else\vlbin\vee\fi}%

\newcommand{\vlan}{\ifvllinear\vlbin\binampersand\else\vlbin\wedge\fi}%

\newcommand{\vlpa}{\vlbin\bindnasrepma}%

\newcommand{\vlte}{\vlbin\varotimes}%

\newcommand{\vlse}{\vlbin\triangleleft}%

\newcommand{\vlim}{\vlbin\to}%

\newcommand{\vlli}{\vlbin\multimap}%

\newcommand{\vlmi}{\vlbin\leftarrow}%

\newcommand{\vldi}{\vlbin\leftrightarrow}%

\newcommand{\vlne}{\vlbin\neg}%

\newcommand{\vljm}{\vlbin\supset}%

\newcommand{\vlmj}{\vlbin\subset}%

\newcommand{\vlgoodsyntax}{%
   \def\vlleftparbracket   {\ifvirginialakesmallbrackets[\else
                                       \mathopen{}\left [\fi}%
   \def\vlrightparbracket  {\ifvirginialakesmallbrackets]\else
                                                  \right]\mathclose{}\fi}%
   \let\vlleftparbracketex \vlleftparbracket
   \let\vlrightparbracketex\vlrightparbracket
   \let\vlleftparbracketcn \vlleftparbracket
   \let\vlrightparbracketcn\vlrightparbracket
   \def\vlleftcopbracket   {\ifvirginialakesmallbrackets(\else
                                       \mathopen{}\left (\fi}%
   \def\vlrightcopbracket  {\ifvirginialakesmallbrackets)\else
                                                  \right)\mathclose{}\fi}%
   \let\vlleftcopbracketex \vlleftcopbracket
   \let\vlrightcopbracketex\vlrightcopbracket
   \let\vlleftcopbracketcn \vlleftcopbracket
   \let\vlrightcopbracketcn\vlrightcopbracket
   \def\vlleftseqbracket   {\ifvirginialakesmallbrackets\langle\else
                                        \mathopen{}\left\langle\fi}%
   \def\vlrightseqbracket  {\ifvirginialakesmallbrackets\rangle\else
                                                  \right\rangle\mathclose{}\fi}%
   \let\vlleftseqbracketex \vlleftseqbracket
   \let\vlrightseqbracketex\vlrightseqbracket
   \let\vlleftseqbracketcn \vlleftseqbracket
   \let\vlrightseqbracketcn\vlrightseqbracket
   \def\vldsaaux{\ifx\vlxspacetmp\vldsa\vlx\vlx\vlx\togglexspacefalse\else
                  \iftogglexspace\vlx\else\togglexspacetrue\fi\fi}%
   \def\vldsa{\futurelet\vlxspacetmp\vldsaaux}%
   \def\vlcsaaux{\ifx\vlxspacetmp\vlcsa\vlx\vlx\vlx\togglexspacefalse\else
                  \iftogglexspace\vlx\else\togglexspacetrue\fi\fi}%
   \def\vlcsa{\futurelet\vlxspacetmp\vlcsaaux}%
   \def\vldsmaux{\ifx\vlxspacetmp\vldsm\vlx\vlx\vlx\togglexspacefalse\else
                  \iftogglexspace\vlx\else\togglexspacetrue\fi\fi}%
   \def\vldsm{\futurelet\vlxspacetmp\vldsmaux}%
   \def\vlcsmaux{\ifx\vlxspacetmp\vlcsm\vlx\vlx\vlx\togglexspacefalse\else
                  \iftogglexspace\vlx\else\togglexspacetrue\fi\fi}%
   \def\vlcsm{\futurelet\vlxspacetmp\vlcsmaux}%
   \def\vlnsmaux{\ifx\vlxspacetmp\vlnsm\vlx\vlx\vlx\togglexspacefalse\else
                  \iftogglexspace\vlx\else\togglexspacetrue\fi\fi}%
   \def\vlnsm{\futurelet\vlxspacetmp\vlnsmaux}%
   \let\vldots=\dots}%

\newcommand{\vlx}{\;}%

\newif\iftogglexspace\togglexspacetrue

\newcommand{\vlsetoperators}{%
   \def\vldsaaux{\ifx\vlxspacetmp\vldsa\vlx\vlor\vlx\togglexspacefalse\else
                  \iftogglexspace\vlor\else\togglexspacetrue\fi\fi}%
   \def\vldsa{\futurelet\vlxspacetmp\vldsaaux}%
   \def\vlcsaaux{\ifx\vlxspacetmp\vlcsa\vlx\vlan\vlx\togglexspacefalse\else
                  \iftogglexspace\vlan\else\togglexspacetrue\fi\fi}%
   \def\vlcsa{\futurelet\vlxspacetmp\vlcsaaux}%
   \def\vldsmaux{\ifx\vlxspacetmp\vldsm\vlx\vlpa\vlx\togglexspacefalse\else
                  \iftogglexspace\vlpa\else\togglexspacetrue\fi\fi}%
   \def\vldsm{\futurelet\vlxspacetmp\vldsmaux}%
   \def\vlcsmaux{\ifx\vlxspacetmp\vlcsm\vlx\vlte\vlx\togglexspacefalse\else
                  \iftogglexspace\vlte\else\togglexspacetrue\fi\fi}%
   \def\vlcsm{\futurelet\vlxspacetmp\vlcsmaux}%
   \def\vlnsmaux{\ifx\vlxspacetmp\vlnsm\vlx\vlse\vlx\togglexspacefalse\else
                  \iftogglexspace\vlse\else\togglexspacetrue\fi\fi}%
   \def\vlnsm{\futurelet\vlxspacetmp\vlnsmaux}%
   \let\vldots=\cdots}%

\newcommand{\vllutzsyntax}{%
   \def\vlleftparbracket   {\ifvirginialakesmallbrackets[\else
                                       \mathopen{}\left [\fi}%
   \def\vlrightparbracket  {\ifvirginialakesmallbrackets]\else
                                                  \right]\mathclose{}\fi}%
   \let\vlleftparbracketex \relax
   \let\vlrightparbracketex\relax
   \let\vlleftparbracketcn \{
   \let\vlrightparbracketcn\}%
   \def\vlleftcopbracket   {\ifvirginialakesmallbrackets(\else
                                       \mathopen{}\left (\fi}%
   \def\vlrightcopbracket  {\ifvirginialakesmallbrackets)\else
                                                  \right)\mathclose{}\fi}%
   \let\vlleftcopbracketex \relax
   \let\vlrightcopbracketex\relax
   \let\vlleftcopbracketcn \{
   \let\vlrightcopbracketcn\}%
   \def\vlleftseqbracket   {\ifvirginialakesmallbrackets\langle\else
                                        \mathopen{}\left\langle\fi}%
   \def\vlrightseqbracket  {\ifvirginialakesmallbrackets\rangle\else
                                                  \right\rangle\mathclose{}\fi}%
   \let\vlleftseqbracketex \relax
   \let\vlrightseqbracketex\relax
   \let\vlleftseqbracketcn \{
   \let\vlrightseqbracketcn\}%
   \vlsetoperators
   \vlsmallopstrue}%

\newcommand{\vlnogoodsyntax}{%
   \def\vlleftparbracket   {\ifvirginialakesmallbrackets(\else
                                       \mathopen{}\left (\fi}%
   \def\vlrightparbracket  {\ifvirginialakesmallbrackets)\else
                                                  \right)\mathclose{}\fi}%
   \let\vlleftparbracketex \relax
   \let\vlrightparbracketex\relax
   \let\vlleftparbracketcn \{
   \let\vlrightparbracketcn\}%
   \let\vlleftcopbracket   \vlleftparbracket
   \let\vlrightcopbracket  \vlrightparbracket
   \let\vlleftcopbracketex \relax
   \let\vlrightcopbracketex\relax
   \let\vlleftcopbracketcn \{
   \let\vlrightcopbracketcn\}%
   \let\vlleftseqbracket   \vlleftparbracket
   \let\vlrightseqbracket  \vlrightparbracket
   \let\vlleftseqbracketex \relax
   \let\vlrightseqbracketex\relax
   \let\vlleftseqbracketcn \{
   \let\vlrightseqbracketcn\}%
   \vlsetoperators}%

\ifvirginialakegoodsyntax
   \vlgoodsyntax
\else
   \ifvirginialakelutzsyntax
      \vllutzsyntax
   \else
      \vlnogoodsyntax
   \fi
\fi

\newif\ifvirginialakesmallbrackets\virginialakesmallbracketsfalse

\newcommand{\vlsmallbrackets}{\virginialakesmallbracketstrue}%

\newcommand{\vlnosmallbrackets}{\virginialakesmallbracketsfalse}%

\newcommand{\vlprepstructuresaux}{\catcode`.=\active
                                  \catcode`;=\active
                                  \catcode`[=\active
                                  \catcode`]=\active
                                  \catcode`(=\active
                                  \catcode`)=\active
                                  \catcode`<=\active
                                  \catcode`>=\active
                                  \catcode`-=\active}%

\newcommand{\lt}{<}%
\newcommand{\gt}{>}%

\let\vldot  .
\let\vlscol ;
\let\vlsqbrl[
\let\vlsqbrr]
\let\vlrobrl(
\let\vlrobrr)
\let\vlanbrl<
\let\vlanbrr>
\let\vlminus-

\newif\ifvirginialakestructuressyntax\virginialakestructuressyntaxtrue

\newcommand{\vlnostructuressyntax}{\virginialakestructuressyntaxfalse}%

\newcommand{\vlgobble}[1]{}%

{%--------------------------------------
\vlprepstructuresaux

\gdef\vlnos{\let.\vldot
            \let;\vlscol
            \let[\vlsqbrl
            \let]\vlsqbrr
            \let(\vlrobrl
            \let)\vlrobrr
            \let<\vlanbrl
            \let>\vlanbrr
            \let-\vlminus}%

\gdef\vlprepstructures{\ifvirginialakestructuressyntax
                          \vlprepstructuresaux\vlnos\fi}%

\gdef\vlparopen  {\vlleftparbracket  \bgroup\catcode`.=\active\let.\vldsa
                                            \catcode`;=\active\let;\vldsm
                                            \catcode`]=\active\let]\vlparclose}%

\gdef\vlparopenex{\vlleftparbracketex\bgroup\catcode`.=\active\let.\vldsa
                                            \catcode`;=\active\let;\vldsm\vlsbr
                                          \catcode`]=\active\let]\vlparcloseex}%

\gdef\vlparopencn{\vlleftparbracketcn\bgroup\catcode`.=\active\let.\vldsa
                                            \catcode`;=\active\let;\vldsm\vlsbr
                                          \catcode`]=\active\let]\vlparclosecn}%

\gdef\vlcopopen  {\vlleftcopbracket  \bgroup\catcode`.=\active\let.\vlcsa
                                            \catcode`;=\active\let;\vlcsm
                                            \catcode`)=\active\let)\vlcopclose}%

\gdef\vlcopopenex{\vlleftcopbracketex\bgroup\catcode`.=\active\let.\vlcsa
                                            \catcode`;=\active\let;\vlcsm\vlsbr
                                          \catcode`)=\active\let)\vlcopcloseex}%

\gdef\vlcopopencn{\vlleftcopbracketcn\bgroup\catcode`.=\active\let.\vlcsa
                                            \catcode`;=\active\let;\vlcsm\vlsbr
                                          \catcode`)=\active\let)\vlcopclosecn}%

\gdef\vlseqopen  {\vlleftseqbracket  \bgroup\catcode`;=\active\let;\vlnsm
                                            \catcode`>=\active\let>\vlseqclose}%

\gdef\vlseqopenex{\vlleftseqbracketex\bgroup\catcode`;=\active\let;\vlnsm\vlsbr
                                          \catcode`>=\active\let>\vlseqcloseex}%

\gdef\vlseqopencn{\vlleftseqbracketcn\bgroup\catcode`;=\active\let;\vlnsm\vlsbr
                                          \catcode`>=\active\let>\vlseqclosecn}%

\gdef\vls  {\catcode`[=\active\let[\vlparopenex
            \catcode`(=\active\let(\vlcopopenex
            \catcode`<=\active\let<\vlseqopenex
            \catcode`-=\active\let-\bar
            \odframefirstfalse
            \odbackgroundfirstfalse}%

\gdef\vlsbr{\catcode`[=\active\let[\vlparopen
            \catcode`(=\active\let(\vlcopopen
            \catcode`<=\active\let<\vlseqopen
            \catcode`-=\active\let-\bar
            \odframefirstfalse
            \odbackgroundfirstfalse}%

\gdef\vlscn{\catcode`[=\active\let[\vlparopencn
            \catcode`(=\active\let(\vlcopopencn
            \catcode`<=\active\let<\vlseqopencn
            \catcode`-=\active\let-\bar
            \odframefirstfalse
            \odbackgroundfirstfalse}%

\gdef\vlupdate #1{
   \expandafter\let\csname\expandafter\vlgobble\string #1vltemp\endcsname #1
   \def #1{\bgroup\vlprepstructures
     \csname\expandafter\vlgobble\string #1vlaux\endcsname}%
   \expandafter\def\csname\expandafter\vlgobble\string #1vlaux\endcsname ##1{%
      \csname\expandafter\vlgobble\string #1vltemp\endcsname{##1}\egroup}}%
}%--------------------------------------

\newcommand{\vlparclose  }{\egroup\vlrightparbracket  }%

\newcommand{\vlparcloseex}{\egroup\vlrightparbracketex}%

\newcommand{\vlparclosecn}{\egroup\vlrightparbracketcn}%

\newcommand{\vlcopclose  }{\egroup\vlrightcopbracket  }%

\newcommand{\vlcopcloseex}{\egroup\vlrightcopbracketex}%

\newcommand{\vlcopclosecn}{\egroup\vlrightcopbracketcn}%

\newcommand{\vlseqclose  }{\egroup\vlrightseqbracket  }%

\newcommand{\vlseqcloseex}{\egroup\vlrightseqbracketex}%

\newcommand{\vlseqclosecn}{\egroup\vlrightseqbracketcn}%

\newcommand{\vlhole}{\{\kern.3em\}}%

\newcommand{\vlstore}{\bgroup\vlprepstructures\afterassignment\egroup
                      \global\def\vlread}%

%----------------------------------------- END OF MACROS FOR FORMULAE/STRUCTURES

%-------------------------------------------------------- MACROS FOR DERIVATIONS
%
%                                                   +-------+--------+-------+
%                                                   |  dcl  |  dcc   |  dcr  |
%                                                   +-------+--------+-------+
%                                                       +---+        +---+
%                                                       | l |--------| m |
%                                                       +---+        +---+
%                                                             +----+
%                                                             | dc |
%                                                             +----+
%                                                   <---dl--->      <---dr--->
%

\newdimen\dercldim                                % dcl
\newdimen\derccdim                                % dcc
\newdimen\dercrdim                                % dcr
\newdimen\derdim                                  % d
\newdimen\derdldim                                % ddl
\newdimen\derdrdim                                % ddr
\newbox\derboxtwo                                 % b2
\newbox\derboxthree                               % b3
\newbox\derboxfour                                % b4
\newdimen\derquad
\newdimen\deropen
\newbox\stembox

\newcount\vlsavederboxonec
%\newcount\vlsavederdimc
\newcount\vldummycount

% THE FOLLOWING IS VERY DANGEROUS: WE ARE CREATING A 'VIRTUAL MEMORY MANAGER'
% FOR \derboxone, \derldim, \dercdim AND \derrdim, IN PARTICULAR BY USING
% \count11 AND \count14. ETEX MIGHT INTERFERE WITH THIS STUFF. START FROM 
% HERE IF YOU SEE SOMETHING ODD SUCH AS DUPLICATION OR MISPLACEMENT OF BOXES IN 
% DERIVATIONS

\newcommand{\vlderivationinitaux}{%
   \newbox\derboxone                              % b1
   \setbox\derboxone=\hbox{}%
   \vlsavederboxonec=\derboxone
%   \vlsavederdimc=\count11\advance\vlsavederdimc by1%
   \newdimen\derldim                              % dl
   \newdimen\dercdim                              % dc
   \newdimen\derrdim}%                            % dr

\newcommand{\vlderivationinit}{\bgroup
   \vlprepstructures\vlderivationinitaux}%

\newcommand{\vlderivationterm}{\egroup
   \global\chardef\derboxone=\vlsavederboxonec
   \ifetex
      \ifnum\count264>256
         \global\advance\count264 by-1
      \else
         \global\advance\count14 by-1
      \fi
   \else\global\advance\count14 by-1
   \fi
   \ifetex
      \ifnum\count261>258
         \global\advance\count261 by-3
      \else
         \ifnum\count261>257
            \global\advance\count261 by-2
            \global\advance\count11  by-1
         \else
            \ifnum\count261>256
               \global\advance\count261 by-1
               \global\advance\count11  by-2
            \else
               \global\advance\count11 by-3
            \fi
         \fi
      \fi
   \else\global\advance\count11 by-3
   \fi
%   \global\dimendef\derldim=\vlsavederdimc
%   \global\advance\vlsavederdimc by1%
%   \global\dimendef\dercdim=\vlsavederdimc
%   \global\advance\vlsavederdimc by1%
%   \global\dimendef\derrdim=\vlsavederdimc
%   \global\advance\vlsavederdimc by-2
   }%

\newcommand{\vlderivationaux}[1]{#1\vcenter{\box\derboxone}\vlderivationterm}%

\newcommand{\vlderivation}{\vlderivationinit\vlderivationaux}%

\newcommand{\vlhyaux}[1]{\global\setbox\derboxone=\hbox{#1}%
   \global\derldim=0pt%                           % dl=0
   \global\dercdim=\wd\derboxone                  % dc=wd(b1)
   \global\derrdim=0pt%                           % dr=0
   }%

\newbox\vlhybox
\newcommand{\vlhy}[1]{\global\setbox\vlhybox=\hbox{\strut$#1$}%
   \vlhyaux{\box\vlhybox}}%

\newcommand{\vlstemaux}{\dercldim=\derldim
                        \derccdim=\dercdim
                        \dercrdim=\derrdim}%

\newcommand{\vldaux}[6]{\setbox\derboxtwo=\hbox{\unhbox\derboxone}%
                                                  % b2=b1
   \setbox\derboxthree=\hbox{$#1$}%               % b3; l=wd(b3)
   \setbox\derboxfour =\hbox{$#2$}%               % b4; m=wd(b4)
   #3                                             % dl=0, dc=wd(b1), dr=0
   \derdim=\dercdim\advance\derdim by-\derccdim\divide\derdim by2%
                                                  % d=(dc-dcc)/2
   \global\derldim=\dercldim\global\advance\derldim by-\derdim
                                                  % dl=dcl-d
   \global\derrdim=\dercrdim\global\advance\derrdim by-\derdim
                                                  % dr=dcr-d
   \deropen=\fontdimen5\textfont2\divide\deropen by3%
   \setbox\derboxone=\hbox{\vbox{\offinterlineskip
         \hbox{\ifdim\derldim<0pt\kern-\derldim\fi
               \box\derboxtwo
               \ifdim\derrdim<0pt\kern-\derrdim\fi}%
         #4%
         \hbox{\ifdim\dercldim>\derldim
                  \ifdim\derldim>0pt\kern\derldim\fi
                  \else\kern\dercldim\fi
               \hbox to0pt{\hss\copy\derboxthree}%
               \vbox{\ifdim\derccdim>\dercdim\hsize=\derccdim
                                        \else\hsize=\dercdim \fi
                    #5}%
               \hbox to0pt{\copy\derboxfour\hss}%
               \ifdim\dercrdim>\derrdim
                  \ifdim\derrdim>0pt\kern\derrdim\fi
                  \else\kern\dercrdim\fi}%
         #6%
         \hbox{\ifdim\derldim>0pt\kern\derldim\fi
               \box\derboxone
               \ifdim\derrdim>0pt\kern\derrdim\fi}}}%
   \ifdim\derldim<0pt\global\derldim=0pt\fi       % dl=max(dl,0)
   \ifdim\derrdim<0pt\global\derrdim=0pt\fi       % dr=max(dr,0)
   \derdldim=\wd\derboxthree\advance\derdldim by-\dercldim
                                                  % ddl=l-dcl
   \derdrdim=\wd\derboxfour \advance\derdrdim by-\dercrdim
                                                  % ddr=m-dcr
   \ifdim\derdim<0pt%
      \ifdim\derdldim<0pt%
         \derdldim=0pt%                           % d<0, ddl<0 -> ddl=0
      \fi
      \ifdim\derdrdim<0pt%
         \derdrdim=0pt%                           % d<0, ddr<0 -> ddr=0
      \fi
   \else
      \ifdim\derldim>0pt%
         \ifdim\derdldim>-\derdim
            \advance\derdldim by\derdim           % d>=0, dl>0, ddl+d>0 -> 
         \else                                    %                    ddl=ddl+d
            \derdldim=0pt%                        % d>=0, dl>0, ddl+d<=0 ->
         \fi                                      %                        ddl=0
      \else
         \advance\derdldim by\dercldim            % d>=0, dl=0 -> ddl=ddl+dcl
      \fi
      \ifdim\derrdim>0pt%
         \ifdim\derdrdim>-\derdim
            \advance\derdrdim by\derdim           % d>=0, dr>0, ddr+d>0 -> 
         \else                                    %                    ddr=ddr+d
            \derdrdim=0pt%                        % d>=0, dr>0, ddr+d<=0 ->
         \fi                                      %                        ddr=0
      \else
         \advance\derdrdim by\dercrdim            % d>=0, dr=0 -> ddr=ddr+dcr
      \fi
   \fi
   \global\setbox\derboxone=\hbox
      {\kern\derdldim\unhbox\derboxone\kern\derdrdim}%
   \global\advance\derldim by\derdldim            % dl=dl+ddl
   \global\advance\derrdim by\derdrdim            % dr=dr+ddr
   }%

\newcommand{\vlstemraux }[4]{{#4}\vlstemaux\vldaux
   {\scriptstyle #1}%
   {\scriptstyle #2}%
   {\vlhyaux{#3}}%
   {\kern-\deropen\kern-\ht\strutbox\kern-\dp\strutbox}%
   {\hbox{$\vcenter{\vbox{\offinterlineskip
                    \hbox{$\copy\stembox$}}}$}}%
   {\kern-\deropen}}%

\newcommand{\vlstemrraux}[4]{{#4}\vlstemaux\vldaux
   {\scriptstyle #1}%
   {\scriptstyle #2}%
   {\vlhy{#3}}%
   {\kern\deropen}%
   {\hbox{\hfil}}%
   {\kern\deropen}}%

\newif\ifvlsmallleftlabels\vlsmallleftlabelstrue

\newcommand{\vlnosmallleftlabels}{\vlsmallleftlabelsfalse}%

\newcommand{\vlsmallleftlabels}{\vlsmallleftlabelstrue}%

\newcommand{\vlleftlabel }[1]{\@ifnotmtarg{#1}{\ifvlsmallleftlabels
                               \scriptstyle\fi #1\;}\relax}%

\newcommand{\vlrightlabel}[1]{\@ifnotmtarg{#1}{\;#1}\relax}%

\newdimen\vlstemheight\vlstemheight=8pt%

\newcommand{\vlvruler}{\hbox{\vrule width .6pt height \vlstemheightc sp
                             \kern1.2pt
                             \vrule width .6pt height \vlstemheightc sp}}%

\newcount\vlstemheightc

\newcommand{\vldf}[5]{\vldummycount=\vlstemheight
                      \FPmul\vlstemheightc{\the\vldummycount}{#5}%
   \setbox\stembox=\vbox to \vlstemheightc sp{\vlvruler}%
   \vlstemrraux{                }{                 }{#3              }  {%
   \vlstemraux {\vlleftlabel{#1}}{\vlrightlabel{#2}}{\kern\wd\stembox} {%
   \vlstemrraux{                }{                 }{\kern\wd\stembox}{%
   #4                                                                 }}}}%

\newcommand{\vlde}[4]{\vldf{#1}{#2}{#3}{#4}1}%

\newcommand{\vldd}[4]{\vldf{#1}{#2}{#3}{#4}2}%

\newcommand{\vlpf}[4]{\vldf{#1}{#2}{#3}%
   {\vlhyaux{\vbox to0pt{\vss\kern3pt\hrule width4.2pt\vss}}}{#4}}%

\newcommand{\vlpr}[3]{\vlpf{#1}{#2}{#3}1}%

\newcommand{\vlpd}[3]{\vlpf{#1}{#2}{#3}2}%

\newcommand{\vlproofaux}[4]{\vlderivationaux{\vlpf{#2}{#3}{#4}{#1}}}%

\newcommand{\vlproof }{\vlderivationinit\vlproofaux1}%

\newcommand{\vlproofd}{\vlderivationinit\vlproofaux2}%

\newcommand{\vlderaux}[5]{\vlderivationaux{\vldf{#2}{#3}{#4}{\vlhy{#5}}{#1}}}%

\newcommand{\vlder }{\vlderivationinit\vlderaux1}%

\newcommand{\vlderd}{\vlderivationinit\vlderaux2}%

\newcommand{\vlhruler}{\vfill\hbox to\hsize{\hrulefill}\vfill}%

\newcommand{\vlhhruler}{\vfill
                        \hbox to\hsize{\hrulefill}%
                        \kern1pt
                        \hbox to\hsize{\hrulefill}%
                        \vfill}%

\newcommand{\vlhdotter}{\vfill
   \hbox to\hsize{\cleaders\vbox to0pt{\vss
       \hbox{\kern-.35pt$.$\kern-.35pt}\vss}\hskip\hsize}\vfill}%

\newcommand{\vldsinaux}[3]{\vldaux
   {\smash{\ifvlsmallleftlabels\lower\fontdimen22\scriptfont2%
                          \else\lower\fontdimen22\textfont2\fi
                                       \hbox{$\vlleftlabel {#1}$}}}%
   {\smash{\lower\fontdimen22\textfont2\hbox{$\vlrightlabel{#2}$}}}%
   {\vlhy{#3}}%
   {\kern\deropen}%
   {\vbox to.4pt{\vlhruler}}%
   {\kern\deropen}}%

\newcommand{\vldsidaux}[3]{\vldaux
   {\smash{\ifvlsmallleftlabels\lower\fontdimen22\scriptfont2%
                          \else\lower\fontdimen22\textfont2\fi
                                       \hbox{$\vlleftlabel {#1}$}}}%
   {\smash{\lower\fontdimen22\textfont2\hbox{$\vlrightlabel{#2}$}}}%
   {\vlhy{#3}}%
   {\kern\deropen}%
   {\vbox to.4pt{\vlhdotter}}%
   {\kern\deropen}}%

\newdimen\vldsiqdimenleft
\newdimen\vldsiqdimenright

\newcommand{\vldsiqaux}[3]{\ifvlsmallleftlabels
                                \vldsiqdimenleft=\fontdimen22\scriptfont2%
                           \else\vldsiqdimenleft=\fontdimen22\textfont2\fi
                           \advance\vldsiqdimenleft  by-.7pt%
                           \vldsiqdimenright=\fontdimen22\textfont2%
                           \advance\vldsiqdimenright by-.7pt%
   \vldaux
   {\smash{\lower\vldsiqdimenleft \hbox{$\vlleftlabel {#1}$}}}%
   {\smash{\lower\vldsiqdimenright\hbox{$\vlrightlabel{#2}$}}}%
   {\vlhy{#3}}%
   {\kern\deropen\kern-.7pt}%
   {\vbox to1.8pt{\vlhhruler}}%
   {\kern\deropen\kern-.7pt}}%

\newbox\derboxin
\newdimen\derboxinwidth

\newcommand{\vliaux}[2]{#2%
   \dercldim=\derldim
   \derccdim=\dercdim
   \dercrdim=\derrdim
   \setbox\derboxin=\hbox{$#1$}%
   \derboxinwidth=1em\advance\derboxinwidth by-\wd\derboxin
   \ifdim\derboxinwidth>0pt\divide\derboxinwidth by2\else\derboxinwidth=0pt\fi}%

\newcommand{\vlin}[4]{\vliaux{#3}{#4}%
   \vldsinaux{#1}{#2}{\kern\derboxinwidth\box\derboxin\kern\derboxinwidth}}%

\newcommand{\vlid}[4]{\vliaux{#3}{#4}%
   \vldsidaux{#1}{#2}{\kern\derboxinwidth\box\derboxin\kern\derboxinwidth}}%

\newcommand{\vliq}[4]{\vliaux{#3}{#4}%
   \vldsiqaux{#1}{#2}{\kern\derboxinwidth\box\derboxin\kern\derboxinwidth}}%

\newcommand{\vliiaux}[2]{\derquad=\fontdimen6\textfont2%
   {#1}%
           \dercldim  =\derldim
           \derccdim  =\dercdim
   \setbox\derboxtwo=\hbox{\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad
   {#2}%
   \setbox\derboxone=\hbox{\unhbox\derboxtwo\unhbox\derboxone}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
           \dercrdim  =\derrdim}%

\newcommand{\vliin}[5]{\vliiaux{#4}{#5}\vldsinaux{#1}{#2}{#3}}%

\newcommand{\vliid}[5]{\vliiaux{#4}{#5}\vldsidaux{#1}{#2}{#3}}%

\newcommand{\vliiq}[5]{\vliiaux{#4}{#5}\vldsiqaux{#1}{#2}{#3}}%

\newcommand{\vldsauxx}{\setbox\derboxtwo=\hbox
   {\unhbox\derboxtwo\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad}%

\newcommand{\vldsiiiaux}[3]{\derquad=\fontdimen6\textfont2%
   {#1}%
           \dercldim  =\derldim
           \derccdim  =\dercdim
   \setbox\derboxtwo=\hbox{\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad
   {#2}\vldsauxx
   {#3}%
   \setbox\derboxone=\hbox{\unhbox\derboxtwo\unhbox\derboxone}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
           \dercrdim  =\derrdim}%

\newcommand{\vliiin}[6]{\vldsiiiaux{#4}{#5}{#6}\vldsinaux{#1}{#2}{#3}}%

\newcommand{\vliiid}[6]{\vldsiiiaux{#4}{#5}{#6}\vldsidaux{#1}{#2}{#3}}%

\newcommand{\vliiiq}[6]{\vldsiiiaux{#4}{#5}{#6}\vldsiqaux{#1}{#2}{#3}}%

\newcommand{\vldsiiiiaux}[4]{\derquad=\fontdimen6\textfont2%
   {#1}%
           \dercldim  =\derldim
           \derccdim  =\dercdim
   \setbox\derboxtwo=\hbox{\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad
   {#2}\vldsauxx
   {#3}\vldsauxx
   {#4}%
   \setbox\derboxone=\hbox{\unhbox\derboxtwo\unhbox\derboxone}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
           \dercrdim  =\derrdim}%

\newcommand{\vliiiin}[7]{\vldsiiiiaux{#4}{#5}{#6}{#7}\vldsinaux{#1}{#2}{#3}}%

\newcommand{\vliiiid}[7]{\vldsiiiiaux{#4}{#5}{#6}{#7}\vldsidaux{#1}{#2}{#3}}%

\newcommand{\vliiiiq}[7]{\vldsiiiiaux{#4}{#5}{#6}{#7}\vldsiqaux{#1}{#2}{#3}}%

\newcommand{\vldsiiiiiaux}[5]{\derquad=\fontdimen6\textfont2%
   {#1}%
           \dercldim  =\derldim
           \derccdim  =\dercdim
   \setbox\derboxtwo=\hbox{\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad
   {#2}\vldsauxx
   {#3}\vldsauxx
   {#4}\vldsauxx
   {#5}%
   \setbox\derboxone=\hbox{\unhbox\derboxtwo\unhbox\derboxone}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
           \dercrdim  =\derrdim}%

\newcommand{\vliiiiin}[8]{\vldsiiiiiaux{#4}{#5}{#6}{#7}{#8}%
                          \vldsinaux{#1}{#2}{#3}}%

\newcommand{\vliiiiid}[8]{\vldsiiiiiaux{#4}{#5}{#6}{#7}{#8}%
                          \vldsidaux{#1}{#2}{#3}}%

\newcommand{\vliiiiiq}[8]{\vldsiiiiiaux{#4}{#5}{#6}{#7}{#8}%
                          \vldsiqaux{#1}{#2}{#3}}%

\newcommand{\vldsiiiiiiaux}[6]{\derquad=\fontdimen6\textfont2%
   {#1}%
           \dercldim  =\derldim
           \derccdim  =\dercdim
   \setbox\derboxtwo=\hbox{\unhbox\derboxone\kern\derquad}%
   \advance\derccdim by\derrdim
   \advance\derccdim by\derquad
   {#2}\vldsauxx
   {#3}\vldsauxx
   {#4}\vldsauxx
   {#5}\vldsauxx
   {#6}%
   \setbox\derboxone=\hbox{\unhbox\derboxtwo\unhbox\derboxone}%
   \advance\derccdim by\derldim
   \advance\derccdim by\dercdim
           \dercrdim  =\derrdim}%

\newcommand{\vliiiiiin}[9]{\vldsiiiiiiaux{#4}{#5}{#6}{#7}{#8}{#9}%
                           \vldsinaux{#1}{#2}{#3}}%

\newcommand{\vliiiiiid}[9]{\vldsiiiiiiaux{#4}{#5}{#6}{#7}{#8}{#9}%
                           \vldsidaux{#1}{#2}{#3}}%

\newcommand{\vliiiiiiq}[9]{\vldsiiiiiiaux{#4}{#5}{#6}{#7}{#8}{#9}%
                           \vldsiqaux{#1}{#2}{#3}}%

\newcommand{\vlinfaux     }[4]{\vlderivationaux{\vlin  {#1}{#2}{#3}%
                                                                {\vlhy{#4}}}}%

\newcommand{\vliqfaux     }[4]{\vlderivationaux{\vliq  {#1}{#2}{#3}%
                                                                {\vlhy{#4}}}}%

\newcommand{\vlindaux     }[4]{\vlderivationaux{\vlid  {#1}{#2}{#3}%
                                                                {\vlhy{#4}}}}%

\newcommand{\vliinfaux    }[5]{\vlderivationaux{\vliin {#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}}}%

\newcommand{\vliidfaux    }[5]{\vlderivationaux{\vliid {#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}}}%

\newcommand{\vliiqfaux    }[5]{\vlderivationaux{\vliiq {#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}}}%

\newcommand{\vliiinfaux   }[6]{\vlderivationaux{\vliiin{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}}}%

\newcommand{\vliiidfaux   }[6]{\vlderivationaux{\vliiid{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}}}%

\newcommand{\vliiiqfaux   }[6]{\vlderivationaux{\vliiiq{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}}}%

\newcommand{\vliiiinfaux  }[7]{\vlderivationaux{\vliiiin{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}}}%

\newcommand{\vliiiidfaux  }[7]{\vlderivationaux{\vliiiid{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}}}%

\newcommand{\vliiiiqfaux  }[7]{\vlderivationaux{\vliiiiq{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}}}%

\newcommand{\vliiiiinfaux }[8]{\vlderivationaux{\vliiiiin{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}}}%

\newcommand{\vliiiiidfaux }[8]{\vlderivationaux{\vliiiiid{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}}}%

\newcommand{\vliiiiiqfaux }[8]{\vlderivationaux{\vliiiiiq{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}}}%

\newcommand{\vliiiiiinfaux}[9]{\vlderivationaux{\vliiiiiin{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}%
                                                                {\vlhy{#9}}}}%

\newcommand{\vliiiiiidfaux}[9]{\vlderivationaux{\vliiiiiid{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}%
                                                                {\vlhy{#9}}}}%

\newcommand{\vliiiiiiqfaux}[9]{\vlderivationaux{\vliiiiiiq{#1}{#2}{#3}%
                                                                {\vlhy{#4}}%
                                                                {\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}%
                                                                {\vlhy{#8}}%
                                                                {\vlhy{#9}}}}%

\newcommand{\vlinf     }{\vlderivationinit\vlinfaux     }%

\newcommand{\vlidf     }{\vlderivationinit\vlindaux     }%

\newcommand{\vliqf     }{\vlderivationinit\vliqfaux     }%

\newcommand{\vliinf    }{\vlderivationinit\vliinfaux    }%

\newcommand{\vliidf    }{\vlderivationinit\vliidfaux    }%

\newcommand{\vliiqf    }{\vlderivationinit\vliiqfaux    }%

\newcommand{\vliiinf   }{\vlderivationinit\vliiinfaux   }%

\newcommand{\vliiidf   }{\vlderivationinit\vliiidfaux   }%

\newcommand{\vliiiqf   }{\vlderivationinit\vliiiqfaux   }%

\newcommand{\vliiiinf  }{\vlderivationinit\vliiiinfaux  }%

\newcommand{\vliiiidf  }{\vlderivationinit\vliiiidfaux  }%

\newcommand{\vliiiiqf  }{\vlderivationinit\vliiiiqfaux  }%

\newcommand{\vliiiiinf }{\vlderivationinit\vliiiiinfaux }%

\newcommand{\vliiiiidf }{\vlderivationinit\vliiiiidfaux }%

\newcommand{\vliiiiiqf }{\vlderivationinit\vliiiiiqfaux }%

\newcommand{\vliiiiiinf}{\vlderivationinit\vliiiiiinfaux}%

\newcommand{\vliiiiiidf}{\vlderivationinit\vliiiiiidfaux}%

\newcommand{\vliiiiiiqf}{\vlderivationinit\vliiiiiiqfaux}%

\catcode`@=12
\newcommand{\vltrauxx}[5]{\vldaux
   {#1}%
   {#2}%
   {\vlhy{#3}}%
   {}%
   {\hbox{$\vcenter{\xy
          0;<\hsize,0pt>:<0pt,#4\hsize>::
          (-0.5,0.5);(0.5,0.5)**\crv{(0.1,0.6)&(-0.1,0.4)};
          (0,0)**@{-};(-0.5,0.5)**@{-};
          (0,0.273)*{\scriptstyle #5\strut}%
          \endxy}$}}%
   {\kern\deropen}}%
\catcode`\@=11

\newcommand{\vltraux}[3]{\vltrauxx{}{}{#2}{#3}{#1}}%

\newcount\vltrindc
\newdimen\vltrindd

\newcommand{\vltrlaux}[5]{\ifdim\derccdim>\dercdim\vldummycount=\derccdim
                             \else\vldummycount=\dercdim
                             \fi
                          \FPmul\vltrindc{\the\vldummycount}{0.25}%
                          \vltrindd=\vltrindc sp
                          \advance\vltrindd by-10pt%
   \vltrauxx{\scriptstyle #2\strut\kern-\vltrindd}%
            {\kern-\vltrindd\scriptstyle #3\strut}{#4}{#5}{#1}}%

\newcommand{\vltrauxxx}[2]{{#2}\vlstemaux\vldaux
   {}%
   {}%
   {\vlhy{#1}}%
   {\kern-\ht\strutbox\kern-\dp\strutbox}%
   {}%
   {}}%

\newcommand{\vltrf }[6]{\vltrauxxx{#2}%
                        {\vldsiiiaux{#3}{#4}{#5}\vltraux{#1}{}{#6}}}%

\newcommand{\vltrlf}[8]{\vltrauxxx{#4}%
                        {\vldsiiiaux{#5}{#6}{#7}\vltrlaux{#1}{#2}{#3}{}{#8}}}%

\newcommand{\vltr }[5]{\vltrf{#1}{#2}{#3}{#4}{#5}1}%

\newcommand{\vltrl}[7]{\vltrlf{#1}{#2}{#3}{#4}{#5}{#6}{#7}1}%

\newcommand{\vltreeder }[5]{\vlderivation{\vltr{#1}{#2}{\vlhy{#3}}%
                                                       {\vlhy{#4}}%
                                                       {\vlhy{#5}}}}%

\newcommand{\vltreederl}[7]{\vlderivation{\vltrl{#1}{#2}{#3}{#4}{\vlhy{#5}}%
                                                                {\vlhy{#6}}%
                                                                {\vlhy{#7}}}}%

\newcommand{\vlvdots}{\vbox to12pt{\vfil\hbox{$\smash\vdots$}}}%

%------------------------------------------------- END OF MACROS FOR DERIVATIONS

%----------------------------------------------------- MACROS FOR OPEN DEDUCTION

\newif\ifodframe          \odframetrue
\newif\ifodframefirst     \odframefirsttrue
\newif\ifodbackground     \odbackgroundfalse
\newif\ifodbackgroundfirst\odbackgroundfirsttrue

\newcount\odback
\newcount\odframe

\newcommand{\odboxed}[1]{%
   \ifnum\odback=0
      \ifnum\odframe=0
         \hbox{$\vcenter{%
         \vbox{\kern\fboxrule
         \hbox{\kern\fboxrule$#1$%
               \kern\fboxrule}%
               \kern\fboxrule}%
         }$}%
      \else
         \colorlet{currentcolor}{.}%
         {\color{currentcolor!\the\odframe}\fbox{\color{currentcolor}$#1$}}%
      \fi
   \else
      \colorlet{currentcolor}{.}%
      \fcolorbox{currentcolor!\the\odframe}{currentcolor!\the\odback}{$#1$}%
   \fi}%

\newcommand\odbox[1]{\odframe=100\setlength{\fboxsep}{2pt}%
                                 \setlength{\fboxrule}{.25pt}\odboxed{#1}}%

\newcommand{\odsetframes}{\ifodbackground\ifodbackgroundfirst
                                                   \odbackgroundfirstfalse
                                                   \odback =0%
                                                   \setlength{\fboxsep}{0pt}%
                                                   \odframe=0%
                                         \else\advance\odback by5%
                                              \odframe=\odback
                                              \ifodframe\odframe=100%
                                              \setlength{\fboxsep}{2pt}%
                                              \setlength{\fboxrule}{.25pt}%
                                              \fi
                                         \fi
                          \else\setlength{\fboxsep}{0pt}%
                          \fi
                          \ifodframe\ifodframefirst\odframefirstfalse
                                                   \odframe=0%
                                    \else          \odframe=100%
                                                   \setlength{\fboxsep}{2pt}%
                                                   \setlength{\fboxrule}{.25pt}%
                                    \fi
                          \else     \odframe=0%
                          \fi}%

\newcommand{\odderivationinit}{\bgroup
   \odsetframes
   \vlprepstructures\vlderivationinitaux}%                            % dr

\newcommand{\odderivationaux}[1]{#1\odboxed
                                 {\vcenter{\copy\derboxone}}\vlderivationterm}%

\newcommand{\od        }   {\odderivationinit\odderivationaux}%

\newcommand{\odp       }[3]{\vlpr{#1}{#3}{\vls #2}}%

\newcommand{\odP       }[3]{\vlpd{#1}{#3}{\vls #2}}%

\newcommand{\odpx      }[4]{\vlpf{#1}{#3}{\vls #2}{#4}}%

\newcommand{\odproofaux}[4]{\odderivationaux{\vlpf{#2}{#4}{\vls #3}{#1}}}%

\newcommand{\odr       }   {\odderivationinit\odproofaux1}%

\newcommand{\odR       }   {\odderivationinit\odproofaux2}%

\newcommand{\odd       }[4]{\vldf{#2}{#4}{\vls #3}{\vls #1}1}%

\newcommand{\odD       }[4]{\vldf{#2}{#4}{\vls #3}{\vls #1}2}%

\newcommand{\oddx      }[5]{\vldf{#2}{#4}{\vls #3}{\vls #1}{#5}}%

\newcommand{\odh       }[1]{\vlhy{\vls #1}}%

\newcommand{\odderaux  }[5]{\odderivationaux{\vldf{#3}{#5}{\vls #4}%
                                                    {\vlhy{\vls #2}}{#1}}}%

\newcommand{\odv       }   {\odderivationinit\odderaux1}%

\newcommand{\odV       }   {\odderivationinit\odderaux2}%

\newcommand{\odi       }[4]{\vlin{#2}{#4}{\vls #3}{\vls #1}}%

\newcommand{\odI       }[4]{\vliq{#2}{#4}{\vls #3}{\vls #1}}%

\newcommand{\odo       }[4]{\vlid{#2}{#4}{\vls #3}{\vls #1}}%

\newcommand{\odnaux    }[4]{\odderivationaux{\vlin{#2}{#4}{\vls #3}%
                                                    {\vlhy{\vls #1}}}}%

\newcommand{\odNaux    }[4]{\odderivationaux{\vliq{#2}{#4}{\vls #3}%
                                                    {\vlhy{\vls #1}}}}%

\newcommand{\odtaux    }[4]{\odderivationaux{\vlid{#2}{#4}{\vls #3}%
                                                    {\vlhy{\vls #1}}}}%

\newcommand{\odn       }   {\odderivationinit\odnaux}%

\newcommand{\odN       }   {\odderivationinit\odNaux}%

\newcommand{\odt       }   {\odderivationinit\odtaux}%

%---------------------------------------------- END OF MACROS FOR OPEN DEDUCTION

%------------------------------------------------------- MACROS FOR ATOMIC FLOWS

\catcode`@=12

\newdimen\afunitmst\afunitmst=0.01pt%

\newdimen\afelwidthmst
\newdimen\afelheightmst
\newdimen\afthickonemst
\newdimen\afthicktwomst
\newdimen\afthickthreemst
\newdimen\afthickfourmst
\newdimen\afthickfivemst
\newdimen\aflabeldistancemst

\newcommand{\afsetparamsmst}{%
\afelwidthmst      =425\afunitmst
\afelheightmst     =325\afunitmst
\afthickonemst     = 60\afunitmst
\afthicktwomst     = 40\afunitmst
\afthickthreemst   =160\afunitmst
\afthickfourmst    =120\afunitmst
\afthickfivemst    = 40\afunitmst
\aflabeldistancemst=220\afunitmst}%

\afsetparamsmst

\newdimen\afunit\afunit=0.01pt%

\newdimen\afelwidth
\newdimen\afelheight
\newdimen\afthickone
\newdimen\afthicktwo
\newdimen\afthickthree
\newdimen\afthickfour
\newdimen\afthickfive
\newdimen\aflabeldistance

\newdimen\afelwidthcur

\newdimen\afthickdouble
\newdimen\afthicksep

\newcommand{\afsetparams}{%
\afelwidth      =425\afunit
\afelheight     =325\afunit
\afthickone     = 60\afunit
\afthicktwo     = 40\afunit
\afthickthree   =160\afunit
\afthickfour    =120\afunit
\afthickfive    = 40\afunit
\aflabeldistance=220\afunit
\afthicksep     =  3\afelwidth\divide\afthicksep by10%
                             \advance\afthicksep by-\afthickfive
\afthickdouble  =\afthicksep
                 \advance\afthickdouble by2\afthickfive
\afelwidthcur   =\afelwidth}%

\afsetparams

\newbox\aftrdnbox
\newbox\aftrupbox
\newbox\afdiskbox
\newbox\afbbdbox
\newbox\afbbubox
\newbox\afbdbox
\newbox\afbubox
\newbox\afcdcbox
\newbox\afcdcmbox
\newbox\afcucbox
\newbox\afcucmbox
\newbox\afcdabox\newbox\afwdabox\newbox\afadabox
\newbox\afCdbox\newbox\afWdbox\newbox\afAdbox
\newbox\afcdnbox\newbox\afwdnbox\newbox\afadnbox
\newbox\afCdnbox
\newbox\afcuabox\newbox\afwuabox\newbox\afauabox
\newbox\afCubox\newbox\afWubox\newbox\afAubox
\newbox\afcunbox\newbox\afwunbox\newbox\afaunbox
\newbox\afCunbox
\newbox\afIubox
\newbox\afiubox
\newbox\afIdbox
\newbox\afidbox
\newbox\afinubox\newbox\afindbox 
\newbox\afDubox
\newbox\afduabox
\newbox\afDdbox
\newbox\afddabox
\newbox\afddnbox
\newbox\afdunbox
\newbox\afCudbox
\newbox\afcudabox
\newbox\afCddbox
\newbox\afcddabox
\newbox\afCudnbox
\newbox\afcudnbox
\newbox\afCddnbox
\newbox\afcddnbox

\newif\ifvlcompileflows\vlcompileflowsfalse

\newcommand{\ifemptyargparamsunchangedcompileflows}[3]{%
\ifblank{#1}{%
\ifdim\afunit           =\afunitmst
\ifdim\afelwidth        =\afelwidthmst
\ifdim\afelheight       =\afelheightmst
\ifdim\afthickone       =\afthickonemst
\ifdim\afthicktwo       =\afthicktwomst
\ifdim\afthickthree     =\afthickthreemst
\ifdim\afthickfour      =\afthickfourmst
\ifdim\afthickfive      =\afthickfivemst
\ifdim\aflabeldistance  =\aflabeldistancemst
\ifvlcompileflows
#2%
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi
\else #3\fi}%
{#3}}%

\newif\ifaftrin
\newif\ifafdual
\newif\ifafstem
\newif\ifafmult
\newif\ifafdisk

\newcommand{\afcompileenable}{%
\afdiskfalse
\aftrintrue
\afstemtrue \afdualfalse\afmultfalse\setbox\afadabox =\afwauxx{}{}{}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afAdbox  =\afwauxx{}{}{}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afauabox =\afwauxx{}{}{}%
\afstemtrue \afdualtrue \afmulttrue \setbox\afAubox  =\afwauxx{}{}{}%
\afstemfalse\afdualfalse\afmultfalse\setbox\afadnbox =\afwauxx{}{}{}%
\afstemfalse\afdualtrue \afmultfalse\setbox\afaunbox =\afwauxx{}{}{}%
\aftrinfalse
            \afdualfalse\setbox\aftrdnbox=\aftraux
                        \setbox\afbbdbox =\afbmaux
            \afdualtrue \setbox\aftrupbox=\aftraux
                        \setbox\afbbubox =\afbmaux
                        \setbox\afdiskbox=\afdiaux
\afstemtrue \afdualfalse\afmultfalse\setbox\afwdabox =\afwauxx{}{}{}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afWdbox  =\afwauxx{}{}{}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afwuabox =\afwauxx{}{}{}%
\afstemtrue \afdualtrue \afmulttrue \setbox\afWubox  =\afwauxx{}{}{}%
\afstemfalse\afdualfalse\afmultfalse\setbox\afwdnbox =\afwauxx{}{}{}%
                                    \setbox\afbdbox  =\afbauxx
\afstemfalse\afdualtrue \afmultfalse\setbox\afwunbox =\afwauxx{}{}{}%
                                    \setbox\afbubox  =\afbauxx
            \afdualfalse\afmultfalse\setbox\afcdcbox =\afccaux{}{}%
            \afdualfalse\afmulttrue \setbox\afcdcmbox=\afcmaux{}{}%
            \afdualtrue \afmultfalse\setbox\afcucbox =\afccaux{}{}%
            \afdualtrue \afmulttrue \setbox\afcucmbox=\afcmaux{}{}%
\afstemtrue \afdualfalse\afmultfalse\setbox\afcdabox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afCdbox =\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afcuabox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualtrue \afmulttrue \setbox\afCubox =\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualfalse\afmultfalse\setbox\afcdnbox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualfalse\afmulttrue \setbox\afCdnbox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualtrue \afmultfalse\setbox\afcunbox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualtrue \afmulttrue \setbox\afCunbox=\afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualtrue \afmulttrue \setbox\afIubox =
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afiubox =
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afIdbox =
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afstemtrue \afdualfalse\afmultfalse\setbox\afidbox =
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afstemfalse\afdualtrue             \setbox\afinubox=
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afstemfalse\afdualfalse            \setbox\afindbox=
                                              \hbox{\afiauxx{}{}{}{}11{}{}}%
\afdisktrue
\afstemtrue \afdualtrue \afmulttrue \setbox\afDubox  =\afwauxx{}{}{}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afduabox =\afwauxx{}{}{}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afDdbox  =\afwauxx{}{}{}%
\afstemtrue \afdualfalse\afmultfalse\setbox\afddabox =\afwauxx{}{}{}%
\afstemfalse\afdualfalse            \setbox\afddnbox =\afwauxx{}{}{}%
\afstemfalse\afdualtrue             \setbox\afdunbox =\afwauxx{}{}{}%
\afstemtrue \afdualfalse\afmultfalse\setbox\afcddabox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualfalse\afmulttrue \setbox\afCddbox =
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualtrue \afmultfalse\setbox\afcudabox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemtrue \afdualtrue \afmulttrue \setbox\afCudbox =
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualfalse\afmultfalse\setbox\afcddnbox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualfalse\afmulttrue \setbox\afCddnbox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualtrue \afmultfalse\setbox\afcudnbox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\afstemfalse\afdualtrue \afmulttrue \setbox\afCudnbox=
                                                     \afcauxx{}{}{}{}{}{}{}{}{}%
\vlcompileflowstrue}%

\newcommand{\afcompiledisable}{\vlcompileflowsfalse}%

\AtBeginDocument{\ifvirginialakeusesxy\afcompileenable\fi}%

\newcommand{\af}[1]{\vcenter{\xy
<\afelwidth,0pt>:<0pt,\afelheight>::#1\endxy}}%

\newcommand{\afinv}[1]{\vcenter{\xy
<\afelwidth,0pt>:<0pt,-\afelheight>::#1\endxy}}%

\newcommand{\afinvm}{\vbox to0pt{\color{white}\vss
\hbox to0pt{\hss\vrule height.1sp depth0sp width.1sp}}}%

\newcommand{\aftrimabove}[1]{\vcenter
                             {\vbox{\kern-3.2\afelheight\hbox{$#1$}}}}%

\newcommand{\aftrimbelow}[1]{\vcenter
                             {\vbox{\hbox{$#1$}\kern-3.2\afelheight}}}%

\newcommand{\aftrim}[1]{\vcenter{\vbox{\kern-3.2\afelheight\hbox{$#1$}%
                                       \kern-3.2\afelheight}}}%

\newcommand{\afraise}[1]{\raise2\afelheight\hbox{$#1$}}%

\newcommand{\aflower}[1]{\lower2\afelheight\hbox{$#1$}}%

%-------------------------------- LABELS

\newcommand{\aflr}[1]{\vbox to0pt{\vss
   \hbox to0pt{$\scriptstyle\kern\aflabeldistance #1\strut$\hss}\vss}}%

\newcommand{\afll}[1]{\vbox to 0pt{\vss
   \hbox to0pt{\hss$\scriptstyle #1\kern\aflabeldistance\strut$}\vss}}%

%------------------- TRIANGLES AND DISK

\newcommand{\aftrauxps}{%
\xybox{<\afelwidth,0pt>:<0pt,\ifaftrin
                                \ifafdual
                                \else
                                   -
                                \fi
                             \else
                                \ifafdual
                                   -
                                \fi
                             \fi\afelheight>::
( 0   ,-0.55);( 0   , 0.54)**[|<\afthickone>][white]@{-};
( 0.08,-0.43);( 0.08, 0.54)**[|<\afthickone>][white]@{-};
(-0.08,-0.43);(-0.08, 0.54)**[|<\afthickone>][white]@{-};
( 0.16,-0.31);( 0.16, 0.54)**[|<\afthickone>][white]@{-};
(-0.16,-0.31);(-0.16, 0.54)**[|<\afthickone>][white]@{-};
( 0.24,-0.19);( 0.24, 0.54)**[|<\afthickone>][white]@{-};
(-0.24,-0.19);(-0.24, 0.54)**[|<\afthickone>][white]@{-};
( 0.32,-0.07);( 0.32, 0.54)**[|<\afthickone>][white]@{-};
(-0.32,-0.07);(-0.32, 0.54)**[|<\afthickone>][white]@{-};
( 0.40, 0.05);( 0.40, 0.54)**[|<\afthickone>][white]@{-};
(-0.40, 0.05);(-0.40, 0.54)**[|<\afthickone>][white]@{-};
( 0.48, 0.17);( 0.48, 0.54)**[|<\afthickone>][white]@{-};
(-0.48, 0.17);(-0.48, 0.54)**[|<\afthickone>][white]@{-};
( 0.56, 0.29);( 0.56, 0.54)**[|<\afthickone>][white]@{-};
(-0.56, 0.29);(-0.56, 0.54)**[|<\afthickone>][white]@{-};
( 0.64, 0.41);( 0.64, 0.54)**[|<\afthickone>][white]@{-};
(-0.64, 0.41);(-0.64, 0.54)**[|<\afthickone>][white]@{-};
( 0.72, 0.53);( 0.72, 0.54)**[|<\afthickone>][white]@{-};
(-0.72, 0.53);(-0.72, 0.54)**[|<\afthickone>][white]@{-};
(-0.8 , 0.6 );( 0   ,-0.6 )**[|<\afthickfour>]@{-};
( 0   ,-0.6 );( 0.8 , 0.6 )**[|<\afthickfour>]@{-};
(-0.8 , 0.6 );( 0.8 , 0.6 )**[|<\afthickfour>]@{-}}}%

\newcommand{\aftrauxpdf}{\hbox{\kern-.15\afelwidth
\xybox{<\afelwidth,0pt>:<0pt,\ifaftrin
                                \ifafdual
                                \else
                                   -
                                \fi
                             \else
                                \ifafdual
                                   -
                                \fi
                             \fi\afelheight>::
( 0   ,-0.55);( 0   , 0.54)**[|<\afthickone>][white]@{-};
( 0.04,-0.43);( 0.04, 0.54)**[|<\afthickone>][white]@{-};
(-0.04,-0.43);(-0.04, 0.54)**[|<\afthickone>][white]@{-};
( 0.08,-0.43);( 0.08, 0.54)**[|<\afthickone>][white]@{-};
(-0.08,-0.43);(-0.08, 0.54)**[|<\afthickone>][white]@{-};
( 0.12,-0.31);( 0.12, 0.54)**[|<\afthickone>][white]@{-};
(-0.12,-0.31);(-0.12, 0.54)**[|<\afthickone>][white]@{-};
( 0.16,-0.31);( 0.16, 0.54)**[|<\afthickone>][white]@{-};
(-0.16,-0.31);(-0.16, 0.54)**[|<\afthickone>][white]@{-};
( 0.20,-0.19);( 0.20, 0.54)**[|<\afthickone>][white]@{-};
(-0.20,-0.19);(-0.20, 0.54)**[|<\afthickone>][white]@{-};
( 0.24,-0.19);( 0.24, 0.54)**[|<\afthickone>][white]@{-};
(-0.24,-0.19);(-0.24, 0.54)**[|<\afthickone>][white]@{-};
( 0.28,-0.19);( 0.28, 0.54)**[|<\afthickone>][white]@{-};
(-0.28,-0.19);(-0.28, 0.54)**[|<\afthickone>][white]@{-};
( 0.32,-0.07);( 0.32, 0.54)**[|<\afthickone>][white]@{-};
(-0.32,-0.07);(-0.32, 0.54)**[|<\afthickone>][white]@{-};
( 0.36,-0.07);( 0.36, 0.54)**[|<\afthickone>][white]@{-};
(-0.36,-0.07);(-0.36, 0.54)**[|<\afthickone>][white]@{-};
( 0.40, 0.05);( 0.40, 0.54)**[|<\afthickone>][white]@{-};
(-0.40, 0.05);(-0.40, 0.54)**[|<\afthickone>][white]@{-};
( 0.44, 0.17);( 0.44, 0.54)**[|<\afthickone>][white]@{-};
(-0.44, 0.17);(-0.44, 0.54)**[|<\afthickone>][white]@{-};
( 0.48, 0.17);( 0.48, 0.54)**[|<\afthickone>][white]@{-};
(-0.48, 0.17);(-0.48, 0.54)**[|<\afthickone>][white]@{-};
( 0.52, 0.29);( 0.52, 0.54)**[|<\afthickone>][white]@{-};
(-0.52, 0.29);(-0.52, 0.54)**[|<\afthickone>][white]@{-};
( 0.56, 0.29);( 0.56, 0.54)**[|<\afthickone>][white]@{-};
(-0.56, 0.29);(-0.56, 0.54)**[|<\afthickone>][white]@{-};
( 0.60, 0.41);( 0.60, 0.54)**[|<\afthickone>][white]@{-};
(-0.60, 0.41);(-0.60, 0.54)**[|<\afthickone>][white]@{-};
( 0.64, 0.41);( 0.64, 0.54)**[|<\afthickone>][white]@{-};
(-0.64, 0.41);(-0.64, 0.54)**[|<\afthickone>][white]@{-};
( 0.68, 0.41);( 0.68, 0.54)**[|<\afthickone>][white]@{-};
(-0.68, 0.41);(-0.68, 0.54)**[|<\afthickone>][white]@{-};
( 0.72, 0.53);( 0.72, 0.54)**[|<\afthickone>][white]@{-};
(-0.72, 0.53);(-0.72, 0.54)**[|<\afthickone>][white]@{-};
(-0.95, 0.68);( 0   ,-0.74)**[|<\afthickone>]@{-};
( 0   ,-0.74);( 0.95, 0.68)**[|<\afthickone>]@{-};
(-0.95, 0.68);( 0.95, 0.68)**[|<\afthickone>]@{-};
(-0.8 , 0.6 );( 0   ,-0.6 )**[|<\afthickone>]@{-};
( 0   ,-0.6 );( 0.8 , 0.6 )**[|<\afthickone>]@{-};
(-0.8 , 0.6 );( 0.8 , 0.6 )**[|<\afthickone>]@{-};
(-0.65, 0.52);( 0   ,-0.46)**[|<\afthickone>]@{-};
( 0   ,-0.46);( 0.65, 0.52)**[|<\afthickone>]@{-};
(-0.65, 0.52);( 0.65, 0.52)**[|<\afthickone>]@{-}}%
\kern-.15\afelwidth}}%

\newcommand{\aftraux}{\ifvirginialakepdflatex\aftrauxpdf\else\aftrauxps\fi}%

\newcommand{\aftr}{%
\ifemptyargparamsunchangedcompileflows{}%
{\ifaftrin
    \ifafdual
       \copy\aftrdnbox
    \else
       \copy\aftrupbox
    \fi
 \else
    \ifafdual
       \copy\aftrupbox
    \else
       \copy\aftrdnbox
    \fi
 \fi}%
{\hbox{\aftraux}}}%

\newcommand{\afdiaux}{%
\xybox{<\afelheight,0pt>:<0pt,\afelheight>::
( 0  , 0.0)*\frm<.6\afelwidth>{*};
( 0.6, 0.6)*{\afinvm}            ;
(-0.6,-0.6)*{\afinvm}            }}%

\newcommand{\afdi}{%
\ifemptyargparamsunchangedcompileflows{}%
{\copy\afdiskbox}%
{\hbox{\afdiaux}}}%

%---------------------------- IDENTITIES

\newcommand{\afistemsaux}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(-2,-2);(-2,2)**[|<\afthickone>][#1]@{-};
( 2,-2);( 2,2)**[|<\afthickone>][#2]@{-}}}%

\newcommand{\afistemmsauxps}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(-2,-2);(-2,2)**[|<\afthickdouble>][#1][butt]@{-};
(-2,-2);(-2,2)**[|<\afthicksep>][#1][white]@{-};
( 2,-2);( 2,2)**[|<\afthickdouble>][#2][butt]@{-};
( 2,-2);( 2,2)**[|<\afthicksep>][#2][white]@{-}}}%

\newcommand{\afistemmsauxpdf}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(-2,-2)-<0.15\afelwidthcur,0pt>;
(-2, 2)-<0.15\afelwidthcur,0pt>**[|<\afthickfive>][#1]@{-};
(-2,-2)+<0.15\afelwidthcur,0pt>;
(-2, 2)+<0.15\afelwidthcur,0pt>**[|<\afthickfive>][#1]@{-};
( 2,-2)-<0.15\afelwidthcur,0pt>;
( 2, 2)-<0.15\afelwidthcur,0pt>**[|<\afthickfive>][#2]@{-};
( 2,-2)+<0.15\afelwidthcur,0pt>;
( 2, 2)+<0.15\afelwidthcur,0pt>**[|<\afthickfive>][#2]@{-}}}%

\newcommand{\afistems}[2]{\ifafstem\ifafmult\ifvirginialakepdflatex
                           \afistemmsauxpdf{#1}{#2}\else
                           \afistemmsauxps {#1}{#2}\fi\else
                           \afistemsaux{#1}{#2}\fi\else\relax\fi}%

\newcommand{\afiauxxps}[8]{\multiply\afelwidth by#5%
                             \divide\afelwidth by#6%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
( 0  ,-2)*{\hbox{\afistems{#7}{#8}}};
(-2.5, 0);(2.5,0)**[|<\afthickthree>]\crv{(0,1)};
( 0  ,-4  )*{\afinvm};
( 0  , 4  )*{\afinvm};
(-2  ,-2.5)*{\afll{#1}};
(-2  ,-2.5)*{\aflr{#2}};
( 2  ,-2.5)*{\afll{#3}};
( 2  ,-2.5)*{\aflr{#4}}}}%

\newcommand{\afiauxxpdf}[8]{\multiply\afelwidth by#5%
                              \divide\afelwidth by#6%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
( 0  ,-2)*{\hbox{\afistems{#7}{#8}}};
(-2.5, 0.1);(2.5, 0.1)**[|<\afthickone>]\crv{(0,1.1)};
(-2.5, 0  );(2.5, 0  )**[|<\afthickone>]\crv{(0,1  )};
(-2.5,-0.1);(2.5,-0.1)**[|<\afthickone>]\crv{(0,0.9)};
( 0  ,-4  )*{\afinvm};
( 0  , 4  )*{\afinvm};
(-2  ,-2.5)*{\afll{#1}};
(-2  ,-2.5)*{\aflr{#2}};
( 2  ,-2.5)*{\afll{#3}};
( 2  ,-2.5)*{\aflr{#4}}}}%

\newcommand{\afiauxx}[8]{\ifvirginialakepdflatex
                          \afiauxxpdf{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}\else
                          \afiauxxps {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}\fi}%

\newcommand{\afiaux}[4]{\ifemptyargparamsunchangedcompileflows{#1#2#3#4}%
                         {\ifafstem
                             \ifafdual
                                \ifafmult
                                   \copy\afIubox
                                \else
                                   \copy\afiubox
                                \fi
                             \else
                                \ifafmult
                                   \copy\afIdbox
                                \else
                                   \copy\afidbox
                                \fi
                             \fi
                          \else
                             \ifafdual
                                \copy\afinubox
                             \else
                                \copy\afindbox
                             \fi
                          \fi}%
                         {\afiauxx{#1}{#2}{#3}{#4}11{}{}}}%

\newcommand{\afid  }[4]{\afstemtrue\afdualfalse\afmultfalse
                             \afiaux{#1}{#2}{#3}{#4}}%

\newcommand{\afId  }[4]{\afstemtrue\afdualfalse\afmulttrue
                             \afiaux{#1}{#2}{#3}{#4}}%

\newcommand{\afiu  }[4]{\afstemtrue\afdualtrue\afmultfalse
                             \afiaux{#1}{#2}{#3}{#4}}%

\newcommand{\afIu  }[4]{\afstemtrue\afdualtrue\afmulttrue
                             \afiaux{#1}{#2}{#3}{#4}}%

\newcommand{\afidn }   {\afstemfalse\afdualfalse
                             \afiaux{}{}{}{}}%

\newcommand{\afiun }   {\afstemfalse\afdualtrue
                             \afiaux{}{}{}{}}%

\newcommand{\afidc }[6]{\afstemtrue\afdualfalse\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}11{#5}{#6}}%

\newcommand{\afIdc }[6]{\afstemtrue\afdualfalse\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}11{#5}{#6}}%

\newcommand{\afiuc }[6]{\afstemtrue\afdualtrue\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}11{#5}{#6}}%

\newcommand{\afIuc }[6]{\afstemtrue\afdualtrue\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}11{#5}{#6}}%

\newcommand{\afidx }[6]{\afstemtrue\afdualfalse\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{}{}}%

\newcommand{\afidxc}[8]{\afstemtrue\afdualfalse\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

\newcommand{\afIdx }[6]{\afstemtrue\afdualfalse\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{}{}}%

\newcommand{\afIdxc}[8]{\afstemtrue\afdualfalse\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

\newcommand{\afiux }[6]{\afstemtrue\afdualtrue\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{}{}}%

\newcommand{\afiuxc}[8]{\afstemtrue\afdualtrue\afmultfalse
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

\newcommand{\afIux }[6]{\afstemtrue\afdualtrue\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{}{}}%

\newcommand{\afIuxc}[8]{\afstemtrue\afdualtrue\afmulttrue
                             \afiauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

%------------ WEAKENINGS AND ABSORPTIONS

\newcommand{\afstemaux}[1]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(0,-2);(0,2)**[|<\afthickone>][#1]@{-}}}%

\newcommand{\afstemmauxps}[1]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(0,-2);(0,2)**[|<\afthickdouble>][#1][butt]@{-};
(0,-2);(0,2)**[|<\afthicksep>][#1][white]@{-}}}%

\newcommand{\afstemmauxpdf}[1]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(-0.15,-2);(-0.15,2)**[|<\afthickfive>][#1]@{-};
( 0.15,-2);( 0.15,2)**[|<\afthickfive>][#1]@{-}}}%

\newcommand{\afstem}[1]{\ifafstem\ifafmult\ifvirginialakepdflatex
                             \afstemmauxpdf{#1}\else
                             \afstemmauxps {#1}\fi\else
                          \afstemaux{#1}\fi\else\relax\fi}%

\newcommand{\afwauxx}[3]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(0,-2  )*{\hbox{\afstem{#3}}};
(0, 0  )*{\hbox{\ifafdisk\afdi\fi}};
(0, 0  )*{\hbox{\ifafdisk\else\aftr\fi}};
(0,-4  )*{\afinvm};
(0, 4  )*{\afinvm};
(0,-2.5)*{\afll{#1}};
(0,-2.5)*{\aflr{#2}}}}%

\newcommand{\afwaux}[3]{\ifemptyargparamsunchangedcompileflows{#1#2#3}%
                         {\ifaftrin
                             \ifafstem
                                \ifafdual
                                   \ifafmult
                                      \copy\afAubox
                                   \else
                                      \copy\afauabox
                                   \fi
                                \else
                                   \ifafmult
                                      \copy\afAdbox
                                   \else
                                      \copy\afadabox
                                   \fi
                                \fi
                             \else
                                \ifafdual
                                   \copy\afaunbox
                                \else
                                   \copy\afadnbox
                                \fi
                             \fi
                          \else
                             \ifafstem
                                \ifafdual
                                   \ifafmult
                                    \ifafdisk\copy\afDubox\else\copy\afWubox\fi
                                   \else
                                   \ifafdisk\copy\afduabox\else\copy\afwuabox\fi
                                   \fi
                                \else
                                   \ifafmult
                                     \ifafdisk\copy\afDdbox\else\copy\afWdbox\fi
                                   \else
                                   \ifafdisk\copy\afddabox\else\copy\afwdabox\fi
                                   \fi
                                \fi
                             \else
                                \ifafdual
                                  \ifafdisk\copy\afdunbox\else\copy\afwunbox\fi
                                \else
                                  \ifafdisk\copy\afddnbox\else\copy\afwdnbox\fi
                                \fi
                             \fi
                          \fi}%
                         {\afwauxx{#1}{#2}{#3}}}%

\newcommand{\afwd }[2]{\aftrinfalse\afstemtrue\afdualfalse\afmultfalse
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afWd }[2]{\aftrinfalse\afstemtrue\afdualfalse\afmulttrue
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afwu }[2]{\aftrinfalse\afstemtrue\afdualtrue\afmultfalse
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afWu }[2]{\aftrinfalse\afstemtrue\afdualtrue\afmulttrue
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afwdn}   {\aftrinfalse\afstemfalse\afdualfalse
                                              \afdiskfalse\afwaux{}{}{}}%

\newcommand{\afwun}   {\aftrinfalse\afstemfalse\afdualtrue
                                              \afdiskfalse\afwaux{}{}{}}%

\newcommand{\afwdc}[3]{\aftrinfalse\afstemtrue\afdualfalse\afmultfalse
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afWdc}[3]{\aftrinfalse\afstemtrue\afdualfalse\afmulttrue
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afwuc}[3]{\aftrinfalse\afstemtrue\afdualtrue\afmultfalse
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afWuc}[3]{\aftrinfalse\afstemtrue\afdualtrue\afmulttrue
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afau }[2]{\aftrintrue \afstemtrue\afdualfalse\afmultfalse
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afAu }[2]{\aftrintrue \afstemtrue\afdualfalse\afmulttrue
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afad }[2]{\aftrintrue \afstemtrue\afdualtrue\afmultfalse
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afAd }[2]{\aftrintrue \afstemtrue\afdualtrue\afmulttrue
                                              \afdiskfalse\afwaux{#1}{#2}{}}%

\newcommand{\afaun}   {\aftrintrue \afstemfalse\afdualfalse
                                              \afdiskfalse\afwaux{}{}{}}%

\newcommand{\afadn}   {\aftrintrue \afstemfalse\afdualtrue
                                              \afdiskfalse\afwaux{}{}{}}%

\newcommand{\afauc}[3]{\aftrintrue \afstemtrue\afdualfalse\afmultfalse
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afAuc}[3]{\aftrintrue \afstemtrue\afdualfalse\afmulttrue
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afadc}[3]{\aftrintrue \afstemtrue\afdualtrue\afmultfalse
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

\newcommand{\afAdc}[3]{\aftrintrue \afstemtrue\afdualtrue\afmulttrue
                                              \afdiskfalse\afwauxx{#1}{#2}{#3}}%

%----------------------------- LOLLIPOPS

\newcommand{\afdaux}[2]{\ifemptyargparamsunchangedcompileflows{#1#2}%
                         {\ifafstem
                             \ifafdual
                                \ifafmult
                                   \copy\afDubox
                                \else
                                   \copy\afduabox
                                \fi
                             \else
                                \ifafmult
                                   \copy\afDdbox
                                \else
                                   \copy\afddabox
                                \fi
                             \fi
                          \else
                             \ifafdual
                                \copy\afdunbox
                             \else
                                \copy\afddnbox
                             \fi
                          \fi}%
                         {\afwauxx{#1}{#2}{}}}%

\newcommand{\afdd }[2]{\afstemtrue\afdualfalse\afmultfalse
                                  \afdisktrue\afdaux{#1}{#2}}%

\newcommand{\afDd }[2]{\afstemtrue\afdualfalse\afmulttrue
                                  \afdisktrue\afdaux{#1}{#2}}%

\newcommand{\afdu }[2]{\afstemtrue\afdualtrue\afmultfalse
                                  \afdisktrue\afdaux{#1}{#2}}%

\newcommand{\afDu }[2]{\afstemtrue\afdualtrue\afmulttrue
                                  \afdisktrue\afdaux{#1}{#2}}%

\newcommand{\afd  }   {\afstemfalse\afdualtrue
                                  \afdisktrue\afdaux{}{}}%

\newcommand{\afddc}[3]{\afstemtrue\afdualfalse\afmultfalse
                                  \afdisktrue\afwauxx{#1}{#2}{#3}}%

\newcommand{\afDdc}[3]{\afstemtrue\afdualfalse\afmulttrue
                                  \afdisktrue\afwauxx{#1}{#2}{#3}}%

\newcommand{\afduc}[3]{\afstemtrue\afdualtrue\afmultfalse
                                  \afdisktrue\afwauxx{#1}{#2}{#3}}%

\newcommand{\afDuc}[3]{\afstemtrue\afdualtrue\afmulttrue
                                  \afdisktrue\afwauxx{#1}{#2}{#3}}%

%---------------------- TOPS AND BOTTOMS

\newcommand{\afbbauxps}{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-0.6,-0.8)*{\afinvm};
( 0.6,-0.8)*{\afinvm};
(-0.6,0   );(0.6,0  )**[|<\afthickone>]@{-};
( 0  ,0   );(0  ,0.8)**[|<\afthickone>]@{-}}}%

\newcommand{\afbbauxpdf}{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-0.6,-0.8)*{\afinvm};
( 0.6,-0.8)*{\afinvm};
(-0.6, 0  );(0.6,0  )**[|<\afthickone>]@{-};
( 0  , 0  );(0  ,0.8)**[|<\afthickone>]@{-}}}%

\newcommand{\afbmaux}{\ifvirginialakepdflatex\afbbauxpdf\else\afbbauxps\fi}%

\newcommand{\afbm}{%
\ifemptyargparamsunchangedcompileflows{}%
{\ifafdual\copy\afbbubox
     \else\copy\afbbdbox\fi}%
{\hbox{\afbmaux}}}%

\newcommand{\afbauxx}{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(0, 0)*{\hbox{\afbm}};
(0,-4)*{\afinvm};
(0, 4)*{\afinvm}}}%

\newcommand{\afbaux}{\ifemptyargparamsunchangedcompileflows{}%
                       {\ifafdual\copy\afbubox\else\copy\afbdbox\fi}%
                       {\afbauxx}}%

\newcommand{\afbd}  {\afdualfalse\afbaux}%

\newcommand{\afbu}  {\afdualtrue \afbaux}%

%---------------- OLD STYLE CONTRACTIONS

\newcommand{\afccaux}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2,2);(0,-2)**[|<\afthickone>][#1]\crv{(-2,-0.4)};
( 2,2);(0,-2)**[|<\afthickone>][#2]\crv{( 2,-0.4)}}}%

\newcommand{\afcmauxpdf}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2.15,2);(-0.28,-2   )**[|<\afthickfive>][#1]\crv{(-2.15,-0.4)};
( 2.15,2);( 0.28,-2   )**[|<\afthickfive>][#2]\crv{( 2.15,-0.4)};
(-1.85,2);( 0   ,-1.78)**[|<\afthickfive>][#1]\crv{(-1.85,-0.3)};
( 1.85,2);( 0   ,-1.78)**[|<\afthickfive>][#2]\crv{( 1.85,-0.3)}}}%

\newcommand{\afcmauxps}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2.15,0)*{\afinvm};
( 2.15,0)*{\afinvm};
(-2,2);(0,-2)**[|<\afthickdouble>][#1][butt]\crv{(-2,-0.4)};
(-2,2);(0,-2)**[|<\afthicksep   >][white]   \crv{(-2,-0.4)};
( 2,2);(0,-2)**[|<\afthickdouble>][#2][butt]\crv{( 2,-0.4)};
( 2,2);(0,-2)**[|<\afthicksep   >][white]   \crv{( 2,-0.4)}}}%

\newcommand{\afcmaux}[2]{\ifvirginialakepdflatex\afcmauxpdf{#1}{#2}\else
                                                \afcmauxps {#1}{#2}\fi}%

\newcommand{\afcc}[2]{\ifafmult
   \ifemptyargparamsunchangedcompileflows{#1#2}%
   {\ifafdual\copy\afcucmbox
        \else\copy\afcdcmbox\fi}%
   {\afcmaux{#1}{#2}}%
\else
   \ifemptyargparamsunchangedcompileflows{#1#2}%
   {\ifafdual\copy\afcucbox
        \else\copy\afcdcbox\fi}%
   {\afccaux{#1}{#2}}%
\fi}%

\newcommand{\afcauxx}[9]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
( 0  , 2  )*{\hbox{\afcc{#7}{#8}}};
( 0  , 0  )*{\hbox{\afwaux{#5}{#6}{#9}}};
( 0  ,-4  )*{\afinvm};
(-1.7, 2.5)*{\afll{#1}};
(-1.5, 2.5)*{\aflr{#2}};
( 1.5, 2.5)*{\afll{#3}};
( 1.7, 2.5)*{\aflr{#4}}}}%

\newcommand{\afcaux}[6]{\ifemptyargparamsunchangedcompileflows{#1#2#3#4#5#6}%
   {\ifafdisk
       \ifafstem
          \ifafdual
             \ifafmult
                \copy\afCudbox
             \else
                \copy\afcudabox
             \fi
          \else
             \ifafmult
                \copy\afCddbox
             \else
                \copy\afcddabox
             \fi
          \fi
       \else
          \ifafdual
             \ifafmult
                \copy\afCudnbox
             \else
                \copy\afcudnbox
             \fi
          \else
             \ifafmult
                \copy\afCddnbox
             \else
                \copy\afcddnbox
             \fi
          \fi
       \fi
    \else
       \ifafstem
          \ifafdual
             \ifafmult
                \copy\afCubox
             \else
                \copy\afcuabox
             \fi
          \else
             \ifafmult
                \copy\afCdbox
             \else
                \copy\afcdabox
             \fi
          \fi
       \else
          \ifafdual
             \ifafmult
                \copy\afCunbox
             \else
                \copy\afcunbox
             \fi
          \else
             \ifafmult
                \copy\afCdnbox
             \else
                \copy\afcdnbox
             \fi
          \fi
       \fi
    \fi}%
   {\afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{}{}{}}}%

\newcommand{\afcd  }[6]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afCd  }[6]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afcu  }[6]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afCu  }[6]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afcdn }[4]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afCdn }[4]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afcun }[4]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afCun }[4]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afcdc }[9]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afCdc }[9]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afcuc }[9]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afCuc }[9]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afcdnc}[6]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afCdnc}[6]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afcunc}[6]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afCunc}[6]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afcdd  }[6]{\afstemtrue\afdualfalse\afmultfalse\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afCdd  }[6]{\afstemtrue\afdualfalse\afmulttrue\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afcud  }[6]{\afstemtrue\afdualtrue\afmultfalse\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afCud  }[6]{\afstemtrue\afdualtrue\afmulttrue\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{#5}{#6}}%

\newcommand{\afcddn }[4]{\afstemfalse\afdualfalse\afmultfalse\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afCddn }[4]{\afstemfalse\afdualfalse\afmulttrue\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afcudn }[4]{\afstemfalse\afdualtrue\afmultfalse\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afCudn }[4]{\afstemfalse\afdualtrue\afmulttrue\afdisktrue
                             \afcaux{#1}{#2}{#3}{#4}{}{}}%

\newcommand{\afcddc }[9]{\afstemtrue\afdualfalse\afmultfalse\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afCddc }[9]{\afstemtrue\afdualfalse\afmulttrue\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afcudc }[9]{\afstemtrue\afdualtrue\afmultfalse\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afCudc }[9]{\afstemtrue\afdualtrue\afmulttrue\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%

\newcommand{\afcddnc}[6]{\afstemfalse\afdualfalse\afmultfalse\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afCddnc}[6]{\afstemfalse\afdualfalse\afmulttrue\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afcudnc}[6]{\afstemfalse\afdualtrue\afmultfalse\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

\newcommand{\afCudnc}[6]{\afstemfalse\afdualtrue\afmulttrue\afdisktrue
                             \afcauxx{#1}{#2}{#3}{#4}{}{}{#5}{#6}{}}%

%--------------------- LONG CONTRACTIONS

\newcommand{\afcxqcaux}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2,4);(0,-4)**[|<\afthickone>][#1]\crv{(-2,-2)&(-0.2,-1)};
( 2,4);(0,-4)**[|<\afthickone>][#2]\crv{( 2,-2)&( 0.2,-1)}}}%

\newcommand{\afcxqmauxps}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2,0)-<0.15\afelwidthcur,0pt>*{\afinvm};
( 2,0)+<0.15\afelwidthcur,0pt>*{\afinvm};
(-2,4);(0,-4)**[|<\afthickdouble>][#1][butt] \crv{(-2,-2)&(-0.2,-1)};
(-2,4);(0,-4)**[|<\afthicksep   >]    [white]\crv{(-2,-2)&(-0.2,-1)};
( 2,4);(0,-4)**[|<\afthickdouble>][#2][butt] \crv{( 2,-2)&( 0.2,-1)};
( 2,4);(0,-4)**[|<\afthicksep   >]    [white]\crv{( 2,-2)&( 0.2,-1)}}}%

\newcommand{\afcxqmauxpdf}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
< 0.15\afelwidthcur,\ifafdual-\fi0   \afelwidthcur>="A";
< 0.15\afelwidthcur,\ifafdual-\fi0.15\afelwidthcur>="B";
<-0.15\afelwidthcur,\ifafdual-\fi0.15\afelwidthcur>="C";
(-2,4)-"A";(0,-4)-"A"**[|<\afthickfive>][#1]\crv{(-2  ,-2   )-"B"&
                                                 (-0.2,-1   )-"B"};
(-2,4)+"A";(0,-4)+"A"**[|<\afthickfive>][#1]\crv{(-2  ,-2.15)+"B"&
                                                 (-0.2,-0.95)+"B"};
( 2,4)+"A";(0,-4)+"A"**[|<\afthickfive>][#2]\crv{( 2  ,-2   )-"C"&
                                                 ( 0.2,-1   )-"C"};
( 2,4)-"A";(0,-4)-"A"**[|<\afthickfive>][#2]\crv{( 2  ,-2.15)+"C"&
                                                 ( 0.2,-0.95)+"C"}}}%

\newcommand{\afcxqc}[8]{\multiply\afelwidth by#5%
                          \divide\afelwidth by#6%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-1.6,-0.8)*{\afll{#1}};
(-1.7, 1.3)*{\aflr{#2}};
( 1.7, 1.3)*{\afll{#3}};
( 1.6,-0.8)*{\aflr{#4}};
( 0  , 0  )*{\hbox{\ifafmult\ifvirginialakepdflatex
                    \afcxqmauxpdf{#7}{#8}\else
                    \afcxqmauxps {#7}{#8}\fi\else
                    \afcxqcaux   {#7}{#8}\fi}}}}%

\newcommand{\afcxqcauxx}[9]{\afcxqc{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

\newcommand{\afwxqaux}[5]{\afwaux{#1}{#2}{#5}}%

\newcommand{\afcxqaux}[9]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(0, 4.135)*{\hbox{\afcxqcauxx{#1}{#2}{#3}{#4}{#7}{#8}#9}};
(0, 0    )*{\hbox{\afwxqaux{#5}{#6}#9}};
(0,-4    )*{\afinvm}}}%

\newcommand{\afcxqauxdo}{\expandafter\afcxqaux\the\toks0\the\toks1}%

\newcommand\afrestparamss[3]{\toks1={{{#1}{#2}{#3}}}}%

\newcommand{\afcdX  }[8]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afCdX  }[8]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afcuX  }[8]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afCuX  }[8]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afcdnX }[6]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afCdnX }[6]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afcunX }[6]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afCunX }[6]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afcdXc }[8]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxqauxdo\afrestparamss}%

\newcommand{\afCdXc }[8]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxqauxdo\afrestparamss}%

\newcommand{\afcuXc }[8]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxqauxdo\afrestparamss}%

\newcommand{\afCuXc }[8]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxqauxdo\afrestparamss}%

\newcommand{\afcdnXc}[8]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afCdnXc}[8]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afcunXc}[8]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afCunXc}[8]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcxqaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

%-------------------- SHORT CONTRACTIONS

\newcommand{\afcxncaux}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2,2);(0,-2)**[|<\afthickone>][#1]\crv{(-2,-1)&(0,0.2)};
( 2,2);(0,-2)**[|<\afthickone>][#2]\crv{( 2,-1)&(0,0.2)}}}%

\newcommand{\afcxnmauxps}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-2,0)-<0.15\afelwidthcur,0pt>*{\afinvm};
( 2,0)+<0.15\afelwidthcur,0pt>*{\afinvm};
(-2,2);(0,-2)**[|<\afthickdouble>][#1][butt] \crv{(-2,-1)&(0,0.2)};
(-2,2);(0,-2)**[|<\afthicksep   >]    [white]\crv{(-2,-1)&(0,0.2)};
( 2,2);(0,-2)**[|<\afthickdouble>][#2][butt] \crv{( 2,-1)&(0,0.2)};
( 2,2);(0,-2)**[|<\afthicksep   >]    [white]\crv{( 2,-1)&(0,0.2)}}}%

\newcommand{\afcxnmauxpdf}[2]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
< 0.15\afelwidthcur,\ifafdual-\fi0   \afelwidthcur>="A";
< 0.15\afelwidthcur,\ifafdual-\fi0.15\afelwidthcur>="B";
<-0.15\afelwidthcur,\ifafdual-\fi0.15\afelwidthcur>="C";
(-2,2)-"A";(0,-2)-"A"**[|<\afthickfive>][#1]\crv{(-2,-1   )-"B"&(0,0.2 )-"B"};
(-2,2)+"A";(0,-2)+"A"**[|<\afthickfive>][#1]\crv{(-2,-1.08)+"B"&(0,0.25)+"B"};
( 2,2)+"A";(0,-2)+"A"**[|<\afthickfive>][#2]\crv{( 2,-1   )-"C"&(0,0.2 )-"C"};
( 2,2)-"A";(0,-2)-"A"**[|<\afthickfive>][#2]\crv{( 2,-1.08)+"C"&(0,0.25)+"C"}}}%

\newcommand{\afcxnc}[8]{\multiply\afelwidth by#5%
                          \divide\afelwidth by#6%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(-1.6,-0.9)*{\afll{#1}};
(-1.7, 1.3)*{\aflr{#2}};
( 1.7, 1.3)*{\afll{#3}};
( 1.6,-0.9)*{\aflr{#4}};
( 0  , 0  )*{\hbox{\ifafmult\ifvirginialakepdflatex
                      \afcxnmauxpdf{#7}{#8}\else
                      \afcxnmauxps {#7}{#8}\fi\else
                      \afcxncaux   {#7}{#8}\fi}}}}%

\newcommand{\afcxncauxx}[9]{\afcxnc{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%

\newcommand{\afwxnaux}[5]{\afwaux{#1}{#2}{#5}}%

\newcommand{\afcxnaux}[9]{%
\xybox{<\afelwidth,0pt>:<0pt,\ifafdual-\fi\afelheight>::
(0, 2)*{\hbox{\afcxncauxx{#1}{#2}{#3}{#4}{#7}{#8}#9}};
(0, 0)*{\hbox{\afwxnaux{#5}{#6}#9}};
(0,-4)*{\afinvm}}}%

\newcommand{\afcxnauxdo}{\expandafter\afcxnaux\the\toks0\the\toks1}%

\newcommand{\afcdx  }[8]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afCdx  }[8]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afcux  }[8]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afCux  }[8]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{{}{}{}}}%

\newcommand{\afcdnx }[6]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afCdnx }[6]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afcunx }[6]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afCunx }[6]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{}{}{}}}%

\newcommand{\afcdxc }[8]{\afstemtrue\afdualfalse\afmultfalse\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxnauxdo\afrestparamss}%

\newcommand{\afCdxc }[8]{\afstemtrue\afdualfalse\afmulttrue\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxnauxdo\afrestparamss}%

\newcommand{\afcuxc }[8]{\afstemtrue\afdualtrue\afmultfalse\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxnauxdo\afrestparamss}%

\newcommand{\afCuxc }[8]{\afstemtrue\afdualtrue\afmulttrue\afdiskfalse
                             \toks0={{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
                             \afterassignment\afcxnauxdo\afrestparamss}%

\newcommand{\afcdnxc}[8]{\afstemfalse\afdualfalse\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afCdnxc}[8]{\afstemfalse\afdualfalse\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afcunxc}[8]{\afstemfalse\afdualtrue\afmultfalse\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

\newcommand{\afCunxc}[8]{\afstemfalse\afdualtrue\afmulttrue\afdiskfalse
                             \afcxnaux{#1}{#2}{#3}{#4}{}{}{#5}{#6}{{#7}{#8}{}}}%

%-------------------- VERTICAL JUNCTIONS

\newcommand{\afvaux}[5]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#5\afelheight>::
(0,-#1);(0,#1)**[|<\afthickone>][#4]@{-};
(0, #1)-(0, 4)*{\afll{#2}};
(0, #1)-(0, 4)*{\aflr{#3}};
(0,  4)*{\afinvm};
(0, -4)*{\afinvm}}}%

\newcommand{\afVauxps}[5]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#5\afelheight>::
( 0   ,-#1);(0,#1)**[|<\afthickdouble>][#4][butt]@{-};
( 0   ,-#1);(0,#1)**[|<\afthicksep   >][white]   @{-};
( 0   , #1)-(0, 4)*{\afll{#2}};
( 0   , #1)-(0, 4)*{\aflr{#3}};
(-0.15,  4)*{\afinvm};
( 0.15, -4)*{\afinvm}}}%

\newcommand{\afVauxpdf}[5]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#5\afelheight>::
(-0.15,-#1);(-0.15,#1)**[|<\afthickfive>][#4]@{-};
( 0.15,-#1);( 0.15,#1)**[|<\afthickfive>][#4]@{-};
( 0   , #1)-(0,4)*{\afll{#2}};
( 0   , #1)-(0,4)*{\aflr{#3}};
( 0   ,  4)*{\afinvm};
( 0   , -4)*{\afinvm}}}%

\newcommand{\afVaux}[5]{\ifvirginialakepdflatex
                             \afVauxpdf{#1}{#2}{#3}{#4}{#5}\else
                             \afVauxps {#1}{#2}{#3}{#4}{#5}\fi}%

\newcommand{\afv  }[1]{\afvaux{#1}{}{}{}{}}%

\newcommand{\afvc }[2]{\afvaux{#1}{}{}{#2}{}}%

\newcommand{\afvd }[3]{\afvaux{#1}{#2}{#3}{}{}}%

\newcommand{\afvdc}[4]{\afvaux{#1}{#2}{#3}{#4}{}}%

\newcommand{\afvu }[3]{\afvaux{#1}{#2}{#3}{}{-}}%

\newcommand{\afvuc}[4]{\afvaux{#1}{#2}{#3}{#4}{-}}%

\newcommand{\afV  }[1]{\afVaux{#1}{}{}{}{}}%

\newcommand{\afVc }[2]{\afVaux{#1}{}{}{#2}{}}%

\newcommand{\afVd }[3]{\afVaux{#1}{#2}{#3}{}{}}%

\newcommand{\afVdc}[4]{\afVaux{#1}{#2}{#3}{#4}{}}%

\newcommand{\afVu }[3]{\afVaux{#1}{#2}{#3}{}{-}}%

\newcommand{\afVuc}[4]{\afVaux{#1}{#2}{#3}{#4}{-}}%

\newcommand{\afvdj}{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(0,-1);(0,1)**[|<\afthickone>]@{.}}}%

%---------------------- CURVED JUNCTIONS

\newcommand{\afjaux}[4]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#4\afelheight>::
( 0, #2)="A";
( 1, #2)="B";
( 0,-#2)="C";
( 1,-40)="D";
{"A";"B":"C";"D",x}="E";
( 1,-20)="F";
{"A";"C":"E";"F",x}="G";
(#1, #2)="H";
(#1,-#2)="I";
{"A";"I":"C";"H",x}="J";
{"G";"J":"H";"I",x}="K";
"A";"I"**[|<\afthickone>][#3]\crv{"G"&"K"}}}%

\newcommand{\afjmauxps}[4]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#4\afelheight>::
( 0, #2)="A";
( 1, #2)="B";
( 0,-#2)="C";
( 1,-40)="D";
{"A";"B":"C";"D",x}="E";
( 1,-20)="F";
{"A";"C":"E";"F",x}="G";
(#1, #2)="H";
(#1,-#2)="I";
{"A";"I":"C";"H",x}="J";
{"G";"J":"H";"I",x}="K";
"A"-<0.15\afelwidthcur,0pt>*{\afinvm};
"I"+<0.15\afelwidthcur,0pt>*{\afinvm};
"A";"I"**[|<\afthickdouble>][#3][butt]\crv{"G"&"K"};
"A";"I"**[|<\afthicksep   >][white]   \crv{"G"&"K"}}}%

\newcommand{\afjmauxpdf}[4]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#4\afelheight>::
( 0, #2)="A";
( 1, #2)="B";
( 0,-#2)="C";
( 0, #2)+(1,40)="D";
{"A";"B":"C";"D",x}="E";
( 0,#2)+(1,20)="F";
{"A";"C":"E";"F",x}="G";
(#1, #2)="H";
(#1,-#2)="I";
{"A";"I":"C";"H",x}="J";
{"G";"J":"H";"I",x}="K";
"A"-(.15,0 )="L";
"I"-(.15,0 )="M";
"G"-(.15,.3)="N";
"K"-(.15,.3)="O";
"L";"M"**[|<\afthickfive>][#3]\crv{"N"&"O"};
"A"+(.15,0 )="P";
"I"+(.15,0 )="Q";
"G"+(.15,.3)="R";
"K"+(.15,.3)="S";
"P";"Q"**[|<\afthickfive>][#3]\crv{"R"&"S"}}}%

\newcommand{\afjmaux}[4]{\ifvirginialakepdflatex
                             \afjmauxpdf{#1}{#2}{#3}{#4}\else
                             \afjmauxps {#1}{#2}{#3}{#4}\fi}%

\newcommand{\afjl }[2]{\afjaux{#1}{#2}{}{}}%

\newcommand{\afjlc}[3]{\afjaux{#1}{#2}{#3}{}}%

\newcommand{\afjr }[2]{\afjaux{#1}{#2}{}{-}}%

\newcommand{\afjrc}[3]{\afjaux{#1}{#2}{#3}{-}}%

\newcommand{\afJl }[2]{\afjmaux{#1}{#2}{}{}}%

\newcommand{\afJlc}[3]{\afjmaux{#1}{#2}{#3}{}}%

\newcommand{\afJr }[2]{\afjmaux{#1}{#2}{}{-}}%

\newcommand{\afJrc}[3]{\afjmaux{#1}{#2}{#3}{-}}%

\newcommand{\afex }[2]{\afexc{#1}{#2}{}{}}%

\newcommand{\afexc  }[4]{%
\xybox{<\afelwidth,0pt>:<0pt,\afelheight>::
(0,0)*{\hbox{\afjlc{#1}{#2}{#3}}};
(0,0)*{\hbox{\afjrc{#1}{#2}{#4}}}}}%

%-------------- TRIANGLES AND RECTANGLES

\newcommand{\afexpaux}[4]{\divide\afelheight by2%
\xybox{<\afelwidth,0pt>:<0pt,#4\afelheight>::
(#1, #2)+(#3,0);(0,-#2)**[|<\afthickone>]@{-};
(#1,-#2)+(#1,0)**[|<\afthicktwo>]@{-};
(#1, #2)+(#3,0)**[|<\afthickone>]@{-}}}%

\newcommand{\afexpd}[3]{\afexpaux{#1}{#2}{#3}{}}%

\newcommand{\afexpu}[3]{\afexpaux{#1}{#2}{#3}{-}}%

\newcommand{\affraux}[3]{\divide\afelheight by2%
\xybox{<.5\afelwidth,0pt>:<0pt,\afelheight>::
(0,0)*[#3]{%
\xybox{<.5\afelwidth,0pt>:<0pt,\afelheight>::
(-#1,-#2);
(-#1, #2)**[|<\afthicktwo>]@{-};
( #1, #2)**[|<\afthicktwo>]@{-};
( #1,-#2)**[|<\afthicktwo>]@{-};
(-#1,-#2)**[|<\afthicktwo>]@{-}}}}}%

\newcommand{\affr }[2]{\affraux{#1}{#2}{}}%

\newcommand{\affrb}[2]{\divide\afthicktwo by 4%
                       \affraux{#1}{#2}{F*:afbackground}}%

%------------------------------------------------ END OF MACROS FOR ATOMIC FLOWS

%----------------------------------------- \vlsmash, \vlupsmash AND \vldownsmash

\catcode`@=11

\def\upsmash{\relax % \relax, in case this comes first in \halign
  \ifmmode\def\next{\mathpalette\mathupsm@sh}\else\let\next\makeupsm@sh
  \fi\next}%
\def\makeupsm@sh#1{\setbox\z@\hbox{#1}\finupsm@sh}%
\def\mathupsm@sh#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\finupsm@sh}%
\def\finupsm@sh{\ht\z@\z@ \box\z@}%
\def\downsmash{\relax % \relax, in case this comes first in \halign
  \ifmmode\def\next{\mathpalette\mathdownsm@sh}\else\let\next\makedownsm@sh
  \fi\next}%
\def\makedownsm@sh#1{\setbox\z@\hbox{#1}\findownsm@sh}%
\def\mathdownsm@sh#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\findownsm@sh}%
\def\findownsm@sh{\dp\z@\z@ \box\z@}%

\newcommand{\vldownsmashend}{\egroup\downsmash{\vlread}}%

\newcommand{\vlupsmashend  }{\egroup  \upsmash{\vlread}}%

\newcommand{\vlsmashend    }{\egroup    \smash{\vlread}}%

\newcommand{\vldownsmash}{\strut\bgroup\vlprepstructures
                          \afterassignment\vldownsmashend\global\def\vlread}%

\newcommand{\vlupsmash  }{\strut\bgroup\vlprepstructures
                          \afterassignment  \vlupsmashend\global\def\vlread}%

\newcommand{\vlsmash    }{\strut\bgroup\vlprepstructures
                          \afterassignment    \vlsmashend\global\def\vlread}%

%---------------------------------- END OF \vlsmash, \vlupsmash AND \vldownsmash
