% LAST EDIT: Sun Nov  5 17:23:43 1995 by Privat (basti!pepper) 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The LaTeX2e variant of the "program" style
%
% by P. Pepper
%
% (Note: This package is almost completely written in TeX!)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tubprogram}[1994/10/22 Berlin program package (v 0.1)]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Load other packages
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\RequirePackage{xspace}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Options (none available)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%     +-------------------------------------------------------+
%     | User Interface: The macros usable in texts or         |
%     |                 in the definition of derived styles   |
%     +-------------------------------------------------------+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% The main environments: "program" and "embeddedprogram"
%% ---------------------
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\newenvironment{program}[1][plain]{%               % LaTeX!
   \Begin@Program#1\@ParEnd%                       %
   }{%                                             %
   \End@Program%                                   %
   }%                                              %
%                                                  %
\newenvironment{embeddedprogram}{%                 % LaTeX!
   \Begin@EmbeddedProgram%                         %
   }{%                                             %
   \End@EmbeddedProgram%                           %
   }%                                              %
%                                                  %
\def\({\begin{embeddedprogram}}%                   %
\def\){\end{embeddedprogram}}%                     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% variables that are globally used
%%           (and can be customized by the user)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\newdimen\ProgramWidth\ProgramWidth=\the\textwidth%%
\newdimen\ProgramIndent\ProgramIndent=2mm%         %
\newdimen\ProgramInnerIndent\ProgramInnerIndent=4mm%
\newdimen\ProgramSkip\ProgramSkip = 8pt%           %
\newdimen\CommentSkip\CommentSkip = 2em%           %
\def\EnableSpecialSymbols{\@EnableSpecialSymbols}% %
\def\DisableSpecialSymbols{\@DisableSpecialSymbols}%
%                                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% \Program@Prelude: Standard commands that are generally available 
%% ----------------  within program environments
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                  %
\def\Program@Prelude{%                             %
   \let\|=\Open@Tab%                               %
   \let\[=\Open@Tab%                               %
   \let\]=\Close@Tab%                              %
   \let\&=\Set@Tab%                                %
   \let\>=\Shift@TabRight%                         %
   \let\<=\Shift@TabLeft%                          %
   \let\%=\@ContinueLine%                          %
   \let\==\Continue@Tab%                           %
   \let\+=\Null@Tab%                               %
   \def\Phantom{\hbox to 0.1pt{}}%                 %
   \newcommand{\Shrink}[1][0pt]{\@Shrink{##1}}%    % LaTeX!
   \let\rule=\@ShortRule%                          %
   \let\Rule=\@LongRule%                           %
   \newcommand{\Comment}[2][f]{\Begin@MediumComment{##1}{##2}}%  LaTeX!
   \let\EndComment=\End@MediumComment%             %
   \newcommand{\BigComment}[2][f]{\Begin@BigComment{##1}{##2}}%  LaTeX!
   \let\EndBigComment=\End@BigComment%             %
   \def\Continue{\Continue@Tab}%                   %
   \def\`##1'{\KeyWord{##1}}%                      %
   }%                                              %
%                                                  %
\def\EmbeddedProgram@Prelude{%                     %
   \def\`##1'{\KeyWord{##1}}%                      %
   }%                                              %
\def\Language@Prelude{\relax}%                     % to be set by special syles
\def\EmbeddedLanguage@Prelude{\relax}%             % to be set by special syles
\def\ProgramPrelude{\relax}%                       % to be set by user
\def\EmbeddedProgramPrelude{\relax}%               % to be set by user
%                                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% program environment
%% -------------------
%%         starts DisplayProgram environment (option "plain")
%%         or     FramedProgram  environment (option "framed")
%%         the environment assumes that TeX is in vertical mode.
%%
%%         variables: \ProgramWidth  (length)
%%                    \ProgramIndent (length)
%%                    \ProgSkip      (length)
%%
%%         macros:    \Program@Prelude
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\Begin@Program#1#2\@ParEnd{%                    %
   \bgroup%                                         % --------- begin group
   \if#1f \gdef\Program@Prolog{\FramedProgram@Prolog}%                    |
          \gdef\Program@Epilog{\FramedProgram@Epilog}%                    |
   \else \gdef\Program@Prolog{\DisplayProgram@Prolog}%                    |
         \gdef\Program@Epilog{\relax}%              %                     |
   \fi%                                             %                     |
   \Program@Prolog%                                 %                     |
   \Start@Program%                                  %                     |
   }%                                               %                     |
\def\End@Program{%                                  %                     |
   \Finish@Program%                                 %                     |
   \Program@Epilog%                                 %                     |
   \egroup%                                         % ----------- end group
   \vskip\ProgramSkip%                              %
   }%                                               %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% \DisplayProgram@Prolog
   %%        sets the \ProgramWidth appropriately
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %                                                %
\def\DisplayProgram@Prolog{%                        %
   \advance\ProgramWidth by -2\ProgramIndent%       %
   \vskip\ProgramSkip%                              %
   }%                                               %
%                                                   %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% \FramedProgram@Prolog/@Epilog
   %%       generate a box around the program
   %%       (construction follows the TeXbook, p. 223)
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\FramedProgram@Prolog{%                         %
   \vtop\bgroup\hrule%                              % vbox{--------------+
        \hbox to\ProgramWidth\bgroup\vrule%         %  hbox{-----------+ |
              \advance\ProgramWidth by -1pt%        %                  | |
                           \vbox\bgroup\kern3pt%    %   vbox{--------+ | |
   }%                                               %                | | |
\def\FramedProgram@Epilog{%                         %                | | |
                           \kern3pt\egroup%         %       }--------+ | |
        \hss\vrule\egroup%                          %      }-----------+ |
   \hrule\egroup%                                   %     }--------------+
   }%                                               %
   %                                                %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% \Start@Program  (in vertical mode)
   %%                 executes the genaral \Program@Prelude
   %%                 starts the first table (\halign)
   %%                 starts program fragment
   %% \Finish@Program ends program fragment
   %%                 ends last table
   %%
   %%   variables: \@TabNesting (TeX counter)
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %                                                %
\newif\if@CancelLine%                               %
\def\Start@Program{%                                %
   \Define@ProgramKeyWords%                         %
   \Program@Prelude%  % standard actions            %
   \Language@Prelude% % customized by other styles  %
   \ProgramPrelude%   % customized by user          %
   \@TabNesting=0%                                  %
   \@CancelLinetrue%                                %
   \BeginMain@Tab%                                  % ---------------open table
   \Begin@Fragment%                                 %                         |
   }%                                               %                         |
%                                                   %                         |
\def\Finish@Program{%                               %                         |
   \End@ProgramFragment%                            %                         |
   \Close@TabsDownTo{1}%                            % close forgotten table(s)|
   \EndMain@Tab%                                    % --------------close table
   }%                                               %
   %                                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  EmbeddedProgram environment: reduced program environment to be used
%%  -----------------------  embedded in text passages
%%
%%      \Begin@EmbeddedProgram   starts the environment
%%      \End@EmbeddedProgram     end the environment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\Begin@EmbeddedProgram{%                        %
   \bgroup$%                                        % ----------- begin group
   \Define@EmbeddedProgramKeyWords%                 %                       |
   \EmbeddedProgram@Prelude%                        %                       |
   \EmbeddedLanguage@Prelude%                       %                       |
   \EmbeddedProgramPrelude%                         %                       |
   \if@SpecSymb \Set@SpecialSymbols \fi%            %                       |
   \@NoSpace%                                       %                       |
   }%                                               %                       |
\def\End@EmbeddedProgram{%                          %                       |
   $\egroup%                                        % ------------- end group
   }%                                               %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  KeyWord definition macros
%%  ------- - \TopKeyWords      can introduce {SIGNATURE,THEORY,...}
%%          - \MainKeyWords     can introduce {IMPORT,FUN,DEF,...}
%%          - \FollowKeyWords   can introduce {ONLY,COMPLETELY...}
%%          - \BeginKeyWords    can introduce {IF,LET,...}
%%          - \ThenLikeKeyWords can introduce {THEN,...}
%%          - \ElseLikeKeyWords can introduce {ELSE,IN,...}
%%          - \EndKeyWords      can introduce {FI,...}
%%          - \PlainKeyWords    can introduce {AS,...}
%%  (all these macros take a comma-separated list of keywords as argument)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newcommand{\MainKeyWords}[2][*]{%                  %
   \if#1>\@KeyWordList{Main}{#2}%                   %
   \else \@KeyWordList{Top}{#2} \fi%                %
   }%                                               %
\def\FollowKeyWords#1{\@KeyWordList{Follow}{#1}}%   %
\def\BeginKeyWords#1{\@KeyWordList{Begin}{#1}}%     %
\newcommand{\InnerKeyWords}[2][*]{%                 %
   \if#1<\@KeyWordList{Else}{#2}%                   %
   \else \@KeyWordList{Then}{#2} \fi%               %
   }%                                               %
\def\EndKeyWords#1{\@KeyWordList{End}{#1}}%         %
\def\PlainKeyWords#1{\@KeyWordList{Plain}{#1}}%     %
%                                                   %
\def\KeyWord#1{\textsc{\lowercase{#1}}}%            % default
%                                                   %
\def\Define@ProgramKeyWords{%                       %
   \let\Top@KW=\Top@KeyWord%                        %
   \let\Main@KW=\Main@KeyWord%                      %
   \let\Follow@KW=\Follow@KeyWord%                  %
   \let\Begin@KW=\Begin@KeyWord%                    %
   \let\Then@KW=\Then@KeyWord%                      %
   \let\Else@KW=\Else@KeyWord%                      %
   \let\End@KW=\End@KeyWord%                        %
   \let\Plain@KW=\Plain@KeyWord%                    %
   }%                                               %
\def\Define@EmbeddedProgramKeyWords{%               %
   \let\Top@KW=\Plain@KeyWordR%                     %
   \let\Main@KW=\Plain@KeyWordR%                    %
   \let\Follow@KW=\Plain@KeyWord%                   %
   \let\Begin@KW=\Plain@KeyWordR%                   %
   \let\Then@KW=\Plain@KeyWord%                     %
   \let\Else@KW=\Plain@KeyWord%                     %
   \let\End@KW=\Plain@KeyWordL%                     %
   \let\Plain@KW=\Plain@KeyWord%                    %
   }%                                               %
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \KeyWordList extends the comma-separated list of keywords
%%              by `@;' (for termination) and calls \DefineList
%% \DefineList  consumes the list and calls \DefineOne on each element
%% \DefineOne   turns its argument into a globally defined KeyWord
%%              (using \NormalDefinition for making an "\hbox"
%%               or \ShrinkedDefinition for making an "\hbox to #2")
%% \EndList     consumes the termination symbol
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\@KeyWordList#1#2{%                             %
   \bgroup%                                         %
      \def\@DefineList ##1,##2\@DefineList{%        %
         \@DefineOne ##1[]@\@DefineOne%             %
         \if##2@ \def\@DefineList{\@EndList}\fi%    % terminate
         \@DefineList ##2\@DefineList%              %
         }%                                         %
      \def\@EndList ##1\@DefineList{\relax}%        % consume `@;'
      %                                             %
      \def\@DefineOne##1[##2]##3##4\@DefineOne{%    %
         \if##3@ \@NormalDefinition{##1}%           %
           \else \@ShrinkedDefinition{##1}{##2} \fi%%
         }%                                         %
      \def\@NormalDefinition##1{%                   %
         \expandafter\gdef\csname ##1\endcsname{%   %
                  \csname #1@KW\endcsname{\hbox{\@KeyWord{##1}}}%
                  }%                                %
         }%                                         %
      \def\@ShrinkedDefinition##1##2{%              %
         \expandafter\gdef\csname ##1\endcsname{%   %
                  \csname #1@KW\endcsname{\hbox to ##2{\@KeyWord{##1}\hss}}%
                  }%                                %
         }%                                         %
   %                                                %
   \@DefineList #2,@\@DefineList%                   %
   \egroup%                                         %
   }%                                               %
%                                                   %
\def\@KeyWord#1{\KeyWord{#1}}%                      %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Keyword macros for layouting
%% -------------- interact closely with the tabular-environment
%%                they finish the current program fragment
%%                they set necessary tabstops etc.
%%                finally, they start the new program fragment
%%     - \Top@KeyWord     (SIGNATURE, THEORY, ...)
%%     - \Main@KeyWord    (IMPORT, FUN, DEF, ...)
%%     - \Follow@KeyWord  (ONLY, COMPLETELY, ...)
%%     - \BeginKeyWord    (IF, LET, ...)
%%     - \Then@KeyWord    (THEN, ...)
%%     - \Else@KeyWord    (ELSE, IN, ...)
%%     - \End@KeyWord     (FI, ...)
%%
%%     variables: \@TabLevel
%%                \Save@TabLevel
%%                \@TabNesting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newif\if@FirstBeginKW%                             %
\def\Top@KeyWord#1{%                                % e.g. SIGNATURE
   \gdef\Main@KeyWordIndent{0pt}%                   %
   \Main@KeyWord{#1}%                               %
   \gdef\Main@KeyWordIndent{\ProgramInnerIndent}%   %
   }%                                               %
 \def\FRAGMENT{%                                    %
   \Main@KeyWord{}%                                 %
   }%                                               %
\def\Main@KeyWord#1{%                               % e.g. IMPORT, DEF
   \End@Fragment%                                   %
   \Close@TabsDownTo{1}%                            %
   \if@CancelLine \EndMain@Tab%                     %
                  \vskip-\baselineskip%             %
                  \BeginMain@Tab%                   %
   \else%                                           %
                  \BreakOrContinue@Tab%             %
   \fi%                                             %
   \global\@CancelLinefalse%                        %
   \ifdim\wd\@FragmentBox>0pt%                      %
         \box\@FragmentBox%                         %
   \fi%                                             %
   #1 % (keyword)    (note the blank!               %
   \gdef\Set@TabStops{\AddOne@TabStop}%             %
   \global\@FirstBeginKWtrue%                       %
   \Begin@Fragment%                                 %
   }%                                               %
