\documentstyle[crack,sem-a4,portrait,semrot,epsf,semlayer,semcolor]{seminar}

%%%%%%%%%%%% Slides preamble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Group slides two per page
%\twoup

\renewcommand{\printlandscape}{\special{landscape}}    % Works with dvips.

\slideframe[]{none}

\pagestyle{align}
\rotateheaderstrue

\raggedslides[2em]

\def\slidetitle#1{\begin{center}{\large\bf #1}\end{center}\vspace{2em}}

%%%%%%%%%% dimensions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%\addtolength{\textheight}{4cm}
%%\addtolength{\topmargin}{-4cm}

%%\addtolength{\textwidth}{4cm}
%%\addtolength{\oddsidemargin}{-2cm}
%%\addtolength{\evensidemargin}{-2cm}

%%%\parindent=0.0cm
%%%\baselineskip=0.5cm
%%%\parskip=0.2cm

%%%\def\baselinestretch{0.97}

%%\def\topfraction{0.7}
%%\def\bottomfraction{1.0}

%%%%%%%%%% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand {\minitab}  {\hspace*{1ex}}
\newcommand {\smalltab} {\hspace*{5mm}}
\newcommand {\tab}      {\hspace*{10mm}}
\newcommand {\bigtab}   {\hspace*{15mm}}
\newcommand {\hugetab}  {\hspace*{20mm}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\Id}[1]{\mbox{\sf id}(#1)}
\newcommand{\ALCQ}{\mbox{${\cal ALCQ}$}}
\newcommand{\ALCIO}{\mbox{${\cal ALCIO}$}}
\newcommand{\ALCreg}{\mbox{\ALC$_{\mbox{\it reg}}$}}
\newcommand{\ALCIreg}{\mbox{${\cal ALCI}_{\mbox{\it reg}}$}}
\newcommand{\ALCQIreg}{\mbox{${\cal ALCQI}_{\mbox{\it reg}}$}}
\newcommand{\ALCFIreg}{\mbox{${\cal ALCFI}_{\mbox{\it reg}}$}}
\newcommand{\ALCQOreg}{\mbox{${\cal ALCQO}_{\mbox{\it reg}}$}}
\newcommand{\ALCIOreg}{\mbox{${\cal ALCIO}_{\mbox{\it reg}}$}}
\newcommand{\ALCQIOreg}{\mbox{${\cal ALCQIO}_{\mbox{\it reg}}$}}
\newcommand{\Km}{\mbox{${\cal K}_{(m)}$}}
\newcommand{\PDL}{\mbox{${\cal PD\!L}$}}
\newcommand{\CPDL}{\mbox{${\cal CPD\!L}$}}
\newcommand{\DPDL}{\mbox{${\cal DPD\!L}$}}
\newcommand{\DCPDL}{\mbox{${\cal DCPD\!L}$}}
\newcommand{\HS}{\mbox{${\cal HS}$}}
\newcommand{\ALCT}{\mbox{${\cal ALCT}$}}
%\newcommand{\TLALCF}{\mbox{${\cal T\!L{-}ALCF}$}}
%\newcommand{\TLF}{\mbox{${\cal T\!L{-}F}$}}
\newcommand{\DL}{\mbox{${\cal D\!L}$}}
\newcommand{\ALCK}{\mbox{${\cal ALCK}$}}

\newcommand{\Cthree}{\mbox{$\ddot{\mathcal{C}}^{3}$}}
\newcommand{\Ctwo}{\mbox{$\ddot{\mathcal{C}}^{2}$}}
\newcommand{\Cn}{\mbox{$\ddot{\mathcal{C}}^{n}$}}

\def\NOW{\mbox{$\sharp$}}
\def\Parm{\mbox{$\star$}}
\def\SOMETIME{\Diamond}

\newcommand{\AutoK}{\mbox{\fontfamily{phv}\fontseries{b}\selectfont K}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Description Logics}

\hspace{3cm}

\slidetitle{\fbox{\parbox[t]{10em}{\centerline{Description Logics}
      \centerline{and Databases}}}}

\hspace{3cm}

\centerline{Enrico Franconi}

\hspace{3cm}

{\small Department of Computer Science}\\
{\small University of Manchester}\\

\hspace{3cm}

\noindent
{\small\tt http://www.cs.man.ac.uk/\~{}franconi}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Description Logics and Databases}

    \begin{itemize}
    \item Queries
    \item Conceptual Modeling
    \item Finite Model Reasoning
    \end{itemize}

\vspace{2em}

\psset{bordercolor=black,border=1pt,framesep=8pt}
{\Large
\begin{center}
  \psframebox[border=.1pt,fillstyle=vlines,hatchcolor=lightgray,hatchsep=8pt]{\parbox[t]{14em}
    {\centerline{\psframebox*[fillcolor=white]{\parbox[t]{12em}
                   {\centerline{Conceptual Schema}
                    \vspace{.5em}
                    \centerline{\psframebox*[fillcolor=lightgray]{\parbox[t]{10em}
                                 {\centerline{Query}}}}}}}
     \vspace{.5em}
     \centerline{\psframebox*[fillcolor=white]{\parbox[t]{12em}
                   {\centerline{\psframebox*[fillcolor=lightgray]{\parbox[t]{10em}
                                  {\centerline{Database}}}}
                    \vspace{.5em}
                    \centerline{Knowledge Base}}}}}}
\end{center}
}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Relational Algebra}

{\tiny
\noindent
\hspace{-3em}\begin{minipage}[t]{.5\textwidth}
\begin{tabular}[t]{|l|c|c|} \hline
\multicolumn{3}{|c|}{\it SINGER} \\ \hline \hline \textsc{name} &
\textsc{country} & \textsc{type} \\ \hline\hline \texttt{Pavarotti} &
\texttt{Italy} & \texttt{Classic} \\ \texttt{Eagles} & \texttt{U.S.A.} &
\texttt{Pop} \\ \texttt{Ramazzotti} & \texttt{Italy} & \texttt{Pop} \\
\texttt{Queen} & \texttt{U.K.} & \texttt{Rock} \\ \hline
\end{tabular}
\end{minipage}
\hspace{1em}
\begin{minipage}[t]{.5\textwidth}
\begin{tabular}[t]{|l|c|c|c|} \hline
\multicolumn{4}{|c|}{\it CONCERT} \\ \hline \hline \textsc{artist} &
\textsc{place} & \textsc{date} & \textsc{ticket} \\ \hline\hline 
\texttt{Eagles} & \texttt{Paris} & \texttt{22/6/1998} & \texttt{YES} \\
\texttt{Pavarotti} & \texttt{Barcelona} & \texttt{28/6/1997} & \texttt{NO} \\
\texttt{Pavarotti} & \texttt{Bologna} & \texttt{27/4/1998} & \texttt{YES} \\
\hline
\end{tabular}
\end{minipage}
}

\vspace{1cm}

Tell me the places and the dates of italian artists concerts.

\noindent
$\boldmath\pi_{\scriptsize\{\textsc{place},\textsc{date}\}}$
\\ \smalltab
$(\boldmath\sigma_{\scriptsize\textsc{country}=\texttt{Italy}}$
\\ \tab
$(\mbox{\small\it SINGER\ }
\boldmath\bowtie_{\scriptsize\textsc{name}=\textsc{artist}} \mbox{\small\it CONCERT}))$

\vspace{1cm}

{\scriptsize
\begin{center}
\begin{tabular}[t]{|l|c|} \hline
\multicolumn{2}{|c|}{\it RESULT} \\ \hline \hline \textsc{place} &
\textsc{date} \\ \hline \texttt{Barcelona} & \texttt{28/6/1997} \\ \texttt{Bologna} &
\texttt{27/4/1998} \\ \hline
\end{tabular}
\end{center}
}


\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Relational Calculus}

{\tiny
\noindent
\hspace{-3em}\begin{minipage}[t]{.5\textwidth}
\begin{tabular}[t]{|l|c|c|} \hline
\multicolumn{3}{|c|}{\it SINGER} \\ \hline \hline \textsc{name} &
\textsc{country} & \textsc{type} \\ \hline\hline \texttt{Pavarotti} &
\texttt{Italy} & \texttt{Classic} \\ \texttt{Eagles} & \texttt{U.S.A.} &
\texttt{Pop} \\ \texttt{Ramazzotti} & \texttt{Italy} & \texttt{Pop} \\
\texttt{Queen} & \texttt{U.K.} & \texttt{Rock} \\ \hline
\end{tabular}
\end{minipage}
\hspace{1em}
\begin{minipage}[t]{.5\textwidth}
\begin{tabular}[t]{|l|c|c|c|} \hline
\multicolumn{4}{|c|}{\it CONCERT} \\ \hline \hline \textsc{artist} &
\textsc{place} & \textsc{date} & \textsc{ticket} \\ \hline\hline 
\texttt{Eagles} & \texttt{Paris} & \texttt{22/6/1998} & \texttt{YES} \\
\texttt{Pavarotti} & \texttt{Barcelona} & \texttt{28/6/1997} & \texttt{NO} \\
\texttt{Pavarotti} & \texttt{Bologna} & \texttt{27/4/1998} & \texttt{YES} \\
\hline
\end{tabular}
\end{minipage}
}

\vspace{2em}

Tell me the places and the dates of italian artists concerts.

\vspace{2em}

$\begin{array}{rl}
\exists z,k,w \per\ & \mathit{CONCERT}(z,{\mathbf x},{\mathbf y},k)\ \wedge \\ &
\mathit{SINGER}(z, {\tt Italy}, w)
\end{array}
$

{\vspace{2em}

\scriptsize
\begin{center}
\begin{tabular}[t]{|l|c|} \hline
\multicolumn{2}{|c|}{\it RESULT} \\ \hline \hline \textsc{place} &
\textsc{date} \\ \hline \texttt{Barcelona} & \texttt{28/6/1997} \\ \texttt{Bologna} &
\texttt{27/4/1998} \\ \hline
\end{tabular}
\end{center}
}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Relational Theory}

