\newcommand{\header}[1]{{\large\bfseries\boldmath{\color{blue}#1}\par}}
\newcommand{\headerc}[1]{\begin{center}\large\bfseries\boldmath{\color{blue}#1}\end{center}}
\newcommand{\red}[1]{{\everymath{\color{red}}\color{red}#1}}
\newcommand{\green}[1]{{\everymath{\color{green}}\color{green}#1}}
\newcommand{\blue}[1]{{\everymath{\color{blue}}\color{blue}#1}}
\newcommand{\black}[1]{{\everymath{\color{black}}\color{black}#1}}

\newcommand{\nat}{\mathbb{N}}
\newcommand{\real}{\mathbb{R}}
\newcommand{\rational}{\mathbb{Q}}

\def\kub(#1)#2{
  \put(#1){\makebox(0,0){%
    \begin{graph}(0,0)
      \area(0,0){(1,0)(1,1)(0,1)(0,0)}
      \freetext(.5,.5){\small #2}
    \end{graph}
  }}
}
\def\pyr(#1)#2{
  \put(#1){\makebox(0,0){%
    \begin{graph}(0,0)
      \area(0,0){(1,0)(.5,1)(0,0)}
      \freetext(.5,.3){\small #2}
    \end{graph}
  }}
}
\def\ont(#1){%
  \def\tmp{#1}%
  \ifx\tmp\empty\ensuremath{\mathsf{On\_table}}\else%
    \ensuremath{\mathsf{On\_table}(#1)}%
  \fi%
}
\def\on(#1){%
  \def\tmp{#1}%
  \ifx\tmp\empty\ensuremath{\mathsf{On}}\else%
    \ensuremath{\mathsf{On}(#1)}%
  \fi%
}
\def\isc(#1){%
  \def\tmp{#1}%
  \ifx\tmp\empty\ensuremath{\mathsf{Is\_cube}}\else%
    \ensuremath{\mathsf{Is\_cube}(#1)}%
  \fi%
}
\def\isp(#1){%
  \def\tmp{#1}%
  \ifx\tmp\empty\ensuremath{\mathsf{Is\_pyramid}}\else%
    \ensuremath{\mathsf{Is\_pyramid}(#1)}%
  \fi%
}
\def\opp(#1){%
  \def\tmp{#1}%
  \ifx\tmp\empty\ensuremath{\mathsf{opposite}}\else%
    \ensuremath{\mathsf{opposite}(#1)}%
  \fi%
}

\newenvironment{named}[1]{%
  \begin{description}
  \item[\blue{\underline{\sffamily#1}}]
}{\end{description}}

\renewcommand{\L}{\ensuremath{\textbf L}}
\renewcommand{\P}{\ensuremath{\textbf P}}
\newcommand{\C}{\ensuremath{\textbf C}}
\newcommand{\A}{\ensuremath{\textbf A}}
\newcommand{\WF}{\ensuremath{\textrm{WF}}}
\newcommand{\M}{\ensuremath{\textrm{Mod}}}
\renewcommand{\S}{\ensuremath{\textbf S}}
\newcommand{\R}{\ensuremath{\textbf R}}
\renewcommand{\H}{\ensuremath{\textbf H}}
\newcommand{\ax}{\mathit{Ax}}
\newcommand{\res}{\mathit{Res}}
\newcommand{\Res}{\ensuremath{\textbf{Res}}}
\newcommand{\bas}{\ensuremath{\textsf{base}}}
\newcommand{\len}{\ensuremath{\textsf{length}}}
\newcommand{\atcons}{\ensuremath{\textsf{atCons}}}
\newcommand{\V}{\ensuremath{\textbf V}}
\newcommand{\K}{\ensuremath{\textbf K}}
\newcommand{\F}{\ensuremath{\textbf F}}
\newcommand{\T}{\ensuremath{\textbf T}}
\newcommand{\arity}{\ensuremath{\textsf{arity}}}
\newcommand{\terms}{\ensuremath{\textsf{terms}}}
\newcommand{\atoms}{\ensuremath{\textsf{atoms}}}
\newcommand{\dom}{\ensuremath{\textsf{dom}}}
\newcommand{\mgu}{\textsf{mgu}}

\newcommand{\regel}[2]{{\def\arraystretch{.8}\begin{array}{@{}c@{}}#1\\\hline#2\end{array}}}