\def\Follow@KeyWord#1{%                             % e.g. ONLY, COMPLETELY
   \End@Fragment%                                   %
   \global\@TabLevel=1%                             %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                              \box\@FragmentBox{ }% % (note the blank!)
   \fi %                                            %
   \global\@TabLevel=1%                             %
   \Set@TabStops%                                   %
   #1 % (keyword)     (note the blank!              %
   \Begin@Fragment%                                 %
   }%                                               %
\def\Begin@KeyWord#1{%                              % e.g. IF, LET
   \End@Fragment%                                   %
   \if@CancelLine \EndMain@Tab%                     %
                  \vskip-\baselineskip%             %
                  \gdef\Set@TabStops{\gdef\Set@TabStops{\AddOne@TabStop}}%
                  \@FirstBeginKWtrue%               %
   \fi%                                             %
   \global\@CancelLinefalse%                        %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                              \box\@FragmentBox%    %
                              \Begin@Tab%           %
   \else\if@FirstBeginKW      \Set@TabStops%        %
                              \Begin@Tab%           %
   \else                      \global\@TabLevel=0%  %
                              \Set@TabStops%        %
   \fi\fi%                                          %
   #1 % (keyword)                                   %
   \global\@FirstBeginKWfalse%                      %
   \Begin@Fragment%                                 %
}%                                               %
\def\Then@KeyWord#1{%                               % e.g. THEN
   \Finish@Fragment{\relax} %                       %
   \Set@TabStops%                                   %
   #1 % (keyword)                                   %
   \Begin@Fragment%                                 %
   }%                                               %
