%%
%% This is file `pl.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pl.dtx  (with options: `pl')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pl.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pl.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\def\filename{pl.doc}
\def\fileversion{3.0}
\def\filedate{1996/05/30}
\def\docversion{2.5}
\def\docdate{1995/11/28}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
   Prolog Documentation in LaTeX. Version \fileversion\@spaces gene \filedate
%%
%% Purpose:
%%   Style option for LaTeX to provide routines to document Prolog programs.
%%
%% Documentation: see seperate LaTeX document `pl.tex'
%%
%% Author: Gerd Neugebauer
%%         Mainzer Str. 8
%%         56321 Rhens (Germany)
%% Mail:   gerd@informatik.uni-koblenz.de
%%
%% Copyright (C) 1995-1996 Gerd Neugebauer
%%
%%  pl.doc is distributed in the hope  that it will  be useful, but WITHOUT
%%  ANY WARRANTY.    No author or   distributor accepts  responsibility  to
%%  anyone for the  consequences of using  it or for  whether it serves any
%%  particular purpose or works at all, unless he says so in writing.
%%
%%  Everyone is granted permission to copy, modify and redistribute pl.doc,
%%  provided this copyright notice  is preserved and any modifications  are
%%  indicated.
%%
%%
%%  This  style is still under  development and may  be replaced with a new
%%  version  which  provides an enhanced   functionality.  Any comments are
%%  welcome but don't expect ANY help from my side.
%%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\ifx\documentclass\relax \else
  \ProvidesPackage{pl}[\filedate\space gene (\fileversion)]
\fi
\def\PrologFont{\small\tt}
\def\PrologIndent{2em}
\def\PrologNumberFont{\tiny\rm}
\def\PrologRuleWidth{0pt}
\def\PrologListFont{\small\tt}
\def\PrologListIndent{2em}
\def\PrologModule#1#2{\section{The Module {\tt #1}}}
\def\PrologFile#1#2{\section{The File {\tt #1}}}
\def\PredicateFont{\tt}
\def\PredicateFileFont{\small\sf}
\def\PredicateSkip{\smallskip}
\def\PredicateIndent{5em}
\def\PredicateFileExtension{}
\def\PredicateFileWidth{5em}
\def\PredicateFileSep{1em}
\def\PredicateBoxSep{3pt}
\def\PredicateBoxRule{0.5pt}
\def\PredicateIndex#1{\index{#1}}
\newif\ifPrologNumberLines
\def\PrologEXPORTS{}
\def\PrologFILE{}
\def\PrologDialect#1{%
  \@ifundefined{PL@start@module@#1}%
                {\message{*** Prolog dialect #1 is undefined. Ignored.}}%
                {\gdef\PL@Dialect{#1}}}
\def\PL@Dialect{eclipse}
\gdef\PL@@delayed{}
\newcount\PL@line
\gdef\PL@code@setup{\PrologFont\parskip=0ex\parindent=0pt
  \ifx\PL@@delayed\empty\else%
    \parbox{\PrologIndent}{%
      \ifPrologNumberLines \PrologNumberFont \the\PL@line%
      \global\advance\PL@line1
      \else\ \fi}\PL@@delayed%
    \gdef\PL@@delayed{}\par
  \fi%
  \def\par{\leavevmode\egroup\box0\endgraf}
  \def\do##1{\catcode`##1=12 }\dospecials
  \obeyspaces
  \obeylines
  \catcode`\^^I=13
  \everypar{\parbox{\PrologIndent}{%
      \ifPrologNumberLines \PrologNumberFont \the\PL@line%
      \global\advance\PL@line1
      \fi
      \hfill}\PL@code@startbox}}
\def\PL@code@startbox{\setbox0=\hbox\bgroup}
{\catcode`\^^I=13
 \gdef^^I{\leavevmode\egroup
   \dimen0=\wd0 % the width so far, or since the previous tab
   \setbox1=\hbox{\PrologFont\space}\dimen1=8\wd1
   \divide\dimen0   by\dimen1
   \multiply\dimen0 by\dimen1 % compute previous multiple of tab
   \advance\dimen0  by\dimen1 % advance to next multiple of tab
   \wd0=\dimen0 \box0 \PL@code@startbox}%
}
{\obeyspaces\global\let =\ }
\def\PL*/{\PL@PL@init%
  \begingroup
  \PL@code@setup
  \PL@doPL}
{\catcode`\|=0 \catcode`\\=12
  |obeylines|gdef|PL@doPL^^M#1/*PL{#1|endgroup|PL@PL@exit}}
\def\PL@PL@init{%
        \ifdim\PrologRuleWidth>0pt%
          \par\noindent\rule{\textwidth}{\PrologRuleWidth}\par%
        \else\medskip\par\fi}
\def\PL@PL@exit{%
        \ifdim\PrologRuleWidth>0pt%
          \vspace{-2ex}\noindent\rule{\textwidth}{\PrologRuleWidth}\par%
        \else\smallskip\par\fi}
\def\PL@INIT{\begingroup\catcode`:=13\catcode`/=13}
\def\PL@EXIT{\endgroup}
\gdef\PrologInput{%
  \begingroup
  \catcode`\_=12
  \PL@Input
}
\PL@INIT
\gdef\PL@Input#1{%
  \gdef\PrologFILE{#1}%
  \gdef\PrologMODULE{}%
  \gdef\PrologEXPORTS{}%
  \global\PL@line=1%
  \endgroup
  \PL@INIT%
  \let:=\PL@COLON
  \let/=\PL@SLASH
  \input{#1}%
  \gdef\PrologFILE{}%
  \gdef\PrologMODULE{}%
  \gdef\PrologEXPORTS{}%
  }
\PL@EXIT
\def\EndProlog#1*/{}
\def\PL@SLASH{\@ifnextchar*{%
    \PL@EXIT
    \PL@US@start
    \PL@SLASH@STAR}{/}}
\def\PL@SLASH@STAR*{%
  \PrologFile{\PrologFILE}{}%
  \PL@US@end}
\def\PL@COLON{\@ifnextchar-{\PL@goal}{: }}
\def\PL@goal-{%
  \PL@EXIT
  \PL@US@start
  \@ifnextchar m{\csname PL@start@module@\PL@Dialect\endcsname}%
  {\@ifnextchar t{\PL@start@true}%
    {\csname PL@start@file@\PL@Dialect\endcsname}}}
\def\PL@start@true true. /*{%
  \PrologFile{\PrologFILE}{}%
  \PL@US@end}
\def\PL@start@module@eclipse module#1(#2). /*{%
  \global\PL@line=1
  \gdef\PL@@delayed{:- module#1(#2).}
  \gdef\PrologMODULE{#2}%
  \catcode`\,=13 %
  \PrologModule{\PrologFILE}{}%
  \PL@US@end}
\def\PL@start@module@quintus module(#1,{%
  \global\PL@line=1
  \gdef\PrologFILE{#1}%
  \catcode`\,=13 %
  \PL@start@module@quintus@}
\def\PL@start@module@quintus@[#1]). /*{%
  \gdef\PrologEXPORTS{#1}%
  \PrologModule{\PrologFILE}{#1}%
  \PL@US@end}
\let\PL@start@module@cprolog=\PL@start@module@quintus
\let\PL@start@module@sixtus=\PL@start@module@eclipse
\let\PL@start@module@swiprolog=\PL@start@module@quintus
\let\PL@start@module@sbprolog=\PL@start@module@quintus
\let\PL@start@module@binprolog=\PL@start@module@eclipse
\def\Predicate{\PL@US@start\Predicate@}
\def\Predicate@#1/#2(#3).{%
  \PredicateSkip\par\noindent%
  {\setbox1=\hbox{\PredicateFileFont \PrologFILE\PredicateFileExtension}%
   \fboxrule=\PredicateBoxRule%
   \fboxsep=\PredicateBoxSep%
   \fbox{\PredicateIndex{#1/#2}%
         \dimen255=\wd1
         \ifdim\dimen255<\PredicateFileWidth \dimen255=\PredicateFileWidth \fi
         \dimen255=-\dimen255
         \advance\dimen255 by-\PredicateFileSep
         \advance\dimen255 by \textwidth
         \parbox{\dimen255}{\raggedright
                 \setbox0=\hbox{\normalsize\PredicateFont #1(}
                 \dimen254=\wd0

                 \ifdim\dimen254>\PredicateIndent \dimen254=\PredicateIndent\fi
                 \dimen253=\dimen255 \advance\dimen253 by -\dimen254
                 \parshape=2 0mm \dimen255 \dimen254 \dimen253
                 \normalsize\PredicateFont #1\ifx\@empty#3 \else(#3)\fi
        }}%
    \hfill \box1\PredicateSkip\par
  }\PL@US@end}
\def\PrologList{\par\noindent%
  \PL@US@start
  \PrologListFont
  \catcode`\,=13%
  \parindent=\PrologListIndent\parskip=0pt\par
  \PL@List}
{\catcode`\,=13
\gdef\PL@List[#1]{%
  \def,{\par}%
  #1
  \PL@US@end\par}
}
\def\PrologListEXPORTS{\PrologList[\PrologEXPORTS]}
\def\PL@US@start{\begingroup\catcode`\_=13 }
\def\PL@US@end{\endgroup }
\def\WithUnderscore{\begingroup\catcode`\_=13 \With@Underscore}
\def\With@Underscore#1{#1\endgroup}
\def\Listing#1{\par\begingroup%
  \PL@line=1%
  \PL@code@setup%
  \input{#1}%
  \endgroup}
\endinput
%%
%% End of file `pl.sty'.
