<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%*****************************************************************************/
%*                                                                           */
%*      Version:  1.00   Date: 21/04/92   File: gn-logic14.tex               */
%* Last Version:                          File:                              */
%* Changes:                                                                  */
%* 30/12/90 First version of documentation.                                  */
%* 21/04/92 new properties                                                   */
%*                                                                           */
%* Title:                                                                    */
%* Author: Gerd Neugebauer                                                   */
%*                                                                           */
%* Usage:  latex gn-logic14.tex                                              */
%*                                                                           */
%*****************************************************************************/

\documentstyle[11pt,dina4,gn-logic14]{article}

\setlength{\unitlength}{1pt}


\begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newlength{\Width} \Width=\textwidth \advance\Width by -1.5em \divide\Width by 2

\section{The {\tt gn-logic} style option}
Description of Version 1.4 (5/95) by Gerd Neugebauer \bigskip

The {\tt gn-logic} style option provides a facility to typeset logical
formulas of a certain kind. This style option provides an environment like
\verb|eqnarray|, an extended {\tt newtheorem} environment and several macros.



\subsection{Mathematical Symbols}

The following marcos provide better usage of the junctors and quantifiers.
Especially the spacing  is improved.


\noindent\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*{4}{l}}
\multicolumn{1}{c}{\small Symbol}
	   &amp; \multicolumn{1}{c}{\small Macro}
			     &amp; 	\multicolumn{2}{c}{\small Example}	  \\
	   &amp;		     &amp;			      &amp; 		  \\
$\AND$	   &amp; \verb|\AND|     &amp; \verb$A\AND B$	      &amp; $A\AND B$	  \\
$\OR$	   &amp; \verb|\OR|	     &amp; \verb$A\OR B$	      &amp; $A\OR B$	  \\
$\XOR$	   &amp; \verb|\XOR|     &amp; \verb$A\XOR B$	      &amp; $A\XOR B$	  \\
$\IMPLIES$ &amp; \verb|\IMPLIES| &amp; \verb$A\IMPLIES B$     &amp; $A\IMPLIES B$	  \\
$\IMPL$	   &amp; \verb|\IMPL|    &amp; \verb$A\IMPL B$	      &amp; $A\IMPL B$	  \\
$\IF$	   &amp; \verb|\IF|	     &amp; \verb$A\IF B$	      &amp; $A\IF B$	  \\
$\IFF$	   &amp; \verb|\IFF|     &amp; \verb$A\IFF B$	      &amp; $A\IFF B$	  \\
$\IFFdef$  &amp; \verb|\IFFdef|  &amp; \verb$A\IFFdef B$      &amp; $A\IFFdef B$	  \\
$\ANDdots$ &amp; \verb|\ANDdots| &amp; \verb$A_1\ANDdots A_n$ &amp; $A_1\ANDdots A_n$ \\
$\ORdots$  &amp; \verb|\ORdots|  &amp; \verb$A_1\ORdots A_n$  &amp; $A_1\ORdots A_n$  \\
$\is$	   &amp; \verb|\is|	     &amp; \verb$x\is y$	      &amp; $x\is y$	  \\
$\Nat$	   &amp; \verb|\Nat|     &amp; \verb$n\in\Nat$	      &amp; $n\in\Nat$	  \\
$\Forall$  &amp; \verb|\Forall|  &amp; \verb$\Forall x P(x)$  &amp; $\Forall x P(x)$  \\
$\Exists$  &amp; \verb|\Exists|  &amp; \verb$\Exists y P(x)$  &amp; $\Exists y P(x)$  \\
\end{tabular*}