\def\Else@KeyWord#1{%                               % e.g. ELSE, IN
   \Finish@Fragment{\global\advance\@TabLevel by-1} %
   \Set@TabStops%                                   %
   #1 % (keyword)                                   %
   \Begin@Fragment%                                 %
   }%                                               %
\def\End@KeyWord#1{%                                % e.g. FI
   \Finish@Fragment{\global\@TabLevel=0} %          %
   \Set@TabStops%                                   %
   #1% (keyword)     (note the non-blank!           %
   \Virtual@TabEnd%                                 %
   \Begin@Fragment%                                 %
   }%                                               %
\def\Plain@KeyWord#1{\ #1\ \@NoSpace}%              % e.g. AS
\def\Plain@KeyWordL#1{\ #1}%                        %
\def\Plain@KeyWordR#1{#1\ \@NoSpace}%               %
%                                                   %
\def\@Shrink#1{%                                    % shorten lengthy fragment
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt %                     %
         \Set@TabStops%                             %
         \hbox to #1{\box\@FragmentBox\hss}%        %
   \fi %                                            %
   \Begin@Fragment%                                 %
   }%                                               %
\def\@Width{}%                                      %
\def\Null@Tab{%                                     %
   \gdef\@Width{to 0pt}%                            %
   \Begin@KeyWord{\hskip-0pt}%                      %
   \global\@FirstBeginKWtrue%                       %
   }%                                               %