{
\begin{itemize}
\item[{\bf FACT}:] $\mbox{\it SINGER}\ ({\mathtt Pavarotti}, {\mathtt
  Italy},{\mathtt Classic}).$ \\
  \vdots \\
  $\mbox{\it CONCERT}\ (\mathtt{Pavarotti},\mathtt{Bologna},\mathtt{27/4/1998},\mathtt{YES}).$
\item[{\bf UNA}:] $\mathtt{Eagles} \neq \mathtt{Queen}, \ldots, \mathtt{Paris} \neq
\mathtt{Barcelona}.$
\item[{\bf DO}:] $\forall x\per\ ((x={\mathtt Pavarotti}) \vee \cdots \vee
  (x={\mathtt Eagles})).$
\item[{\bf CO}:] $\forall x_1 \cdots x_3\per\ (\mbox{\it SINGER}\ (x_1, \ldots, x_3)
\longrightarrow \\ \smalltab (x_1={\mathtt Pavarotti} \wedge \cdots \wedge
x_3={\mathtt Classic})
\vee \cdots \vee \\ \smalltab (x_1={\mathtt Queen} \wedge \cdots \wedge
x_3={\mathtt Rock})).$

\vspace{0.5em} $
\forall x_1 \cdots x_4\per\ (\mbox{\it CONCERT}\ (x_1, \ldots, x_4) \longrightarrow \\
\smalltab (x_1={\mathtt Eagles} \wedge \cdots \wedge x_4={\mathtt YES})
\vee \cdots \vee \\ \smalltab (x_1={\mathtt Pavarotti} \wedge \cdots \wedge
x_4={\mathtt YES})).$
\end{itemize}
}