\newcommand{\bs}{{\tt\char"5C}}
\newcommand{\mac}[1]{The {\tt\char92 #1} Macro}
\newcommand{\macs}[2]{The {\tt\char92 #1} and the {\tt\char92 #2} Macros}
\newenvironment{compare}%
{\noindent\begin{center}%
  \begin{tabular}{@{}l@{\hspace*{1.5em}produces\hspace*{1.5em}}l@{}}}%
{\end{tabular}\end{center}}

\subsubsection*{\mac{AND}}
This macro can be used for the logical conjunction. In addition to the
\verb|\wedge| macro it adds more space and the formulas tend to be better
readable. Compare

\begin{compare}
\verb$x=1\AND y=x$	&amp; $x=1\AND y=x$		\\
\verb$x=1\wedge y=x$	&amp; $x=1\wedge y=x$	\\
\verb$x=1\land y=x$	&amp; $x=1\land y=x$
\end{compare}

\subsubsection*{\mac{OR}}
This macro can be used for the logical disjunction. In addition to the
\verb|\vee| macro it adds more space. Compare

\begin{compare}
\verb$x=1\OR y=x$	&amp; $x=1\OR y=x$	\\
\verb$x=1\vee y=x$	&amp; $x=1\vee y=x$	\\
\verb$x=1\lor y=x$	&amp; $x=1\lor y=x$
\end{compare}


\subsubsection*{\mac{XOR}}
This macro can be used for the exclusive disjunction. It has no common
counterpart. The spacing is like in in all junctor macros.

\begin{compare}
\verb$x=1\XOR y=x$	&amp; $x=1\XOR y=x$
\end{compare}


\subsubsection*{\macs{IMPL}{IMPLIES}}
These macros can be used for the logical implication. In addition to the
\verb|\rightarrow| macro it adds more space. Compare

\begin{compare}
\verb$x=1\IMPL y=x$		&amp; $x=1\IMPL y=x$	\\
\verb$x=1\IMPLIES y=x$		&amp; $x=1\IMPLIES y=x$	\\
\verb$x=1\rightarrow y=x$	&amp; $x=1\rightarrow y=x$
\end{compare}


\subsubsection*{\mac{IF}}
 This macro can be used for the logical implication written in reverse order.
In addition to the \verb|\leftarrow| macro it adds more space. Compare

\begin{compare}
\verb$x=1\IF y=x$		&amp; $x=1\IF y=x$	\\
\verb$x=1\lefttarrow y=x$	&amp; $x=1\leftarrow y=x$
\end{compare}

\subsubsection*{\mac{IFF}}
 This macro can be used for the logical equivalence.
In addition to the \verb|\leftrightarrow| macro it adds more space. Compare

\begin{compare}
\verb$x=1\IFF y=x$		&amp; $x=1\IFF y=x$	\\
\verb$x=1\leftrighttarrow y=x$	&amp; $x=1\leftrightarrow y=x$
\end{compare}

\subsubsection*{\mac{IFFdef}}
 Like above but with a small ``def'' above the arrow.

\begin{compare}
\verb$x=1\IFFdef y=x$		&amp; $x=1\IFFdef y=x$
\end{compare}

\subsubsection*{\mac{is}}
 This macro is for typesetting unifiers. In this case the predefined
\verb|\setminus| produces to much space.

\begin{compare}
\verb$\{y\setminus x, z\setminus 4\}$	&amp; $\{y\setminus x, z\setminus 4\}$ \\
\verb$\{y\is x, z\is 4\}$		&amp; $\{y\is x, z\is 4\}$		   \\
\verb$\{y\backslash x, z\backslash 4P}$	&amp; $\{y\backslash x, z\backslash 4\}$
\end{compare}

\ifx\AmSTeX\undefined
\def\AmSTeX{$\cal A$\kern-.1667em\lower.5ex\hbox
 {$\cal M$}\kern-.125em$\cal S$-\kern-.1em\TeX}
\fi

\subsubsection*{The Number Macros}
This are macros for those who have no access to the \AmSTeX{} fonts. It makes
the symbols for the natural numbers, integers, rationals, reals and complex
numbers. The usual magnification commands apply to it aswell.


\def\BB#1{\csname bb#1\endcsname}
\def\Line#1{\LINE{#1}\(\BB{#1}_{\BB{#1}}\)}
\def\LINE#1{{\tt \char92bb#1}&amp;%
  {\tiny\BB{#1}}&amp;%
  {\scriptsize\BB{#1}}&amp;%
  {\footnotesize\BB{#1}}&amp;%
  {\small\BB{#1}}&amp;%
  {\normalsize\BB{#1}}&amp;%
  {\large\BB{#1}}&amp;%
  {\Large\BB{#1}}&amp;%
  {\LARGE\BB{#1}}&amp;%
  {\huge\BB{#1}}&amp;%
  {\Huge\BB{#1}}&amp;%
  }
\begin{center}
  \begin{tabular}{c|cccccccccc|c}
    &amp;\multicolumn{10}{|c|}{{\tt \char92tiny \hfill...\hfill\char92normalsize \hfill...\hfill\char92Huge}}&amp;\verb|X_X|
    \\\hline
    \Line B\\
    \verb|\Complex|\Line C\\
    \Line D\\
    \Line E\\
    \Line F\\
    \Line G\\
    \Line H\\
    \Line I\\
    \Line J\\
    \Line K\\
    \Line L\\
    \Line M\\
    \verb|\Nat|  \Line N\\
    \Line O\\
    \Line P\\
    \verb|\Rat|  \Line Q\\
    \verb|\Real| \Line R\\
    \verb|\Int|  \Line Z\\
    \Line{One}
  \end{tabular}
\end{center}

Unfortunately the macros \verb|\bbC|, \verb|\bbG|, \verb|\bbO|, and
\verb|\bbQ| do not scale properly when used in subscripts or superscripts of
formulae. The following examples shows how the sizing can be achieved manually

\noindent\begin{compare}
\verb$\bbQ_{\mbox{\scriptsize \bbQ}}$  &amp; $\bbQ_{\mbox{\scriptsize \bbQ}}$
\end{compare}



\subsubsection*{\macs{Forall}{Exists}}
 The general problem with quantifies is that after the quantified variable the
following formula is not automatically seperated with a small space. This can
be overcome by the following macros.

The \verb|\Forall| and the \verb|\Exists| macros take one argument. They
typeset the respective quantifier followed by the argument (i.e.\ the variable)
and finally a small space. As usual the argument has to be enclosed in braces
if it consists of more than one character. Otherwise the braces can be omitted.
This allows a elegant notation of short quantified formulas.

\noindent\begin{compare}
\verb$\Forall x P(x)$  &amp; $\Forall x P(x)$\\
\verb$\Forall{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$%
&amp;$\Forall{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$\\
\verb$\Exists x P(x)$  &amp; $\Exists x P(x)$\\
\verb$\Exists{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$%
&amp; $\Exists{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$
\end{compare}



\subsection{The {\tt Formula} Environment}

This environment allows to typeset logical formulas. The main problem with the
\verb|eqnarray| environment was the numbering. In multiline formulas my
intention was to have the number in the middle of the formula. Inside this
environment several macros are valid.

\begin{description}
 \item[{\tt\bs begin\{Formula\}[{\em label}] \bs end\{Formula\}}] \ \\
	Start the list of formulas. Optionally a label can be given. This label
	is used to reference the first formula.
 \item[{\tt\bs =}] \ \\
	Start a new line.
 \item[{\tt\bs &gt;}{\em level}] \ \\
	Start a new line and indent to the given {\em level}. This indentation
	is done in quantities of \verb|\FormulaIndent| which can be set with
	the \verb|\setlength| command. The default value is {\tt 3em}.
 \item[{\tt\bs Form[{\em label}]}] \ \\
	Start a new formula. Optionally a {\em label} can be given. This {\em
	label} can be used to reference to the formula (see \verb|\ref|).
\end{description}

Now lets have a look at some examples. First, we see a single two-line formula.
Note that the number at the right side is centered between the two lines.
\medskip

\noindent
\begin{minipage}{\Width}
\small\begin{verbatim}
\begin{Formula}
    P(X) \IMPL
\=  Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}
\end{verbatim}
\end{minipage}
\hfill
\begin{minipage}{\Width}
\begin{Formula}
	P(X) \IMPL
\=	Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}
\end{minipage}\medskip

Next we will see an example of several formulas. The first formula is split to
three lines and the third line is indented to level 1. Remark: \verb|\=| is in
reality an abbrevation for \verb|\&gt;0|.
\medskip

\noindent
\begin{minipage}{\Width}
\small\begin{verbatim}
\begin{Formula}[form:1]
    P(X) \IMPL
\=  Q(X) \IFF R_1(X)
\&gt;1 \OR R_2(X)
\Form[form:2]
    S(X) \IMPL
\=  \neg Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}
\end{verbatim}
\end{minipage}
\hfill
\begin{minipage}{\Width}
\begin{Formula}[form:1]
    P(X) \IMPL
\=  Q(X) \IFF R_1(X)
\&gt;1 \OR R_2(X)
\Form[form:2]
    S(X) \IMPL
\=  \neg Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}
\end{minipage}\medskip


\subsection{The {\tt NewTheorem} Environment}

My experience with the {\tt newtheorem} environment was that I had a certain
scheme to use it. First, every theorem got a label. Thus, every {\em theorem}
was followed by a {\tt label} command. Optionally a {\em theorem} may have a
name. This name is typeset right after the number. The body of the {\em
  theorem} allways started in the next line. This let to the definition of an
extended {\tt NewTheorem} environment. The arguments are the same as those of
the {\tt newtheorem} environment. But the environment defined by this extended
command take two optional arguments. The first optional argument is a label to
be assigned to the {\em theorem}. This argument has to be enclosed in
parentheses. The second type of optional argument has to be enclosed in
brakets. It is typeset in \verb|\small| after the title text. The third
optional argument is enclosed in \verb|&lt;&gt;|. It is typeset in \verb|\small\bf|
and surrounded by parentheses.
\medskip

\noindent\begin{minipage}{\Width}
\small\begin{verbatim}

\NewTheorem{guess}{Conjecture}

\begin{guess}[Fermat](thm:fermat)
 There do not exist integers $n&gt;2$,
 $x$, $y$, and $z$ such that
 $x^n+y^n=z^n$.
\end{guess}
\end{verbatim}
\end{minipage}
\hfill
\begin{minipage}{\Width}
\NewTheorem{guess}{Conjecture}

\begin{guess}[Fermat](thm:fermat)
 There do not exist integers $n&gt;2$,
 $x$, $y$, and $z$ such that
 $x^n+y^n=z^n$.
\end{guess}
\end{minipage}
\medskip

The commands used to typeset some of the optional argument can be customized
in the following way. The macros \verb|\TheoremTitle| and \verb|\TheoremName|
are used to typeset their argument in \verb|\small| and \verb|\small\bf| and
enclosed in parentheses respectively. This macros can be redefined using
\verb|\renewcommand| as shown in the following example:
\medskip

\noindent\begin{minipage}{\Width}
\footnotesize\begin{verbatim}
\NewTheorem{theorem}{Theorem}
\renewcommand{\TheoremTitle}[1]{{\sf [#1]}}
\renewcommand{\TheoremName}[1]{{\small(#1)}}
\begin{theorem}[Fermat]&lt;conjecture&gt;(thm:f2)
 There do not exist integers ...
\end{theorem}
\end{verbatim}
\end{minipage}
\hfill
\begin{minipage}{\Width}
\NewTheorem{theorem}{Theorem}
\renewcommand{\TheoremTitle}[1]{{\sf #1}}
\renewcommand{\TheoremName}[1]{{\small(#1)}}
\begin{theorem}[Fermat]&lt;conjecture&gt;(thm:f2)
 There do not exist integers $n&gt;2$,
 $x$, $y$, and $z$ such that
 $x^n+y^n=z^n$.
\end{theorem}
\end{minipage}

\end{document}



\newcommand{\ENTRY}[1]{{#1 \Nat}&amp; {#1 \Int}&amp; {#1 \Rat}&amp;{#1 \Real}&amp; {#1 \Complex}}

\begin{center}
\begin{tabular}{l|ccccc}
&amp;\verb|\Nat|&amp;\verb|\Int|&amp;\verb|\Rat|&amp;\verb|\Real|&amp;\verb|\Complex|\\
&amp;&amp;\\\hline&amp;&amp;\\
\verb$\tiny$		&amp; \ENTRY{\tiny}		\\
\verb$\scriptsize$	&amp; \ENTRY{\scriptsize}	\\
\verb$\footnotesize$	&amp; \ENTRY{\footnotesize} \\
\verb$\small$		&amp; \ENTRY{\small}	\\
\verb$\normalsize$	&amp; \ENTRY{\normalsize}	\\
\verb$\large$		&amp; \ENTRY{\large}	\\
\verb$\Large$		&amp; \ENTRY{\Large}	\\
\verb$\LARGE$		&amp; \ENTRY{\LARGE}	\\
\verb$\huge$		&amp; \ENTRY{\huge}		\\
\verb$\Huge$		&amp; \ENTRY{\Huge}
\end{tabular}\end{center}
</pre></body></html>