\def\Open@Tab{%                                     % \[
   \Begin@KeyWord{\hskip-0pt}%                      %
   }%                                               %
\def\Close@Tab{%                                    % \]
   \End@KeyWord{}%                                  %
   }%                                               %
\def\Shift@TabRight{%                               % \>
   \global\advance\@TabLevel by 1%                  %
   }%                                               %
\def\Shift@TabLeft{%                                % \<
   \global\advance\@TabLevel by-1%                  %
   }%                                               %
\def\Set@Tab{%                                      % \&
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                             \box\@FragmentBox%     %
   \else \Set@TabStops%                             %
   \fi %                                            %
   \Begin@Fragment%                                 %
   \global\advance\@TabLevel by -1%                 %
   }%                                               %
\def\@ShortRule{%                                   %
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                             \box\@FragmentBox%     %
   \fi%                                             %
   \crcr\noalign{\vskip6pt\hrule}%                  %
   \Begin@Fragment%                                 %
   }%                                               %
\def\@LongRule{%                                    %
   \End@Fragment%                                   %
   \Close@TabsDownTo{1}%                            %
   \EndMain@Tab%                                    %
   \vskip3pt%                                       %
   \hrule width\ProgramWidth%                       %
   \vskip3pt%                                       %
   \@CancelLinetrue%                                %
   \BeginMain@Tab%                                  %
   \Begin@Fragment%                                 %
   }%                                               %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End-of-Line activities
%% ----------------------
%%     \@EoL  completes current program fragment box;
%%           if nonempty, it is output with necessary leading tabstops;
%%           then the table line is completed with \cr;
%%           
%%           
%%           
%%                         
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\@EndOfLine{%                                   %
   \Finish@Fragment{\relax}%                        %
   \DoPending@TabCloses%                            %
   \gdef\Set@TabStops{%                             %
       \crcr%                                       %
       \AllThe@TabStops{\the\@TabLevel}%            %
       \gdef\Set@TabStops{\AddOne@TabStop}%         %
       }%                                           %
   \Begin@Fragment%                                 %
   }%                                               %
%                                                   %
\let\@EoL=\@EndOfLine%                              % default
\def\@ContinueLine{%                                %
   \def\@EoL{ \let\@EoL=\@EndOfLine}%               %
   }%                                               %
\def\Set@TabStops{%                                 % initial default
   \AllThe@TabStops{\the\@TabLevel}%                %
   }%                                               %
\def\AddOne@TabStop{%                               %
   \global\advance\@TabLevel by 1%                  %
   \@TabStopSymb%                                   %
   }%                                               %
