%% Style file for creating Grail/description logic documents

% Necessary Packages

\usepackage{xspace}
\usepackage{amssymb}
\usepackage{euscript}

% Hyphenation

\hyphenation{data-base tab-leaux tab-leau}

% Abreviations

\newcommand{\KB}{KB\xspace}
\newcommand{\KBfull}{\textrm{knowledge base}\xspace}
\newcommand{\TKB}{TKB\xspace}
\newcommand{\TKBfull}{\textrm{terminological knowledge base}\xspace}
\newcommand{\DL}{\textrm{DL}\xspace}
\newcommand{\DLs}{\textrm{DLs}\xspace}
\newcommand{\DLfull}{\textrm{Description Logic}\xspace}
\newcommand{\DLsfull}{\textrm{Description Logics}\xspace}

% Acronyms etc.

\newfont{\mymathtt}{cmtt10 scaled 1095}
\newcommand{\ttt}[1]{\mbox{\mymathtt #1}}

\newcommand{\scname}[1]{\textsc{#1}}%   a (small) capitalised name
\newcommand{\calig}[1]{%                caligraphic text
        \ensuremath{\mathcal{#1}}}
\newcommand{\grail}{\scname{Grail}\xspace}%     GRAIL
\newcommand{\Grail}{\grail}%                    GRAIL
\newcommand{\galen}{\scname{Galen}\xspace}%     GALEN
\newcommand{\Galen}{\galen}%                    GALEN
\newcommand{\alc}{%                             ALC
  \ensuremath{\mathcal{ALC}}\xspace}
\newcommand{\alcx}[1]{\calig{ALC#1}}%           ALCx
\newcommand{\alctrans}{%                        ALC_+
        \ensuremath{\alc_{+}}\xspace}
\newcommand{\alcfi}{\ensuremath{\mathcal{ALCFI}_{R^+}}\xspace}
\newcommand{\alcRtrans}{%                       ALC_R+
        \ensuremath{\alc_{R^{+}}}\xspace}
\newcommand{\alcOtrans}{%                       ALC_o+
        \ensuremath{\alc_{\oplus}}\xspace}
\newcommand{\alcXtrans}[1]{%                    ALCx_+
        \ensuremath{\alcx{#1}_{+}}}
\newcommand{\alchrp}{%                          ALCH_R+
  \ensuremath{\mathcal{ALCH}_{R^{+}}}\xspace}
\newcommand{\alchfrp}{%                         ALCHf_R+
  \ensuremath{\mathcal{ALCH}\textbf{\textit{f}}_{R^{+}}}\xspace}
\newcommand{\Fact}{FaCT\xspace}%                FaCT
\newcommand{\Classifier}{\Fact}%
\newcommand{\Dlp}{DLP\xspace}%                  DLP
\newcommand{\Tsl}{\calig{TSL}\xspace}%          TSL
\newcommand{\Ciq}{\calig{CIQ}\xspace}%          QIC
\newcommand{\Back}{\scname{Back}\xspace}%       BACK
\newcommand{\Classic}{\scname{Classic}\xspace}% CLASSIC
\newcommand{\Loom}{\scname{Loom}\xspace}%       LOOM
\newcommand{\Kris}{\scname{Kris}\xspace}%       KRIS
\newcommand{\Ksat}{\scname{Ksat}\xspace}%       KSAT
\newcommand{\Crack}{\scname{Crack}\xspace}%     CRACK
\newcommand{\PDL}%                              PDL
        {PDL\xspace}
\newcommand{\CPDL}%                             converse-PDL
        {\emph{converse}-PDL\xspace}
\newcommand{\Lisp}{\textrm{Lisp}\xspace}
\newcommand{\Prolog}{\textrm{Prolog}\xspace}
\newcommand{\Smalltalk}{\textrm{SmallTalk}\xspace}

% Semantics etc.

\newfont{\bigmathxx}{cmsy10 scaled 1440}
\newfont{\smallmathxx}{cmsy10 scaled 720}

\newcommand{\bigsqcap}{\mathop{\mathop{\mbox{\bigmathxx\symbol{117}}}}\limits}
\renewcommand{\bigsqcup}{\mathop{\mathop{\mbox{\bigmathxx\symbol{116}}}}\limits}

\newcommand{\I}{%                               I (caligraphic)
        \ensuremath{\mathcal{I}}\xspace}
\newcommand{\Tau}{%                             Tau
        \calig{T}\xspace}
\newcommand{\Tree}{%                            Tree
        \ensuremath{\mathbf{T}}\xspace}
\newcommand{\ifunc}{%                           ^I (caligraphic)
        \ensuremath{^\mathcal{I}}\xspace}
\newcommand{\deltai}{%                          Delta^I
        \ensuremath{\Delta\ifunc}\xspace}
\newcommand{\Exptime}{\textsc{Exptime}-complete\xspace}
\newcommand{\Pspace}{\textsc{Pspace}-complete\xspace}

\newcommand{\Term}{%                            Terminology
        \ensuremath{\mathcal{T}}\xspace}

% Algorithms

\newcommand{\Concepts}{\ensuremath{\mathbf{C}}\xspace}
\newcommand{\Roles}{\ensuremath{\mathbf{R}}\xspace}
\newcommand{\Rplus}{\ensuremath{\mathbf{R}_+}\xspace}
\newcommand{\Rp}{\ensuremath{\mathbf{R}_\mathsf{P}}\xspace}
\newcommand{\Rfunc}{\ensuremath{\mathbf{F}}\xspace}
\newcommand{\Lab}{\ensuremath{\EuScript{L}}\xspace}
\newcommand{\Edges}{\ensuremath{\EuScript{E}}\xspace}
\newcommand{\Inv}{\mathop{\mathsf{Inv}}}
\newcommand{\Tr}{\mathop{\mathsf{Trans}}}

% Modal Logics

\newcommand{\K}%                                Modal K
        {\ensuremath{\mathbf{K}}\xspace}
\newcommand{\KT}%                               Modal KT
        {\ensuremath{\mathbf{KT}}\xspace}
\newcommand{\Kfour}%                            Modal K4
        {\ensuremath{\mathbf{K4}}\xspace}
\newcommand{\Sfour}%                            Modal S4
        {\ensuremath{\mathbf{S4}}\xspace}
\newcommand{\Km}%                               Modal Km
        {\ensuremath{\K_{(\mathbf{m})}}\xspace}
\newcommand{\KTm}%                              Modal KTm
        {\ensuremath{\KT_{(\mathbf{m})}}\xspace}
\newcommand{\Kfourm}%                           Modal K4m
        {\ensuremath{\mathbf{K4}_{(\mathbf{m})}}\xspace}
\newcommand{\Sfourm}%                           Modal S4m
        {\ensuremath{\mathbf{S4}_{(\mathbf{m})}}\xspace}


% Concept names etc.

\newcommand{\key}[1]{%                  a key word
        \ensuremath{\texttt{#1}}}
\newcommand{\con}[1]{%                  a concept
        \ensuremath{\textsf{#1}}}
\newcommand{\role}[1]{%                 a role
        \ensuremath{\textsf{\textsl{#1}}}}
\newcommand{\attr}[1]{%                 an attribute/feature/functional role
        \role{#1}}
\newcommand{\ind}[1]{%                  an individual
        \con{#1}}
\newcommand{\coneqn}[1]{%               a concept equation
        \con{#1}}
\newcommand{\cname}[1]{\con{#1}}%       a concept name e.g. human
\newcommand{\rname}[1]{\role{#1}}%      a role name
\newcommand{\aname}[1]{%                an attribute name
        \cname{#1}}


% DL syntax & notation

\newcommand{\Subs}{\ensuremath{\sqsupseteq}}
\newcommand{\Issub}{\ensuremath{\sqsubseteq}}
\newcommand{\nSubs}{\ensuremath{\not\sqsupseteq}}
\newcommand{\nIssub}{\ensuremath{\not\sqsubseteq}}
\newcommand{\Tail}{\mathop{\mathsf{Tail}}}

\newcommand{\some}[2]{%
        \ensuremath{\exists #1 . #2}}
\newcommand{\all}[2]{%
        \ensuremath{\forall #1 . #2}}
\newcommand{\atleast}[2]{%
        \ensuremath{\mbox{$\geqslant$}#1 #2}}
\newcommand{\atmost}[2]{%
        \ensuremath{\mbox{$\leqslant$}#1 #2}}
\newcommand{\atleastq}[3]{%
        \ensuremath{\mbox{$\geqslant$}#1 #2 . #3}}
\newcommand{\atmostq}[3]{%
        \ensuremath{\mbox{$\leqslant$}#1 #2 . #3}}
\newcommand{\feat}[1]{\ensuremath{(\leqslant 1 \; #1)}}
\newcommand{\Negfeat}[1]{\ensuremath{(\geqslant 2 \; #1)}}
\newcommand{\ain}[2]{%
        \ensuremath{#1 . #2}}
\newcommand{\aeq}[2]{%
        \ensuremath{#1 = #2}}
\newcommand{\aneq}[2]{%
        \ensuremath{#1 \neq #2}}
\newcommand{\aeqd}[2]{%                                 attributes eq and defined
        \ensuremath{#1 \stackrel{\downarrow}{=} #2}}
\newcommand{\aneqd}[2]{%                                attributes neq and defined
        \ensuremath{#1 \stackrel{\downarrow}{\neq} #2}}
\newcommand{\domain}[1]{%                               domain of a function
        \ensuremath{\mathit{dom}~#1}}
\newcommand{\id}[1]{%                                   identity relation
        \ensuremath{\mathit{id}(#1)}}
\newcommand{\trans}[1]{%                                transitive role operator
        \ensuremath{#1^{+}}}
\newcommand{\transref}[1]{%                             transitive-reflexive role operator
        \ensuremath{#1^{*}}}
\newcommand{\restr}[2]{%                                role restriction
        \ensuremath{#1\!\mid_{#2}}}
\newcommand{\tuple}[2]{%                                binary tuple
        \ensuremath{\langle #1 , #2 \rangle}}
\newcommand{\constraint}[2]{%                           constraint x:C
        \ensuremath{#1\textrm{:}#2}}
\newcommand{\Card}[1]{%                                 set cardinality
        \ensuremath{\vert#1\vert}}
\newcommand{\Trole}{%                                   transitive role
        \ensuremath{^{(+)}}\xspace}


% non-LaTex composed symbols

\newcommand{\dotin}{%
        \ensuremath{\dot{\in}}}
\newcommand{\dotneq}{%
        \ensuremath{\dot{\neq}}}


% GRAIL syntax & notation

\newcommand{\gnewsub}[2]{%
        \ensuremath{#1\  \key{newSub}\  #2}}
\newcommand{\gcrit}[2]{%
        \ensuremath{#1\ #2}}
\newcommand{\gwhich}[2]{%
        \ensuremath{#1~\key{which}~#2}}
\newcommand{\gname}[2]{%
        \ensuremath{#1\  \key{name}\  #2}}
\newcommand{\gtnecc}[2]{%
        \ensuremath{#1\  \key{topicNecessarilly}\  #2}}
\newcommand{\gnewind}[2]{%
        \ensuremath{#1\  \key{newIndividual}\  #2}}
\newcommand{\greally}[2]{%
        \ensuremath{#1\  \key{really}\  #2}}


% Other stuff

\newcommand{\Eg}{\textrm{e.g.}\@\xspace}
\newcommand{\Ie}{\textrm{i.e.}\@\xspace}

\newcommand{\sss}{{\mathrel{\kern.25em{\sqsubseteq}\kern-.5em \mbox{{\scriptsize *}}\kern.25em}}}
\newcommand{\R}{\ensuremath{\mathcal{R}}\xspace}
\newcommand{\alci}{\ensuremath{\mathcal{ALCI}_{R^+}}\xspace}
\newcommand{\alchi}{\ensuremath{\mathcal{ALCHI}_{R^+}}\xspace}
\newcommand{\alch}{\ensuremath{\mathcal{ALCH}_{R^+}}\xspace}
\newcommand{\Sat}{\emph{satisfiable}\xspace}
\newcommand{\Unsat}{\emph{unsatisfiable}\xspace}

% Note - the following is provided by the llncs class

%\newcommand{\qed}{{\unskip\nobreak\hfil\penalty50
%   \hskip2em\hbox{}\nobreak\hfil
%   \qedd
%   \parfillskip=0pt \finalhyphendemerits=0
%    \medskip\goodbreak\noindent}}
\newcommand{\qedd}{\vrule height4pt width 4pt depth0pt}