\hrulefill
\vspace{.1em}

$\begin{array}{rl}
\exists z,k,w \per\ & \mathit{CONCERT}(z,{\mathbf x},{\mathbf y},k)\ \wedge \\ &
\mathit{SINGER}(z, {\tt Italy}, w)
\end{array}
$

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Autoepistemic Logic}

{
\begin{itemize}
\item[{\bf FACT}:] $\mbox{\it SINGER}\ (\mathtt{Pavarotti}, \mathtt{Italy},\mathtt{Classic}).$ \\
  \vdots \\
  $\mbox{\it CONCERT}\ (\mathtt{Pavarotti},\mathtt{Bologna},\mathtt{27/4/1998},\mathtt{YES}).$
\item[{\bf UNA}:] $\mathtt{Eagles} \neq \mathtt{Queen}, \ldots, \mathtt{Paris} \neq
\mathtt{Barcelona}.$
\end{itemize}
}

\vspace{1em}
\hrulefill
\vspace{2em}


$\begin{array}{rl}
\exists z,k,w \per\ & {\AutoK}\mathit{CONCERT}(z,{\mathbf x},{\mathbf y},k)\ \wedge \\ &
{\AutoK}\mathit{SINGER}(z, {\tt Italy}, w)
\end{array}
$

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{DL as a query language for DB}

Description Logics parallel the four approaches:

\begin{itemize}
\item The \Cthree\ fragment can be easily translated into relational
  algebra.
\item Model checking techniques can be generally applied, up to a
  CO-NP-complete complexity for querying with the full featured description
  logic.
\item The description logic can express the uniqueness of a model for a
  relational theory.
\item Decidable autoepistemic extensions of description logics exist.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{DL and Relational Algebra: \\ the \ALC\ example}

  \begin{eqnarray*}
    \Clext{\Top} & = & \Int{\Inds}\\
    \Clext{\Bot} & = & \emptyset\\
    \Clext{A} & = & \Int{(\AutoK A)}\\
    \Clext{\Not C} & = & \Int{\Inds}\setminus\Clext{C}\\
    \Clext{C\And D} & = & \Clext{C}\cap\Clext{D}\\
    \Clext{C\Or D} & = & \Clext{C}\cup\Clext{D}\\
    \Clext{\All{R}{C}} & = & \Int{\Inds}\setminus
                           \pi_1(\Clext{R}\reljoin{2=1}
                           (\Int{\Inds}\setminus\Clext{C}))\\
    \Clext{\Some{R}{C}} & = & \pi_1(\Clext{R}\reljoin{2=1}\Clext{C})\\
    \\
    \Clext{R} & = & \Int{(\AutoK R)}\\
    \end{eqnarray*}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Example of query}

Given the theory (ABox):

\vspace{1em}