\newcount\@LoopCount%                               %
\def\AllThe@TabStops#1{%                            %
    \global\@LoopCount=#1%                          %
    \ifnum #1>0 %                                   %
           \@TabStopSymb%                           %
           \advance\@LoopCount by -1%               %
           \AllThe@TabStops{\the\@LoopCount}%       %
    \fi%                                            %
    }%                                              %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Table-building macros
%% ---------------------
%%     \Begin@Tab            starts a new \halign
%%                         increases \@TabNesting,
%%                         stacks old \@TabLevel, sets actual one to 0
%%     \End@Tab           closes \halign, resets the counters
%%     \Close@TabsDownTo    closes as many tables as necessary to reach
%%                         the desired \@TabNesting value
%%     \DoPending@TabCloses closes (at "end of line") as many tables as
%%                         there have been closing keywords in the line
%%
%%     variables: \@TabLevel
%%                \Save@TabLevel
%%                \@TabNesting
%%                \@TabsToBeClosed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newcount\@TabLevel%                                %
\newcount\Save@TabLevel%                            %
\newcount\@TabNesting%                              %
\newcount\@TabsToBeClosed%                          %
\@TabsToBeClosed=0%                                 %
%                                                   %
\def\Begin@Tab{%                                    %
   \relax%                                          %
   \ifnum \the\@TabNesting>0 %                      %
          \BeginInner@Tab%                          %
   \else  \BeginMain@Tab%                           %
   \fi%                                             %
   }%                                               %
%                                                   %
\def\End@Tab{%                                      %
   \ifnum \the\@TabNesting>1 %                      %
          \EndInner@Tab%                            %
   \else  \ifnum \the\@TabNesting=1 %               %
                 \EndMain@Tab%                      %
          \else  \relax%                            %
          \fi%                                      %
   \fi%                                             %   
   }%                                               %
%                                                   %
\def\Main@KeyWordIndent{0pt}%                       % default
%                                                   %
\def\BeginBasic@Tab{%                               %
   \Save@TabLevel=\the\@TabLevel%                   % stack old @TabLevel
   \global\@TabLevel=0%                             % 
   \global\@TabsToBeClosed=0%                       %
    \vtop\bgroup%                                   % ---------------open table
       \halign\@Width\bgroup &##\hss\cr%            %                         |
       \gdef\@Width{}%                              %                         |
   }%                                               %                         |
\def\EndBasic@Tab{%                                 %                         |
   \ifnum\the\@TabNesting<1%                        %                         |
   \PackageError{tubprogram}{Too many tabular environments closed}{}%         |
   \else%                                           %                         |
       \strut\crcr%                                 %                         |
     \egroup%    (the \halign-group)                %                         |
   \egroup%        (the \vtop-group)                % --------------close table
   \fi}%                                            %
\def\BeginMain@Tab{%                                %
   \global\@TabNesting=1%                           % 
   \hbox to \ProgramWidth \bgroup%                  % ----------------open hbox
     \hskip\ProgramIndent\hskip\Main@KeyWordIndent% %                         |
     \BeginBasic@Tab%                               %                         |
   }%                                               %                         |
%                                                   %                         |
\def\EndMain@Tab{%                                  %                         |
     \EndBasic@Tab%                                 %                         |
     \hss%                                          %                         |
   \egroup%        (the \hbox-group)                % ---------------close hbox
   \global\@TabNesting=0%                           %
   }%                                               %
%                                                   %
\def\BeginInner@Tab{%                               %
   \global\advance\@TabNesting by 1%                % number of nested tables
   \BeginBasic@Tab%                                 %
   }%                                               % 
\def\EndInner@Tab{%                                 %
   \EndBasic@Tab%                                   %
   \global\advance\@TabNesting by -1%               %
   \global\@TabLevel=\the\Save@TabLevel%            %
   }%                                               %
%                                                   %
\def\Break@Tab{%                                    %
   \EndMain@Tab%                                    %
   \BeginMain@Tab}%                                 %
\def\Continue@Tab{%                                 %
   \gdef\BreakOrContinue@Tab{%                      %
        \crcr%                                      %
        \@TabLevel=0%                               %
        \gdef\BreakOrContinue@Tab{\Break@Tab}%      %
        }%                                          %
   }%                                               %
%                                                   %
\def\BreakOrContinue@Tab{\Break@Tab}%               % default
%                                                   %
\def\Close@TabsDownTo#1{%                           %
   \relax%                                          %
   \ifnum \the\@TabNesting>#1 %                     %
          \End@Tab%                                 %
          \Close@TabsDownTo{#1}%                    %
   \fi%                                             %
   }%                                               %
%                                                   %
\def\DoPending@TabCloses{%                          %
   \relax%                                          %
   \ifnum \the\@TabsToBeClosed>0 %                  %
          \End@Tab%                                 %
          \global\advance\@TabsToBeClosed by -1%    %
          \DoPending@TabCloses%                     %
   \fi %                                            %
   }%                                               %
