%% xyframe.tex from $Id: xyframe.doc,v 3.14 2012/05/24 00:30:38 krisrose Exp $
%%
%% Xy-pic ``Frames and Brackets'' extension.
%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@tug.org>
%%
%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
%% See the companion README and INSTALL files for further information.
%% Copyright (c) 1991-2011 Kristoffer H. Rose <krisrose@tug.org>
%%
%% The Xy-pic package is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by the
%% Free Software Foundation; either version 2 of the License, or (at your
%% option) any later version.
%%
%% The Xy-pic package is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this package; if not, see http://www.gnu.org/licenses/.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{frame}{Frame and Bracket extension}{\stripRCS$Revision: 3.14 $}%
 {Kristoffer H.~Rose}{krisrose@tug.org}%
 {IBM T.~ J.\ Watson Research Center, P.O.~Box 704, Yorktown Heights, NY 10598 (USA)}
\xydef@\frm{\hbox{}\dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@
 \ht\z@=\U@c \dp\z@=\D@c \dimen@=\U@c \advance\dimen@\D@c
 \ifdim\wdz@=\z@ \def\Leftness@{.5}\else \quotient@\Leftness@\L@c\wdz@ \fi
 \ifdim\dimen@=\z@ \def\Upness@{.5}\else \quotient@\Upness@\U@c\dimen@ \fi
 \expandafter\Edge@c\expandafter{\prevEdge@@}\let\frmradius@@=\z@
 \def\Drop@@{}%
 \def\Connect@@{\xy@@{\save@\cmerge@\Y@p\X@p\D@p\U@p\L@p\R@p\Drop@@}\restore}%
 \xyFN@\frm@i}