{\tt CHILD(john,mary), Female(mary).}

\vspace{2em}

Which are the individuals in the extension of the query:

\vspace{1em}

${\tt \All{CHILD}{Female}}$

\vspace{2em}

\begin{itemize}
\item with classical DL semantics
\item by considering the ABox as a database and using the relational
  algebra equivalent for the query:\\
  ${\Inds}\setminus\pi_1({\tt CHILD}\reljoin{2=1}
  ({\Inds}\setminus{\tt Female}))$
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Relational theories in DL}

\begin{itemize}
\item {\bf FACT} is an ABox knowledge base.
\item {\bf UNA} is built-in in description logics.
\item {\bf DO} can be expressed by means of an axiom of the type
  $$\top\dot\Subsumedby\Oneof{a}\Or\Oneof{b}\Or\ldots $$ for all individuals
  in the database.
\item {\bf CO} can be expressed by means of axioms of the type
  $$A_i\doteq\Oneof{a_1^i,a_2^i,\ldots}$$ $$
  R_j\doteq(\Oneof{a_1^j}\times\Oneof{b_1^j})\Or(\Oneof{a_2^j}\times\Oneof{b_2^j})\Or\ldots$$
  (if the $(C\times D)$ operator is lacking, a more careful encoding is
  necessary)
\item Reasoning is now on the unique identified model.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Exercise}

The encoding of the role expression $R\doteq(C\times D)$, where\\ 
$\Int{(C\times D)} = \{(i,j)\in\Int\Delta\times\Int\Delta\mid \Int
C(i)\wedge\Int D(j)\}$

\vspace{2em}

$C\Subsumedby\SOME R$

$D\Subsumedby\SOME \Inverse R$

$\top\Subsumedby\All R D$

$\top\Subsumedby\All {\Inverse R} C$

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{Our old example}

\parbox[c]{3em}{$\Gamma = $}%
\parbox[c]{\textwidth}{\tt
\setlength{\unitlength}{0.9em}
\begin{picture}(20,13)(0,0)
\thinlines    \put(2,0){bill: $\NOT$Female}
              \put(2,6){andrea}
              \put(12,6){susan: Female}
              \put(7.5,11.6){john}
              
              \put(3.5,5){\vector(0,-1){4}}
              \put(11,6.2){\vector(-1,0){5.5}}
              \put(7,11){\vector(-1,-1){4}}
              \put(10,11){\vector(1,-1){4}}
                            
              \put(1,9){FRIEND}
              \put(13,9){FRIEND}
              \put(7,6.6){LOVES}
              \put(4,3){LOVES}
\end{picture}}

\vspace{2em}

Does John have a female friend loving a not female person?

\vspace{1em}

\hspace{-1em}$\Gamma\models$
\ $\exists X,Y\per~$
   \begin{minipage}[t]{17em}$
   {\tt FRIEND}({\tt john},X)\wedge {\tt Female}(X)\wedge \\
   {\tt LOVES}(X,Y)\wedge\NOT{\tt Female}(Y)$
   \end{minipage}


\vspace{1em}