\def\Virtual@TabEnd{%                               %
   \global\advance\@TabsToBeClosed by 1%            %
   }%                                               %
\def\@TabStopSymb{&}%                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ProgramFragment environment (the lowest macro level)
%% ---------------------------
%%     \Begin@Fragment        (default for \Begin@ProgramFragment)
%%     \End@Fragment          (default for \End@ProgramFragment)
%%
%%     \Begin@ProgramFragment starts an \hbox
%%                           makes <ret> active (= \@EoL); starts math
%%     \End@ProgramFragment   ends math; resets <ret> to its old status
%%                           finishes the hbox
%%     variables: \@FragmentBox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newbox\@FragmentBox%                               %
%                                                   %
\def\Begin@Fragment{\Begin@ProgramFragment}%        % default
\def\End@Fragment{\End@ProgramFragment}%            % default
%                                                   %
\def\Begin@ProgramFragment{%                        %
   \global\setbox\@FragmentBox=\hbox\bgroup%        % ----- open \@FragmentBox
   \if@SpecSymb \Set@SpecialSymbols \fi%            %                        |
%   \@NoSpace%                                       %                        |
   \@SetSpace%                                      %                        |
   \def\par{\@EoL}%                                 %                        |
   \obeylines%                                      %                        |
   $}%                                              %                        |
\def\End@ProgramFragment{%                          %                        |
   $%                                               %                        |
   \UnSet@SpecialSymbols%                           %                        |
   \strut%                                          %                        |
   \egroup%                                         % ---- close \@FragmentBox
   }%                                               %
   %                                                %
\def\Finish@Fragment#1{%                            %
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                              \box\@FragmentBox%    %
                              \@CancelLinefalse%    %
   \else #1 %                                       %
   \fi %                                            %
   }%                                               %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Comments
%% --------
%%    \@LineComment    makes the rest of the line into a comment
%%                     starting with \quad space and \LineCommentSymbol;
%%                     the comment is set in italic.
%%    \@AlignedComment analogous to \@LineComment,
%%                     but aligns the comments in a table column.
%%    \Begin@BigComment/End@BigComment
%%                     enclose a comment area which is the whole program
%%                     width;
%%                     the comment can be written as a standard paragraph;
%%                     only possible at the level of top/main keywords;
%%                     options: [r(ules)]: a rule at top and bottom
%%                              [f(rame)]: a frame around the comment
%%    \Begin@MediumComment/End@MediumComment
%%                     analogous to BigComment, but now the area is only
%%                     the current indentation level
%%                     
%% Primitive macros:
%%    \Begin@CommentFragment (analogous to \Begin@ProgramFragment)
%%    \End@CommentFragment   (analogous to \End@ProgramFragment)
%% Variables:
%%    \@FragmentBox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\CommentFont{\itshape}%                         %
\def\LineCommentSymbol{\texttt{--}}%                %
\def\LineComment{\@LineComment}                     %
%
\def\@LineComment{%                                 %
   \Finish@Fragment{\relax}%                        %
   \gdef\Begin@Fragment{\Begin@CommentFragment}%    %
   \gdef\End@Fragment{\End@CommentFragment}%        %
   \gdef\Set@TabStops{\relax}%                      %
   \Begin@CommentFragment%                          %
   }%                                               %
\def\@AlignedComment{%                              %
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                             \box\@FragmentBox%     %
   \else \Set@TabStops%                             %
   \fi %                                            %
   \gdef\Begin@Fragment{\Begin@CommentFragment}%    %
   \gdef\End@Fragment{\End@CommentFragment}%        %
   \Begin@CommentFragment%                          %
   \global\advance\@TabLevel by -1%                 %
   }%                                               %
\def\Begin@CommentFragment{%                        %
   \global\setbox\@FragmentBox=\hbox\bgroup%        % ------open \@FragmentBox
   \let\par=\@EoL%                                  %                        |
   \obeylines%                                      %                        |
   \hskip\CommentSkip\LineCommentSymbol%            %                        |
   \CommentFont%                                    %                        |
   }%                                               %                        |
\def\End@CommentFragment{%                          %                        |
   \egroup%                                         % -----close \@FragmentBox
   \gdef\Begin@Fragment{\Begin@ProgramFragment}%    %
   \gdef\End@Fragment{\End@ProgramFragment}%        %
   }%                                               %
   %                                                %