\xylet@\frmradius@@=\z@
\xydef@\frm@i{%
 \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\def\frmradius@@{##1}\xyFN@\frm@i}%
 \else \DN@##1##{\frm@{##1}}\fi \next@}
\xydef@\frm@#1#2{\DNii@{frm#1{#2}}%
 \expandafter\let\expandafter\next@\csname\codeof\nextii@\endcsname
 \ifx\next@\relax \DNii@{frm{#2}}%
 \expandafter\let\expandafter\next@\csname\codeof\nextii@\endcsname
 \ifx\next@\relax \let\next@=\frm@generic \fi\fi \next@}
\xydef@\frm@generic{\xyerror@{No generic frames yet!}{}}
\xydef@\frmDrop@#1{%
 \ifx\frmradius@@\z@ \addtoDrop@@{\let\frmradius@@=\z@ #1}%
 \else \expandafter\addtoDrop@@\expandafter{%
 \expandafter\def\expandafter\frmradius@@\expandafter{\frmradius@@}#1}\fi}
\xydef@\EdgefromtheEdge@{%
 \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
 \Edge@c={\expandafter\noexpand\the\Edge@c}}
\xydef@\prevEdgefromtheEdge@{%
 \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
 \noexpand\def\noexpand\prevEdge@@{\expandafter\noexpand\the\Edge@c}}
\xydef@\addtoDrop@@#1{%
 \expandafter\def\expandafter\Drop@@\expandafter{\Drop@@#1}}
\xydef@\addbeforeDrop@@#1{\DNii@{#1}%
 \expandafter\DN@\expandafter{\expandafter\nextii@\Drop@@}%
 \expandafter\expandafter\expandafter\def
 \expandafter\expandafter\expandafter\Drop@@
 \expandafter\expandafter\expandafter{\next@}}
\xydefcsname@{frm{}}{}
\xyletcsnamecsname@{frm[]{}}{frm{}}
\xyletcsnamecsname@{frm[o]{}}{frm{}}
\xydefcsname@{frm{.}}{\frmDrop@{\let\zerocorner=\framezerodot@@
 \let\framehfill=\frm@doth@@ \let\framevfill=\frm@dotv@@
 \framed@@{\frmradius@@}}}
\xyletcsnamecsname@{frm[]{.}}{frm{.}}
\xydef@\frm@doth@@{\setboxz@h{\kern5\B@\framezerodot@@\kern5\B@}\ht\z@=\B@
 \dp\z@=\B@\kern5\B@\xleaders\boxz@\hss\kern5\B@}
\xydef@\frm@dotv@@{\setboxz@h to2\B@{\hss\framezerodot@@\hss}\ht\z@=5\B@
 \dp\z@=5\B@\kern5\B@\xleaders\boxz@\vss\kern5\B@}
\xyletcsnamecsname@{frm{..}}{frm{.}}
\xylet@\framezerodot@@=\zerodot
\xydefcsname@{frm{-}}{\frmDrop@{\framed@\frmradius@@}}
\xyletcsnamecsname@{frm[]{-}}{frm{-}}
\xydef@\framed@{\let\zerocorner=\framezerodot@@
 \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@ \framed@@}
\xylet@\framesetthick@=\relax
\xydef@\frm@solidh@@{\framesetthick@\leaders\hrule height\B@ depth\B@\hfill}
\xydef@\frm@solidv@@{\framesetthick@\leaders\vrule width2\B@\vfill}
\xydefcsname@{frm{=}}{\frmDrop@{\framed@\frmradius@@
 {\advance\L@c-2\p@ \advance\R@c-2\p@ \advance\U@c-2\p@ \advance\D@c-2\p@
 \dimen@=\frmradius@@
 \ifdim\dimen@>2\p@ \advance\dimen@-2\p@ \else \dimen@=\z@\fi
 \framed@\dimen@}}}
\xyletcsnamecsname@{frm[]{=}}{frm{=}}
\xydef@\framesetthick@line{\B@=.5\xylinethick@}
\xydef@\frm@thickc@@{\hbox{\framesetthick@line
 \vrule height.5\B@ depth.5\B@ width\B@}}
\xywithoption{line}{%
 \let\framezerodot@@\frm@thickc@@ \let\framesetthick@=\framesetthick@line}
\xydef@\framed@@#1{\setboxz@h{\R@=#1\relax 
 \dimen@=\L@c \advance\dimen@\R@c \dimen@ii=\U@c \advance\dimen@ii\D@c
 \ifdim.5\dimen@<\R@ \R@=.5\dimen@ \fi
 \ifdim.5\dimen@ii<\R@ \R@=.5\dimen@ii \fi
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
 \ifdim\R@<\p@\else \cirrestrict@@ \fi
 \dimen@=2\R@ \advance\dimen@-\L@c \advance\dimen@-\R@c
 \ifdim\dimen@>\z@ \advance\A@-.5\dimen@ \fi
 \dimen@=2\R@ \advance\dimen@-\U@c \advance\dimen@-\D@c
 \ifdim\dimen@>\z@ \advance\B@-.5\dimen@ \fi
 \kern\A@ \raise\B@\vbox to \dimen@ii{\framed@body@@}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
\xydef@\framed@body@{%
 \advance\dimen@ii.22\p@ \advance\dimen@-.2\p@ 
 \setboxz@h{\corn@@4\R@}\A@=-.5\wdz@ \B@=.5\xydashw@
 \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@-.2\p@
 \setboxz@h to\dimen@{\kern\A@ \boxz@ \framehfill\corn@@3\R@\kern\A@}%
 \advance\dimen@ii-\dp\z@ \kern-\ht\z@ \nointerlineskip\boxz@
 \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@-.2\p@
 \setboxz@h to\dimen@{\kern\A@\corn@@1\R@\framehfill\corn@@2\R@\kern\A@}%
 \advance\dimen@ii-\ht\z@
 \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@.2\p@
 \nointerlineskip\hbox to\dimen@{%
 \setbox\z@=\vbox to\dimen@ii{\framevfill}\kern-.5\wdz@\copy\z@
 \hss \copy\z@\kern-.5\wdz@ }%
 \nointerlineskip\boxz@ \vss \kern\z@}
\xylet@\framed@body@@=\framed@body@
\xylet@\zerocorner=\framezerodot@@
\xydef@\solidcorner@#1#2{\hbox\bgroup \R@=#2\relax
 \ifdim\R@<\p@ \zerocorner
 \else \cirrestrict@@ \multiply\count@8
 \setboxz@h{\corn@x@@{#1}}\dimen@=\wdz@
 \ifcase#1\or \ht\z@=\z@ \kern\dimen@ \raise\dimen@\boxz@ 
 \or \ht\z@=\z@ \raise\dimen@\boxz@ \kern\dimen@
 \or \dp\z@=\z@ \lower\dimen@\boxz@ \kern\dimen@
 \or \dp\z@=\z@ \kern\dimen@ \lower\dimen@\boxz@ \fi
 \vrule height\dimen@ depth\dimen@ width\z@\fi
 \edef\tmp@{\egroup \U@c=\the\dimen@}\tmp@ \D@c=\U@c \L@c=\U@c \R@c=\U@c
 \Edge@c={\circleEdge}\ignorespaces}
\xydef@\corn@x@#1{\ifcase#1\or
 \circhar@@\z@ \circhar@@\@ne\or\circhar@@\tw@ \circhar@@3\or
 \circhar@@5\circhar@@4\or\circhar@@7\circhar@@6\fi}
\xylet@\corn@x@@=\corn@x@
\xydef@\corn@@{\DN@{\solidcorner@}%
 \ifx\framehfill\frm@doth@@ \DN@{\let\cirrestrict@@=\relax
 \let\corn@x@@=\dotcorner@@ \let\zerodot=\framezerodot@@
 \solidcorner@ }%
 \else\ifx\framehfill\frm@dashh@@ \DN@{\let\cirrestrict@@=\relax
 \let\corn@x@@=\dashcorner@@ \let\zerodot=\framezerodot@@
 \solidcorner@ }%
 \fi\fi \next@}
\xydef@\dotcorner@@#1{\zerocorner}
\xydef@\dashcorner@@#1{\zerocorner}
\xywithoption{curve}{%
 \let\dotcorner@@=\dotcorner@ \let\dashcorner@@=\dashcorner@}
\xydefcsname@{frm{--}}{%
 \frmDrop@{\let\zerocorner=\framezerodot@@ 
 \let\framehfill=\frm@dashh@@ \let\framevfill=\frm@dashv@@
 \framed@@\frmradius@@}}
\xyletcsnamecsname@{frm[]{--}}{frm{--}}
\xydef@\frm@dashh@@{\setboxz@h{\dashhfillchar}%
 \ht\z@=\B@ \dp\z@=\B@ \wdz@=2\xydashl@
 \copy\z@ \xleaders\copy\z@\hss \boxz@\kern-\xydashl@}
\xydef@\frm@dashv@@{\setboxz@h to2\B@{\hss\dashvfillchar\hss}\ht\z@=\z@
 \dp\z@=2\xydashl@ \nointerlineskip\copy\z@ \xleaders\copy\z@\vss
 \nointerlineskip\boxz@\kern-\xydashl@}%
\xydef@\dashhfillchar{{\rDirection@\xydashl@ \line@@}}
\xydef@\dashvfillchar{{\dDirection@\xydashl@ \line@@}}
\xydefcsname@{frm{o-}}{%
 \ifdim\frmradius@@<2\xydashl@\relax \dimen@=.8\xydashl@
 \expandafter\def\expandafter\frmradius@@\expandafter{\the\dimen@}\fi
 \frmDrop@{\let\zerocorner=\framezerodot@@ 
 \let\framehfill=\frm@rddashh@@ \let\framevfill=\frm@rddashv@@
 \framed@@\frmradius@@}}%
\xydef@\frm@rddashh@@{\setboxz@h{\kern\xydashl@\dashhfillchar}%
 \ht\z@=\B@ \dp\z@=\B@ \copy\z@ \xleaders\copy\z@\hss \boxz@ \kern\xydashl@}
\xydef@\frm@rddashv@@{\ifdim\dimen@ii<2\xydashl@\else
 \setbox\z@=\vbox to2\xydashl@{\hbox to2\B@{\hss\dashvfillchar\hss}\vss}%
 \kern\xydashl@ \copy\z@ \xleaders\copy\z@\vss
 {\ifdim\dimen@ii<2\xydashl@\else\aftergroup\boxz@\fi}\fi}
\xydefcsname@{frm{,}}{%
 \ifx\frmradius@@\z@ \shaded@{1.2\p@}\else \shaded@\frmradius@@ \fi}
\xydef@\shaded@#1{\frmDrop@{\R@=#1\relax
 {\advance\X@c\R@ \advance\Y@c-\D@c \U@c=\z@ \D@c=\R@ \blacked@}%
 {\advance\X@c\R@c \advance\Y@c-\R@ \L@c=\z@ \R@c=\R@ \blacked@}}}
\xydefcsname@{frm{-,}}{\addtoDrop@@{\drop\frm{-}\drop\frm{,}}}
\xydef@\blacked@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \dimen@=\L@c \advance\dimen@\R@c
 \B@=\Y@c \advance\B@-\D@c \dimen@ii=\Y@c \advance\dimen@ii\U@c
 \advance\A@-.5\xydashw@
 \kern\A@ \blacked@@ }%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
\xydef@\bblacked@{\setboxz@h{%
 \dimen@=\L@c \advance\dimen@\R@c \B@=-\D@c \dimen@ii=\U@c
 \kern-\L@c \blacked@@ \kern-\dimen@ \kern\L@c}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
\xydef@\blacked@@{\vrule width\dimen@ depth-\B@ height\dimen@ii}
\xydefcsname@{frm{o}}{%
 \ifx\frmradius@@\z@
 \frmDrop@{\dimen@=.5\L@c \advance\dimen@.5\R@c
 \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
 \circled@\dimen@}%
 \else
 \frmDrop@{\let\framehfill=\frm@solidh@@
 \let\framevfill=\frm@solidv@@ \circled@\frmradius@@}%
 \fi}
\xydefcsname@{frm{oo}}{%
 \ifx\frmradius@@\z@
 \frmDrop@{\dimen@=.5\L@c \advance\dimen@.5\R@c
 \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
 {\circled@\dimen@}\advance\dimen@-2.1\p@ \circled@\dimen@}%
 \else
 \frmDrop@{\dimen@=\frmradius@@
 \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
 {\circled@\dimen@}\advance\dimen@-2.1\p@ \circled@\dimen@}%
 \fi}
\xydef@\circled@#1{\setboxz@h\bgroup \R@=#1\relax 
 \setboxz@h{\vbox{\circled@x@@}}%
 \A@=\X@c \advance\A@-.5\wd\z@
 \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@ \advance\B@.2\p@
 \edef\tmp@{\egroup\dimen@=\the\wdz@}%
 \kern\A@ \raise\B@\boxz@
 \tmp@ \divide\dimen@4 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
\xydef@\circled@x@{\hbox{\corn@@4\R@ \corn@@3\R@}%
 \nointerlineskip\hbox{\corn@@1\R@ \corn@@2\R@}}
\xylet@\circled@x@@=\circled@x@
\xydefcsname@{frm{.o}}{%
 \ifx\frmradius@@\z@ \frmDrop@{\let\framehfill=\frm@doth@@ 
 \dimen@=.5\L@c \advance\dimen@.5\R@c \circled@\dimen@}%
 \else
 \frmDrop@{\let\framehfill=\frm@doth@@ \circled@\frmradius@@}%
 \fi}
\xydefcsname@{frm{-o}}{%
 \ifx\frmradius@@\z@ \frmDrop@{\let\framehfill=\frm@dashh@@
 \dimen@=.5\L@c \advance\dimen@.5\R@c \circled@\dimen@}%
 \else
 \frmDrop@{\let\framehfill=\frm@dashh@@ \circled@\frmradius@@}%
 \fi}
\xydefcsname@{frm{e}}{\ellipse@whichfrm@\ellipsesolidframed@}%
\xydefcsname@{frm{.e}}{\ellipse@whichfrm@\ellipsedotframed@}%
\xydefcsname@{frm{-e}}{\ellipse@whichfrm@\ellipsedashframed@}%
\xydefcsname@{frm{ee}}{\ellipse@whichdblfrm@\ellipsesolidframed@}%
\xydefcsname@{frm2{.e}}{\ellipse@whichdblfrm@\ellipsedotframed@}%
\xydefcsname@{frm2{-e}}{\ellipse@whichdblfrm@\ellipsedashframed@}%
\xyletcsnamecsname@{frm[o]{-}}{frm{e}}
\xyletcsnamecsname@{frm[o]{=}}{frm{ee}}
\xyletcsnamecsname@{frm[o]{.}}{frm{.e}}
\xyletcsnamecsname@{frm[o]{--}}{frm{-e}}
\xydef@\ellipse@whichfrm@#1{%
 \ifx\frmradius@@\z@
 \frmDrop@{#1\dimen@=.5\L@c \advance\dimen@.5\R@c
 \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@ }%
 \else
 \frmDrop@{#1\expandafter\ellipsed@i@\frmradius@@,,@@}%
 \fi}
\xydef@\ellipse@whichdblfrm@#1{%
 \ifx\frmradius@@\z@
 \frmDrop@{#1\dimen@=.5\L@c \advance\dimen@.5\R@c
 \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
 \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}\next@ }%
 \else
 \frmDrop@{#1\expandafter\ellipsed@ei@\frmradius@@,,@@}%
 \fi}
\xydef@\ellipsed@i@#1,#2,#3@@{\DNii@{,}\DN@{#3}%
 \ifx\next@\nextii@
 \dimen@=#1\relax \dimen@ii=#2\relax
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
 \else \ifx\next@\empty \DN@{#2}%
 \ifx\next@\empty \DN@{#1}%
 \dimen@=.5\L@c \advance\dimen@.5\R@c
 \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
 \else \dimen@=#1\relax
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
 \fi
 \else\xywarning@{ignoring extra tokens in elliptical frame: #3 }%
 \dimen@=#1\relax \dimen@ii=#2\relax 
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
 \fi\fi \next@ }
\xydef@\ellipsed@ei@#1,#2,#3@@{\DNii@{,}\DN@{#3}%
 \ifx\next@\nextii@
 \dimen@=#1\relax \dimen@ii=#2\relax 
 \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
 \else \ifx\next@\empty \DN@{#2}%
 \ifx\next@\empty \DN@{#1}%
 \dimen@=.5\L@c \advance\dimen@.5\R@c
 \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
 \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
 \else 
 \dimen@=#1\relax 
 \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@}}%
 \fi
 \else\xywarning@{ignoring extra tokens in elliptical frame: #3 }%
 \dimen@=#1\relax \dimen@ii=#2\relax 
 \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
 \fi\fi \next@ }
\xydef@\ellipsed@e@#1#2{%
 \dimen@=#1\relax \dimen@ii=#2\relax 
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@ 
 \dimen@=#1\relax \dimen@ii=#2\relax 
 \ifdim\dimen@>2\p@ \advance\dimen@-2\p@ \else \dimen@=\z@\fi
 \ifdim\dimen@ii>2\p@ \advance\dimen@ii-2\p@ \else \dimen@ii=\z@\fi
 \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@ }%
\xydef@\ellipsed@#1#2{\setboxz@h\bgroup \relax
 \setboxz@h{\vbox{\ellipsed@x@@{#1}{#2}}}%
 \A@=\X@c \advance\A@-.5\wd\z@
 \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@
 \edef\tmp@{\egroup\dimen@=\the\wdz@}%
 \kern\A@ \raise\B@\boxz@
 \tmp@ \divide\dimen@4 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
\xydef@\ellipsed@i#1#2{{\R@c=#1\relax\L@c=\R@c
 \U@c=#2\relax\D@c=\U@c \ellipsed@{#1}{#2}}}
\xydef@\ellipsed@x@#1#2{\R@=#1\relax\advance\R@#2\relax
 \divide\R@\tw@ \circled@x@@ }
\xylet@\ellipsed@x@@=\ellipsed@x@
\xydef@\ellipsesolidframed@{%
 \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@}
\xydef@\ellipsedotframed@{%
 \let\framehfill=\frm@doth@@ \let\framevfill=\frm@dotv@@}
\xydef@\ellipsedashframed@{%
 \let\framehfill=\frm@dashh@@ \let\framevfill=\frm@dashv@@}
\xydefcsname@{frm{\{}}{\addtoDrop@@{\lbraced}}
\xydefcsname@{frm{\}}}{\addtoDrop@@{\rbraced}}
\xydefcsname@{frm{^\}}}{\addtoDrop@@{\ubraced}}
\xydefcsname@{frm{_\}}}{\addtoDrop@@{\dbraced}}
\xydef@\dbraced{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@ \advance\B@-.5\ht\z@
 \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
 \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
 \advance\A@-.25pt
 \kern\A@\raise\B@\hbox{%
 \hbox to\L@c{$\m@th\bracelu\leaders\vrule\hfil\bracerd$}%
 \kern.5pt
 \hbox to\R@c{$\m@th\braceld\leaders\vrule\hfil\braceru$}}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\ubraced{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@\U@c
 \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@
 \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
 \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
 \advance\A@-.25pt
 \kern\A@\raise\B@\hbox{%
 \hbox to\L@c{$\m@th\braceld\leaders\vrule\hfil\braceru$}%
 \kern.5pt
 \hbox to\R@c{$\m@th\bracelu\leaders\vrule\hfil\bracerd$}}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
{\catcode`\"=12
 \global\mathchardef\braceur="338
 \global\mathchardef\braceul="339
 \global\mathchardef\bracedr="33A
 \global\mathchardef\bracedl="33B
 \global\mathchardef\bracecl="33C
 \global\mathchardef\bracecr="33D
 \global\mathchardef\bracec="33E }
\xydef@\lbraced{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracecl$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
 \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
 \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
 \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
 \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
 \kern\A@\raise\B@\vbox{\vbox to\U@c{%
 \nointerlineskip\hbox{$\m@th\braceur$}%
 \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.4\dimen@
 \nointerlineskip\hbox{$\m@th\bracecl$}\kern-.5\dimen@ii}%
 \nointerlineskip\vbox to\D@c{\kern.5\dimen@ii
 \kern-.4\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
 \nointerlineskip\hbox{$\m@th\bracedr$}\kern\z@}}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\rbraced{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@\R@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
 \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
 \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
 \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
 \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
 \kern\A@\raise\B@\vbox{\vbox to\U@c{%
 \nointerlineskip\hbox{$\m@th\braceul$}%
 \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.4\dimen@
 \nointerlineskip\hbox{$\m@th\bracecr$}\kern-.5\dimen@ii}%
 \nointerlineskip\vbox to\D@c{\kern.5\dimen@ii
 \kern-.4\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
 \nointerlineskip\hbox{$\m@th\bracedl$}\kern\z@}}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydefcsname@{frm{(}}{\addtoDrop@@{\lparenthesized}}
\xydefcsname@{frm{)}}{\addtoDrop@@{\rparenthesized}}
\xydefcsname@{frm{^)}}{\addtoDrop@@{\uparenthesized}}
\xydefcsname@{frm{_)}}{\addtoDrop@@{\dparenthesized}}
\xydef@\dparenthesized{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@ \advance\B@-.5\ht\z@
 \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
 \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
 \dimen@=\L@c \advance\dimen@\R@c
 \kern\A@\raise\B@\hbox to\dimen@{%
 $\m@th\bracelu\leaders\vrule\hfil\braceru$}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\uparenthesized{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@\U@c
 \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@
 \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
 \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
 \dimen@=\L@c \advance\dimen@\R@c
 \kern\A@\raise\B@\hbox to\dimen@{%
 $\m@th\braceld\leaders\vrule\hfil\bracerd$}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\lparenthesized{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
 \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
 \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
 \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
 \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
 \dimen@ii\U@c \advance\dimen@ii\D@c
 \kern\A@\raise\B@\vbox to \dimen@ii{%
 \nointerlineskip\hbox{$\m@th\braceur$}%
 \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
 \nointerlineskip\hbox{$\m@th\bracedr$}\kern\z@}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\rparenthesized{\xy@@{\setboxz@h{%
 \A@=\X@c \advance\A@\R@c \B@=\Y@c \advance\B@-\D@c
 \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
 \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
 \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
 \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
 \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
 \dimen@ii\U@c \advance\dimen@ii\D@c
 \kern\A@\raise\B@\vbox to \dimen@ii{%
 \nointerlineskip\hbox{$\m@th\braceul$}%
 \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
 \nointerlineskip\hbox{$\m@th\bracedl$}\kern\z@}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydefcsname@{frm{*}}{%
 \expandafter\frmDrop@\expandafter{%
 \expandafter\def\expandafter\prevEdge@@\expandafter{\prevEdge@@}%
 \frame@fill@@\frmradius@@}}
\xydefcsname@{frm{**}}{%
 \expandafter\frmDrop@\expandafter{%
 \expandafter\def\expandafter\prevEdge@@\expandafter{\prevEdge@@}%
 \frame@emph@@\frmradius@@}}
\xydef@\frame@fill@#1{\filled@{#1}\empty}
\xydef@\frame@emph@#1{\framed@\frmradius@@}
\xylet@\frame@fill@@=\frame@fill@
\xylet@\frame@emph@@=\frame@emph@
\xydef@\filled@#1{\R@=#1\relax 
 \expandafter\DNii@\expandafter{\prevEdge@@}%
 \DN@{\rectangleEdge}\ifx\next@\prevEdge@@
 \ifdim\R@=\z@ \DN@{\filled@Rectangle@}%
 \else \DN@{\filled@Oval@}\fi
 \else \DN@{\circleEdge}\ifx\next@\prevEdge@@
 \ifdim\R@=\z@ \DN@{\filled@Ellipse@}%
 \else \DN@{\restR@max\filled@Circle@}\fi
 \else 
 \ifdim\R@=\z@ \DN@{\filled@Rectangle@}%
 \else \DN@{\filled@Circle@}\fi
 \fi\fi \next@}
\xydef@\restR@max{%
 \dimen@=\L@c\advance\dimen@\R@c
 \dimen@ii=\U@c \advance\dimen@ii\D@c
 \ifdim\dimen@ii>\dimen@ \dimen@=\dimen@ii\fi
 \ifdim\dimen@>\z@ \divide\dimen@\tw@
 \ifdim\R@>\dimen@\R@=\dimen@\fi\fi }
\xylet@\filledRectangle@@=\bblacked@
\xylet@\filledCircle@@=\bblacked@
\xylet@\filledEllipse@@=\bblacked@
\xylet@\filledOval@@=\bblacked@
\xydef@\filled@Region@#1#2{\setboxz@h\bgroup 
 \setboxz@h{\vbox{#1#2\empty}}%
 \A@=\X@c \advance\A@-.5\wd\z@
 \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@ 
 \edef\tmp@{\egroup\dimen@=\the\wdz@}%
 \kern\A@ \raise\B@\boxz@ \kern-\A@
 \tmp@ \divide\dimen@\tw@ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \styledboxz@}
\xydef@\filled@Rectangle@{\filled@Region@\filledRectangle@@}
\xydef@\filled@Oval@{\filled@Region@\filledOval@@}
\xydef@\filled@Circle@{\filled@Region@\filledCircle@@}
\xydef@\filled@Ellipse@{\filled@Region@\filledEllipse@@}
\xydefcsname@{shape [F...]}#1{\xyFN@\Fshape@#1:@}
\xylet@\whichframe@@=\empty
\xylet@\whichoptions@@=\empty
\xydef@\Fshape@#1:{\def\whichframe@@{{#1}}%
 \DN@{{}}\ifx\whichframe@@\next@ \def\whichframe@@{{-}}\fi
 \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\circleEdge}\ifx\next@\nextii@
 \DN@##1{\def\whichframe@@{[o]##1}}%
 \expandafter\next@\expandafter{\whichframe@@}\fi
 \let\whichoptions@@=\empty \xyFN@\Fshape@i}
\xydef@\Fshape@i{%
 \ifx @\next \let\next@=\Fshape@x
 \else\addLT@\ifx\next \let\next@=\Fshape@iii
 \else \let\next@=\Fshape@ii \fi\fi \next@}
\xydef@\Fshape@ii#1:{%
 \expandafter\def\expandafter\whichoptions@@\expandafter{\whichoptions@@[#1]}%
 \xyFN@\Fshape@i}
\xydef@\Fshape@iii#1:{\DN@##1{\def\whichframe@@{#1##1}}%
 \expandafter\next@\expandafter{\whichframe@@}\xyFN@\Fshape@i}
\xydef@\Fshape@x @{%
 \edef\next@##1{\noexpand\addbeforeDrop@@{{\EdgefromtheEdge@##1}}}%
 \DNii@##1##2{\next@{\saveframestyles@{\setbox\z@=\object##2\frm##1%
 \xypre@Style@@\Drop@@\xypost@Style@@\restoreframestyles@}}}%
 \expandafter\expandafter\expandafter\nextii@
 \expandafter\expandafter\expandafter{%
 \expandafter\whichframe@@\expandafter}\expandafter{\whichoptions@@}}
\xydef@\saveframestyles@{%
 \expandafter\def\expandafter\afterframe@preStyle@\expandafter{\preXY@style@}%
 \expandafter\def\expandafter\afterframe@postStyle@\expandafter{\postXY@style@}}
\xydef@\restoreframestyles@{%
 \expandafter\gdef\expandafter\preXY@style@\expandafter{\afterframe@preStyle@}%
 \expandafter\gdef\expandafter\postXY@style@\expandafter{\afterframe@postStyle@}%
 \def\afterframe@preStyle@{}\def\afterframe@postStyle@{}}
\xydef@\xycircleframe@x@{\L@=\R@ \xycircleframe@x@i}%
\xydef@\xyellipseframe@x@#1#2{\R@=#1\relax \L@=#2\relax \xycircleframe@x@i}
\xydef@\xycircleframe@x@i{%
 \ifx\framehfill\frm@solidh@@\def\circleSTYLE@{}%
 \else\ifx\framehfill\frm@doth@@
 \expandafter\def\expandafter\circleSTYLE@\expandafter{\addDOT@{}}%
 \else\ifx\framehfill\frm@dashh@@
 \expandafter\expandafter\expandafter\def\expandafter\expandafter
 \expandafter\circleSTYLE@\expandafter\expandafter\expandafter
 {\expandafter\addDASH@\addDASH@{}}%
 \fi\fi\fi \xycircleframe@x@x }
\xydef@\xycircleframe@x@x{\hbox{\vbox{\vskip\L@
 \hbox to2\R@{\hfill \buildcircle@ \hfill}\vskip\L@ }}}
\xydef@\UseCurveFrames@{%
 \let\circled@x@@=\xycircleframe@x@
 \let\ellipsed@x@@=\xyellipseframe@x@ }
\def\UseCurveFrames{\xywithoption{curve}{\UseCurveFrames@}}%
\xydef@\UseFontFrames@{%
 \let\circled@x@@=\circled@x@
 \let\ellipsed@x@@=\ellipsed@x@ }
\xylet@\UseFontFrames=\UseFontFrames@
\xydef@\UnloadFrames@{%
 \let\framed@body@@=\framed@body@
 \let\circled@x@@=\circled@x@
 \let\ellipsed@x@@=\ellipsed@x@
 \let\frame@fill@@=\frame@fill@
 \let\frame@emph@@=\frame@emph@
 \let\filledRectangle@@=\bblacked@
 \let\filledCircle@@=\bblacked@
 \let\filledEllipse@@=\bblacked@
 \let\filledOval@@=\bblacked@
}
\xyaddunsupport{frame}\UnloadFrames@
\xyendinput