\hspace{-1em}$\Gamma\models$
\ {\small
$\mbox{\Large(}\Some{\tt FRIEND}
            {\mbox{\large(}{\tt Female}\AND
                           \left(\Some{\tt LOVES}
                                      {\NOT{\tt Female}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$
}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\hspace{-2em}%
\parbox[c]{3em}{$\Gamma_1 = $}%
\parbox[c]{\textwidth}{\tt
\setlength{\unitlength}{0.9em}
\begin{picture}(20,13)
\thinlines    \put(2,0){bill: Male} \put(14,0){Male$\doteq\NOT$Female}
              \put(2,6){andrea}
              \put(12,6){susan: Female}
              \put(7.5,11.6){john}
              
              \put(3.5,5){\vector(0,-1){4}}
              \put(11,6.2){\vector(-1,0){5.5}}
              \put(7,11){\vector(-1,-1){4}}
              \put(10,11){\vector(1,-1){4}}
                            
              \put(1,9){FRIEND}
              \put(13,9){FRIEND}
              \put(7,6.6){LOVES}
              \put(4,3){LOVES}
\end{picture}}

\vspace{2em}

Does John have a female friend loving a male person?

\vspace{2em}

\hspace{-1em}$\Gamma_1\models$
\ $\exists X,Y\per~$
   \begin{minipage}[t]{17em}$
   {\tt FRIEND}({\tt john},X)\wedge {\tt Female}(X)\wedge \\
   {\tt LOVES}(X,Y)\wedge{\tt Male}(Y)$
   \end{minipage}


\vspace{1em}

\hspace{-1em}$\Gamma_1\models$
\ {\small
$\mbox{\Large(}\Some{\tt FRIEND}
            {\mbox{\large(}{\tt Female}\AND
                           \left(\Some{\tt LOVES}
                                      {{\tt Male}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$
}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}


${\tt \Gamma\not\models Female(andrea)}$\\
${\tt \Gamma\not\models\NOT Female(andrea)}$

\vspace{2em}

${\tt \Gamma_1\not\models Female(andrea)}$\\
${\tt \Gamma_1\not\models\NOT Female(andrea)}$\\
${\tt \Gamma_1\not\models Male(andrea)}$\\
${\tt \Gamma_1\not\models\NOT Male(andrea)}$

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{$\Gamma$ as a logic program ({\sc datalog}$^\NOT$)}

EDB:~~
\parbox[t]{.8\textwidth}
{\tt
friend(john,susan).\\ 
friend(john,andrea).\\
loves(susan,andrea).\\ 
loves(andrea,bill).\\
female(susan).}

\vspace{1em}

Querying $\Gamma$:

{\tt
?- \parbox[t]{\textwidth}{friend(john,X), female(X),\\
loves(X,Y), $\NOT$female(Y).}
}

{\tt
X = susan,
Y = andrea\\
yes
}

\vspace{1ex}

{\tt
?- $\NOT$female(andrea).
}

{\tt
yes
}

\vspace{1ex}

{\tt
?- female(andrea).
}

{\tt
no
}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

$\Gamma =$
\parbox[t]{.8\textwidth}{\tt
FRIEND(john,susan) $\wedge$\\ 
FRIEND(john,andrea) $\wedge$\\
LOVES(susan,andrea) $\wedge$\\ 
LOVES(andrea,bill) $\wedge$\\
Female(susan) $\wedge$\\ 
$\NOT$Female(bill)
}

\vspace{1em}

{\tiny
\noindent\parbox[t]{.5\textwidth}{
$\Int\Delta=\{{\tt john,susan,andrea,bill}\}$\\
$\Int {\tt Female}=\{{\tt susan}\}$
}
$\Longleftarrow$ unique minimal model.
}

\vspace{2em}

$\Gamma_1 =$
\parbox[t]{.8\textwidth}{
$
{\tt FRIEND(john,susan)\ \wedge } \\ 
{\tt FRIEND(john,andrea)\ \wedge } \\
{\tt LOVES(susan,andrea)\ \wedge } \\ 
{\tt LOVES(andrea,bill)\ \wedge } \\
{\tt Female(susan)\ \wedge } \\ 
{\tt Male(bill)\ \wedge } \\ 
\forall X\per\ {\tt Male}(X)\leftrightarrow \NOT{\tt Female}(X)
$
}

\vspace{1em}

{\tiny
\noindent\parbox[t]{.49\textwidth}{
$\Delta^{\I_1}=\{{\tt john,susan,andrea,bill}\}$\\
${\tt Female}^{\I_1}=\{{\tt susan,andrea}\}$\\
${\tt Male}^{\I_1}=\{{\tt bill,john}\}$
}
\noindent\parbox[t]{.49\textwidth}{
$\Delta^{\I_2}=\{{\tt john,susan,andrea,bill}\}$\\
${\tt Female}^{\I_2}=\{{\tt susan}\}$\\
${\tt Male}^{\I_2}=\{{\tt bill,andrea,john}\}$
}}

{\tiny
\noindent\parbox[t]{.49\textwidth}{
$\Delta^{\I_1}=\{{\tt john,susan,andrea,bill}\}$\\
${\tt Female}^{\I_1}=\{{\tt susan,andrea,john}\}$\\
${\tt Male}^{\I_1}=\{{\tt bill}\}$
}
\noindent\parbox[t]{.49\textwidth}{
$\Delta^{\I_2}=\{{\tt john,susan,andrea,bill}\}$\\
${\tt Female}^{\I_2}=\{{\tt susan,john}\}$\\
${\tt Male}^{\I_2}=\{{\tt bill,andrea}\}$
}}

\vspace{2ex}

{\tiny Four models; does not exist a unique minimal model.}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}

\slidetitle{\ALCK}

$C\ \rightarrow\ \ldots \mid \AutoK C$

$R\ \rightarrow\ \ldots \mid \AutoK R$

\vspace{2em}

\begin{itemize}
\item $\AutoK C$ denotes the set of individuals which are {\em known} to be
  in the extension of the concept $C$, in {\em every} model of the knowledge
  base.
\item Reasoning in \ALCK\ is PSPACE-complete.
\item The evaluation of the {\em database-oriented} \ALCK\ queries is
  polynomial.
\item If we limit the expressivity of the DL to ensure the existence of a
  unique minimal model, then the evaluation of {\em database-oriented}
  queries is formally equivalent to CWA.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{slide*}

\parbox[c]{3em}{$\Gamma = $}%
\parbox[c]{\textwidth}{\tt
\setlength{\unitlength}{0.9em}
\begin{picture}(20,13)(0,0)
\thinlines    \put(2,0){bill: $\NOT$Female}
              \put(2,6){andrea}
              \put(12,6){susan: Female}
              \put(7.5,11.6){john}
              
              \put(3.5,5){\vector(0,-1){4}}
              \put(11,6.2){\vector(-1,0){5.5}}
              \put(7,11){\vector(-1,-1){4}}
              \put(10,11){\vector(1,-1){4}}
                            
              \put(1,9){FRIEND}
              \put(13,9){FRIEND}
              \put(7,6.6){LOVES}
              \put(4,3){LOVES}
\end{picture}}

\vspace{1em}

\hspace{-2em}$\Gamma\models$
\ {\small
$\mbox{\Large(}\Some{\tt FRIEND}
            {\mbox{\large(}{\tt Female}\AND
                           \left(\Some{\tt LOVES}
                                      {\NOT{\tt Female}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$}

\hspace{-2em}$\Gamma\not\models\ ${\small${\tt Female}({\tt andrea})$}

\hspace{-2em}$\Gamma\not\models\ ${\small$\NOT{\tt Female}({\tt andrea})$}

\vspace{.5em}

\hspace{-2em}\fbox{\parbox[t]{1.2\textwidth}{DB-oriented queries:

$\Gamma\models$
\ {\small
$\mbox{\Large(}\Some{\tt \AutoK FRIEND}
            {\mbox{\large(}{\tt \AutoK Female}\AND
                           \left(\Some{\tt \AutoK LOVES}
                                      {\NOT{\tt \AutoK Female}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$}

$\Gamma\not\models\ ${\small${\tt \AutoK Female}({\tt andrea})$}

$\Gamma\models\ ${\small$\NOT{\tt \AutoK Female}({\tt andrea})$}

}}

\hspace{-2em}$\Gamma\not\models$
\ {\small
$\mbox{\Large(}\Some{\tt \AutoK FRIEND}
            {\mbox{\large(}{\tt \AutoK Female}\AND
                           \left(\Some{\tt \AutoK LOVES}
                                      {{\tt \AutoK \NOT Female}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$}

\hspace{-2em}$\Gamma\not\models$
\ {\small
$\mbox{\Large(}\Some{\tt \AutoK FRIEND}
            {\AutoK \mbox{\large(}{\tt Female}\AND
                           \left(\Some{\tt LOVES}
                                      {\NOT{\tt Female}}\right)\mbox{\large)}}\mbox{\Large)}
{\tt (john)}$}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{Exercise}

Description Logics with the autoepistemic operator can query also the theory
$\Gamma_1$ -- which is completely equivalent to $\Gamma$ -- while $\Gamma_1$
can not even be represented in database or logic programming frameworks.

\begin{itemize}
\item Try some autoepistemic query to the knowledge base $\Gamma_1$.
\item Check the CWA with $\Gamma$ and $\Gamma_1$: which is the difference
  between the two extensions, and which is the difference with the
  autoepistemic approach?
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{So what?}

Why should we bother of using DL for querying databases, when there are much
more expressive languages for that purpose -- basically without the ``three
variables'' limit?

\begin{itemize}
\item Reasoning over the query is decidable:
  \begin{itemize}
  \item Query containment,
  \item Query satisfiability.
  \end{itemize}
\item Evaluation still tractable.
\item Two natural extensions:
  \begin{itemize}
  \item Incomplete information,
  \item Querying with a conceptual schema.
  \end{itemize}
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{Incomplete Information}

Handling incomplete knowledge is the ability to correctly reason
without a complete specification of a situation, but with a
under-specified description of a class of possible situations.

\begin{itemize}
\item FOL theories.
\item KR theories.
  \begin{itemize}
  \item Unique Name (UNA) assumption.
  \end{itemize}
\item Finite Domain theories.
  \begin{itemize}
  \item Domain Closure (DO) assumption.
  \end{itemize}
\item Closed theories (e.g., null values).
  \begin{itemize}
  \item DO + Completion (CO) assumptions. 
  \end{itemize}
\item Extended Relational theories.
  \begin{itemize}
  \item UNA + DO + CO assumptions.
  \end{itemize}
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{The Entity-Relationship (ER) \\ Conceptual Data Model}

The Entity-Relationship (ER) model is the most common semantic data model
for database design.

\vspace{2em}

\epsfxsize=\textwidth
\epsfbox{er-example.eps}

\vspace{3em}

\epsfxsize=.5\textwidth
\centerline{\epsfbox{er-numbers.eps}}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}
\item An ER conceptual schema can be expressed in a suitable description
  logic theory.

\item The models of the DL theory correspond with legal database states of
  the ER schemas.

\item Reasoning services such as satisfiability of a schema or logical
  implication can be performed by the corresponding DL theory.  

\item A description logic allows for a greater expressivity than the
  original ER framework, in terms of full disjunction and negation, and
  entity definitions by means of both necessary and sufficient conditions.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\slidetitle{Mapping an ER schema \\ in a DL theory}

\begin{itemize}
\item Relations are {\em reified} in the description logic theory, i.e.,
  they become concepts with $n$ special feature names denoting the $n$
  arguments of the n-ary relation.  

\item The relation {\tt INCOME} becomes a concept with the two features:
  \begin{itemize}
  \item {\tt incomer} -- relating to the first argument of the relation,
    i.e., an employee,
  \item {\tt incoming} -- relating to the second argument of the relation,
    i.e., a dollar quantity.
  \end{itemize}
  
\item {\tt incomer}, {\tt incoming}, {\tt locator}, {\tt place}, {\tt
    whole}, and {\tt part} are functional roles.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\epsfxsize=\textwidth
\epsfbox{er-example.eps}

\vspace{2em}

${\tt INCOME \Subsumedby \parbox[t]{\textwidth}{$\tt
    \Selects{incomer}{Employee} \And\\
    \Selects{incoming}{Dollar\mbox{-}quantity} $} }$

${\tt LOCATION \Subsumedby
  \parbox[t]{\textwidth}{$\tt\Selects{locator}{Employee} \And \\
    \Selects{place}{City} $} }$

${\tt IS\mbox{-}PART \Subsumedby\parbox[t]{\textwidth}{$\tt
    \Selects{part}{City} \And \\ \Selects{whole}{Region} $} }$

${\tt Employee \Subsumedby \parbox[t]{\textwidth}{$\tt Person \And \Some
    {\Inverse{incomer}}{INCOME} \And \\ \Some {\Inverse{locator}}{LOCATION}
    $} }$

${\tt
Manager \Subsumedby Person \And \Not {Employee}
}$

${\tt
Person \Subsumedby Manager \Or Employee
}$

${\tt
Dollar\mbox{-}quantity \Subsumedby  Quantity
}$

${\tt
City \Subsumedby  \Some {\Inverse{part}}{IS\mbox{-}PART} 
}$

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Object-Oriented \\ Conceptual Data Models}

\begin{itemize}
\item Is is intuitive to understand the relationship between a description
  logic and a generic Object-Oriented formalism. 
\item Unlike object-oriented systems, description logics do not stress the
  representation of the behavioral aspect of information, for which they are
  still considered inadequate. 
\item The translation of the structural part of an O-O schema into a
  description logic knowledge base is similar to the one sketched for ER
  schemas.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Advantages of DL \\ for Conceptual Modeling}

\begin{itemize}

\item {\em Ontological organization.\/} It is possible to capture important
  basic facets of data semantics, including the structure of complex
  entities.

\item {\em Consistency checking.\/} It is possible to check whether the
  global information conveyed in a schema forces some specific class to be
  inconsistent. Moreover, one could check the consistency of the whole
  schema, also with respect to possible integrity constraints.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\em Data entry.\/} The user is supported in the phase of populating
  the data base, according to the knowledge of the schema and satisfying the
  integrity constraints. Then, the system could not only check the
  consistency of the data base itself, but also make some deductive
  inferences asserting new facts regarding the data. Moreover, the system
  supports the user in the refinement of the schema in a populated data
  base.

\item {\em Views organization.\/} Views - i.e., pre-defined descriptions,
  grounded on the terms of the schema - are automatically organized into a
  hierarchy, which is a non-trivial task when there are many complex views.
  Taxonomic relations between views do explicit their meaning and their
  specificity, allowing for its retrieval and reuse.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\em Schema refinement.\/} It is possible to reduce the redundancy of
  a schema, by discovering equivalent descriptions, by reusing descriptions,
  and by exploiting the description lattice.

\item {\em Inter-schema organization.\/} It is possible to define
  inter-schema knowledge describing the constraints among different
  databases, easing the task of managing multi-databases.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Finite Model Reasoning}

\begin{itemize}

\item {\em Simple} description logics do have the Finite Model property: if
  a formula is satisfiable, then it is finitely satisfiable.

\item However, very expressive description logics do not have the finite
  model property anymore.

\item Satisfiability (logical implication) and finite satisfiability
  (logical implication) may diverge. The theory may infer a property holding
  only in the finite structures, but classical reasoning may not reveal this
  fact.

\item Finite model reasoning is relevant for database conceptual modeling:
  databases are always finite.

\item In order to model ER schemas, we need a logic which does not have the
  finite model property.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Examples}


\begin{minipage}[c]{.24\textwidth}
\begin{center}
\epsfxsize=\textwidth
\epsfbox{ER_incons_bis.eps}
\vspace{1em}
{\em Unsatisfiable}
\end{center}
\end{minipage}
\tab
\begin{minipage}[c]{.61\textwidth}
\begin{center}
\epsfxsize=\textwidth%
\epsfbox{card_probl_2_bis.eps}
\vspace{1em}
{\em Satisfiable, but not finitely satisfiable}
\end{center}
\end{minipage}

\vspace{2em}\rule{\textwidth}{1pt}\vspace{2em}

\begin{minipage}[c]{.4\textwidth}
\epsfxsize=\textwidth
\epsfbox{card_probl_1_bis.eps}
\end{minipage}
\tab
\begin{minipage}[c]{.45\textwidth}
\begin{center}
\epsfxsize=\textwidth
\epsfbox{card_probl_1_cons.eps}
\vspace{1em}
{\em Not logically implied, but finitely logically implied}
\end{center}
\end{minipage}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Querying with a conceptual schema}

\begin{itemize}
\item \fbox{\parbox[t]{.9\textwidth}{Query containment of conjunctive queries
      (SPJ-queries) referring to predicates defined in a \ALCQIreg\ theory
      is EXPTIME-complete.}}
\item It is possible to encode constraints over $n$-ary relations.
\item The DL schema allows for recursive definitions, with full negation,
  disjunction, and universal quantification (compare with {\sc datalog}).
\item DL are able to fully encode many O-O and semantic data models, e.g.,
  Entity-Relationship (ER), Object-Role Modeling (ORM), OMT static model. It
  can extend them in may ways, e.g., with negation, disjointness, covering
  constraints.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Querying with a conceptual schema}

\begin{center}

  ${\tt Q(x,y,z) \doteq \parbox[t]{\textwidth} {$\tt Person(x)\wedge \Not
      Manager(x)\wedge \\ INCOME(x,y)\wedge LOCATION(x,z).$}}$

$\Downarrow$

\fbox{\parbox[t]{\textwidth}{
\epsfxsize=.9\textwidth
\centerline{\epsfbox{er-example.eps}}
}}

$\Uparrow$

${\tt Table^1_{DB_1}(x,y)\doteq Employee(x)\wedge INCOME(x,y).}$

${\tt Table^2_{DB_1}(x,y)\doteq Employee(x)\wedge LOCATION(x,y).}$

\end{center}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Advantages of DL}

\begin{itemize}

\item {\it Query validation.\/} Incoherent queries - i.e., queries that can
  not return any value as answer, given their inconsistent meaning with
  respect to the schema - are detected, and the user is informed about its
  ill-formed request.

\item {\it Query generalization.\/} In many situations, the query, even if
  it is consistent, can return an empty answer, since there is no actual
  object in the database satisfying it.  In such cases, it is reasonable to
  generalize the query until a non empty answer is obtained; the description
  lattice is the obvious space where such generalizations can be searched
  for.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\it Query organization.\/} Data exploration may involve a great
  amount of queries, possibly submitted by different group of persons, in
  different periods of time, for different purposes.  The system can
  organize the set of queries in a hierarchy, such that it is possible to
  retrieve already submitted similar or equivalent queries, together with
  the cached results.  This is relevant if the queries need a substantial
  amount of time to be processed, or if the users associate comments or
  observations to the queries or to the answers.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\it Query refinement.\/} Queries can be specified through an
  iterative refinement process supported by the description lattice for the
  queries.  This process is useful for data exploration tasks.  The user may
  specify his/her request using generic terms; after the query
  classification, which makes explicit the meaning and the specificity of
  the query itself and of the terms composing the query, the user may refine
  some terms of the query or introduce new terms, and iterate the process.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\it Intensional query processing.\/} Users may explore and discover
  new generic facts without querying the whole information base, but by
  giving an explicit meaning to the queries through classification.  The
  system has the ability of answering a query with synthetic concepts
  representing the general characteristics of the information that satisfy
  it, as opposed to answering with long sequences of detailed data.
  Moreover, if the query is classified in a taxonomy of descriptions and
  queries already computed and indexing the answers, then it can be
  processed with respect to the indexed objects only, rather than with
  respect to the whole information base.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
\begin{itemize}

\item {\it Query optimization.\/} Given a schema and a set of views and
  already processed queries, a query can be optimized by computing an
  equivalent more efficient one.  The optimized query can be obtained by
  using the cached results - maintained by a semantic indexing technique -
  retrieved by classification, and/or making more specific the single terms
  and the complex descriptions used within the query original formulation.

\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide*}
  
  \slidetitle{Basic References}

\begin{itemize}
\item Alex Borgida, `Description Logics in Data Management', IEEE
  Transactions on Knowledge and Data Engineering vol.7, No. 5, October 1995.
\item Diego Calvanese, Maurizio Lenzerini, Daniele Nardi, `Description
  Logics for Conceptual Data Modeling', Logics for Databases and
  Information Systems, J. Chomicki and G. Saake eds., Kluwer, 1998.
\item Klaus Schild, `Tractable reasoning in a universal description logic',
  Proceedings of 1st Workshop KRDB'94, Saarbr�cken, Germany, September
  20-22, 1994.
\end{itemize}

\end{slide*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