\newif\if@CommentRule%                              %
\newif\if@CommentFrame%                             %
\newdimen\@CommentBoxWidth%                         %
%                                                   %
\def\Begin@BigComment#1{%                           %
   \if#1f \global\@CommentFrametrue%                %
          \global\@CommentRuletrue  \fi%            %
   \if#1r \global\@CommentRuletrue \fi%             %
   \End@Fragment%                                   %
   \Close@TabsDownTo{1}%                            %
   \EndMain@Tab%                                    %
   \@CommentBoxWidth=\the\ProgramWidth%             %
   \advance\@CommentBoxWidth by -2\ProgramIndent%   %
   \advance\@CommentBoxWidth by +6pt%               %
   \moveright\ProgramIndent%                        %
   \vbox\bgroup%                                    % ------------- begin vbox
   \vskip3pt%                                       %                        |
   \if@CommentRule \hrule width\@CommentBoxWidth\fi%%                        |
   \if@CommentFrame \hbox to \ProgramWidth\bgroup%  % ----------- begin hbox |
                    \vrule\kern3pt               \fi%                      | |
   \vbox\bgroup%                                    % --------- begin vbox | |
   \vskip3pt%                                       %                    | | |
   \parindent=0pt%                                  %                    | | |
   \hsize=\the\ProgramWidth%                        %                    | | |
   \advance\hsize by -2\ProgramIndent%              %                    | | |
   \CommentFont%                                    %                    | | |
   }%                                               %                    | | |
\def\End@BigComment{%                               %                    | | |
   \vskip3pt%                                       %                    | | |
   \egroup%                                         % ----------- end vbox | |
   \if@CommentFrame \kern2pt\vrule\hss\egroup \fi%  % ------------- end hbox |
   \if@CommentRule \hrule width\@CommentBoxWidth\fi%%                        |
   \egroup%                                         % ----------------end vbox
   \global\@CommentRulefalse%                       %
   \global\@CommentFramefalse%                      %
   \@CancelLinetrue%                                %
   \BeginMain@Tab%                                  %
   \Begin@Fragment%                                 %
   }%                                               %
%                                                   %
\def\Begin@MediumComment#1#2{%                      %
   \if#1f \global\@CommentFrametrue%                %
          \global\@CommentRuletrue \fi%             %
   \if#1r \global\@CommentRuletrue \fi%             %
   \End@Fragment%                                   %
   \ifdim\wd\@FragmentBox>0pt \Set@TabStops%        %
                             \box\@FragmentBox%     %
   \fi%                                             %
   \crcr\noalign\bgroup%                            % ---------- begin noalign
   \@CommentBoxWidth=#2%                            %                        |
   \advance\@CommentBoxWidth by -0.5pt%             %                        |
      \vskip6pt%                                    %                        |
      \if@CommentRule \hrule width\@CommentBoxWidth\fi%                      |
      \hbox to #2\bgroup%                           % ---------- begin hbox  |
        \if@CommentFrame \vrule\kern3pt \fi%        %                     |  |
        \hsize=#2%                                  %                     |  |
        \advance\hsize by -9pt%                     %                     |  |
        \parindent=0pt%                             %                     |  |
        \CommentFont%                               %                     |  |
        \vbox\bgroup\kern3pt%                       % ------- begin vbox  |  |
   }%                                               %                  |  |  |
\def\End@MediumComment{%                            %                  |  |  |
        \vskip2pt%                                  %                  |  |  |
        \kern3pt\egroup\hss%                        % --------- end vbox  |  |
        \if@CommentFrame \kern3pt\vrule \fi%        %                     |  |
      \egroup%                                      % ------------ end hbox  |
      \if@CommentRule\hrule width\@CommentBoxWidth \fi%                      |
   \egroup%                                         % ------------ end noalign
   \global\@CommentRulefalse%                       %
   \global\@CommentFramefalse%                      %
   \Begin@Fragment%                                 %
   }%                                               %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Special Symbols (Macros for setting them)
%%          - SetSymbol (allows the addition of new "active symbols"
%%          - Set@SpecialSymbols contains the "active" symbols
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newif\if@SpecSymb%                                 %
\def\@EnableSpecialSymbols{\global\@SpecSymbtrue}%  %
\def\@DisableSpecialSymbols{\global\@SpecSymbfalse}%%
\@EnableSpecialSymbols%                             % default
\def\Set@SpecialSymbols{\relax}%                    % 
\def\UnSet@SpecialSymbols{\relax}%                  %
%                                                   %
\def\SpecialSymbol#1#2{%                            %
\toks0=\expandafter{\Set@SpecialSymbols}%           %
\toks1={\catcode`#1=\active\let#1=#2}%              %
\global\edef\Set@SpecialSymbols{\the\toks0 \the\toks1}%
}%                                                  %
%                                                   %
{%% begin group for definition environment          % ---------- begin group
 \catcode`\,=\active%                               %                      |
 \catcode`\.=\active%                               %                      |
 \catcode`\ =\active\let =\space%                   %                      |
\gdef\Set@SpecialSymbols{%                          % --- SpecialSymbols   |
\catcode`\,=\active\let,=\@Comma%                   %                  |   |
\catcode`\.=\active\let.=\@Dot%                     %                  |   |
\catcode`\ =\active\let =\@Blank%                   %                  |   |
}%                                                  % --- SpecialSymbols   |
}% end  group for definition environment            % ------------ end group
%%                                                  %
\def\@Comma{\mathrel{,}}%                           %
\def\@Dot{\mathrel{.}}%                             %
\def\@Blank{\futurelet\next\@BlankA}%               %
\def\@BlankA#1{%                                    %
\if\string#1 \relax\@Gobble%                        %
\else\ifcat\noexpand#1\@letter\@OneSpace%           %
\else %                                             %
\fi\fi%                                             %
\next%                                              %
}%                                                  %
\def\@Gobble{\gdef\@Next{\relax}}%                  %
\def\@OneSpace{\ }%                                 %
\def\@NoSpace{\gdef\@OneSpace{\relax\gdef\@OneSpace{\ }}}%
\def\@SetSpace{\gdef\@OneSpace{\ }}%                %
\let\@letter=A%                                     %
%                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Special Symbols
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\newif\if@Ascii%                                    %
\def\AsciiOn{\global\@Asciitrue}%                   %
\def\AsciiOff{\global\@Asciifalse}%                 %
\AsciiOff%                                          % default
\def\@Text#1{#1}%                                   %
%                                                   %
\def\Leq{\if@Ascii\@Text{<=}\else \leq\fi}%                %
\def\Ll{\if@Ascii\@Text{<<}\else \ll\fi}%                  %
\def\LG{\if@Ascii\@Text{<>}\else \diamond\fi}%             %
\def\Geq{\if@Ascii\@Text{>=}\else \geq\fi}%                %
\def\Gg{\if@Ascii\@Text{>>}\else \gg\fi}%                  %
\def\TriangleLeft{\if@Ascii\@Text{<|}\else \triangleleft\fi}%
\def\TriangleRight{\if@Ascii\@Text{|>}\else \triangleright\fi}%
\def\AND{\if@Ascii\@Text{ and }\else \wedge\fi}%           %
\def\OR{\if@Ascii\@Text{ or }\else \vee\fi}%                  %
\def\Not{\if@Ascii\@Text{~}\else \neg\fi}%              %
\def\Neq{\if@Ascii\@Text{/=}\else \not=\fi}%               %
\def\VDash{\if@Ascii\@Text{|-}\else \vdash\ \fi}%            %
\def\Models{\if@Ascii\@Text{|=}\else \models\fi}%          %
\def\TwoEq{\if@Ascii\@Text{==}\else \ ==\ \fi}%            %
\def\To{\if@Ascii\@Text{->}\else \rightarrow\fi}%          %
\def\Cross{\if@Ascii\@Text{**}\else \times\fi}%            %
\def\Implies{\if@Ascii\@Text{=>}\else \Rightarrow\fi}%     %
\def\Iff{\if@Ascii\@Text{<=>}\else \Leftrightarrow\fi}%    %
\def\Slash{\if@Ascii\@Text{/}\else \mathrel{/}\fi}%                  %
\def\Union{\if@Ascii\@Text{ union }\else \mathrel{\cup}\fi}%         %
\def\Intersect{\if@Ascii\@Text{ intersect }\else \mathrel{\cap}\fi}% %
\def\SubSet{\if@Ascii\@Text{ subset }\else \subseteq\fi}%  %
\def\EmptySet{\if@Ascii\@Text{ emptyset }\else \emptyset\fi}%
\def\All{\if@Ascii\@Text{forall }\else \forall\,\fi}%      %
\def\Exists{\if@Ascii\@Text{exists }\else \exists\,\fi}%   %
\def\BackSlash{\if@Ascii\@Text{\char`\\}\else\setminus\fi}%%
\def\SemOpen{\if@Ascii\@Text{[[}\else\@SemOpen\fi}%        %
\def\SemClose{\if@Ascii\@Text{]]}\else\@SemClose\fi}%      %
\def\Compose{\if@Ascii\@Text{ . }\else\@Compose\fi}%       %
\def\LAMBDA{\if@Ascii\@Text{\char`\\\char`\\}\else\lambda\fi}%
\def\TwoBars{\if@Ascii\@Text{\char`\|\char`\|}\else\@Bar\fi}%
\def\LessDot{\if@Ascii\@Text{\char`\<\char`\.}\else\mathrel{\lessdot}\fi}%
\def\GreaterDot{\if@Ascii\@Text{\char`\<\char`\.}\else\mathrel{\gtrdot}\fi}%
%                                                          %
\def\@SemOpen{\mathopen{[\hskip-0.4em[\hskip1pt}}%%
\def\@SemClose{\mathclose{]\hskip-0.37em]}}%
\def\@Compose{\mathbin{\raisebox{1pt}{$\scriptstyle{\circ}$}}}%%
\def\@Bar{|}%
%\def\{{\mathopen{\char`\{\hskip1pt}}
%\def\}{\mathopen{\hskip1pt\char`\}}}
%                                                          %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Miscellaneous
%%          - \Language: produce a language name
%%          - \DefLanguage: produce a macro for a language name
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                   %
\def\Language#1{\textsc{#1}\xspace}                 % LaTeX2e !
\def\DefLanguage#1{%                                %
   \expandafter\def\csname #1\endcsname{%           %
               \textsc{#1}\xspace}%                 %
   }%                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of file `tubprogram.sty'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


