\documentclass[pdf,slideColor,plainsem]{prosper}

\usepackage{xspace}
\usepackage{latexsym}
\usepackage{amssymb}

\usepackage{pst-node}
\usepackage{pst-uml-prosper}

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

\def\MiniPage#1#2{\begin{minipage}[t]{.49\hsize}#1\end{minipage}%
\hspace{1ex}\begin{minipage}[t]{.49\hsize}#2\end{minipage}}

\newlength{\ParLen}
\def\Parbox#1#2{\settowidth{\ParLen}{#1}\parbox[t]{\ParLen}{#2}}

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

\newcommand{\per}{\mathpunct{\mbox{\bf .}}}
\newcommand{\nl}{\\\tab}

\def\centerpar#1{\renewcommand{\arraystretch}{0.7}%
\begin{tabular}{c}#1\end{tabular}\renewcommand{\arraystretch}{1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% symbols for UML package
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newlength{\umlunitbox}
\def\umlcard#1%
  {\umlcsize #1\hspace*{-.5ex}}
\def\umlclass#1#2%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]{#2}}{\hline\hline}}}
\def\umlclassred#1#2%
  {\color{red}%
  \rnode{#1}{\umlClass[linecolor=red]{\makebox[\umlunitbox]{#2}}{\hline\hline}}}
\def\umlclassa#1#2#3%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]{#2}}%
  {#3\\\hline\hline}}}
\def\umldefclass#1#2%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]%
      {{\bf /}#2}}{\hline\hline}}}
\renewcommand{\ncputicon}[2][]{%
   \setkeys{psset}{npos=0,nrot=:D}%
   \setkeys{psset}{#1}%
   \ncput{#2}}
\def\umlIsa{%
   \pstriangle[gangle=-90,%
              linestyle=solid,%
              fillstyle=solid,%
              fillcolor=white]%
          (-0.15,0)(0.12,0.15)} % (centre)(Width,Length)

%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{epic,eepic}

\newcommand{\vtrue}{{\tt T}}
\newcommand{\vfalse}{{\tt F}}
\newcommand{\interp}{{\cal I}}
\newcommand{\interf}{{\cal I}}
\newcommand{\domain}{{\bf D}}
\newcommand{\jinterp}{{\cal J}}
\newcommand{\interfj}{{\cal J}}
\newcommand{\minterp}{{\cal M}}
\newcommand{\formel}{{\cal F}}
\newcommand{\clauses}{{\cal C}}
\newcommand{\intf}[1]{{#1}^{\cal I}}
\newcommand{\intfj}[1]{{#1}^{\cal J}}
\newcommand{\varmap}{{\alpha}}
\newcommand{\intfv}[1]{{#1}^{{\cal I},\varmap}}

\newcommand{\predA}{{\tt A}}
\newcommand{\predB}{{\tt B}}
\newcommand{\predR}{{\tt R}}

\newcommand{\tl}[1]{#1^\ast}    % translation of modal logic formulae
                                % into predicate logic formulae

\newcommand{\implies}{\Rightarrow}
\newcommand{\set}[1]{\{ #1 \}}          % set

\newcommand{\KB}{\textit{KB}\xspace}

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

\semtitle{Description Logics}
\semsubject{Deduction in Propositional Logic}
\semauthor{Enrico Franconi}
\sememail{franconi@cs.man.ac.uk}
\semwebpage{http://www.cs.man.ac.uk/\~{}franconi}
\seminstitution{Department of Computer Science, University of Manchester}

\begin{document}

\makesemtitle

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

\begin{slide}{Decision Procedures in Logic: soundness}

A {\bf decision procedure} solves a problem with {\sc yes} or {\sc
  no} answers:

\[\fbox{$\KB \vdash_i \alpha$}\]

\begin{itemize}
\item Sentence $\alpha$ can be derived from the set of sentences \KB
  by procedure $i$.
  
\item \textit{\color{blue}Soundness}: procedure $i$ is sound if \\
  whenever procedure $i$ proves that a sentence $\alpha$ can be
  derived from a set of sentences \KB ($\KB\vdash_i\alpha$), then it
  is also true that \KB entails $\alpha$ ($\KB\models\alpha$).
  
  \begin{itemize}
  \item ``no wrong inferences are drawn''
  \item A sound procedure may fail to find the solution in some cases,
    when there is actually one.
  \end{itemize}

\end{itemize}
\end{slide}

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

\begin{slide}{Decision Procedures in Logic: completeness}

A {\bf decision procedure} solves a problem with {\sc yes} or {\sc
  no} answers:

\[\fbox{$\KB \vdash_i \alpha$}\]

\begin{itemize}
\item Sentence $\alpha$ can be derived from the set of sentences \KB
  by procedure $i$.
  
\item \textit{\color{blue}Completeness}: procedure $i$ is complete if \\
  whenever a set of sentences \KB entails a sentence $\alpha$
  ($\KB\models\alpha$), then procedure $i$ proves that $\alpha$ can be
  derived from \KB ($\KB\vdash_i\alpha$).

  \begin{itemize}
  \item ``all the correct inferences are drawn''
  \item A complete procedure may claim to have found a solution in
    some cases, when there is actually no solution.
  \end{itemize}

\end{itemize}

\end{slide}

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

\begin{slide}{Sound and Incomplete Algorithms}

\begin{itemize}
\item Sound and incomplete algorithms are very popular: they are
  considered {\em good} approximations of problem solving procedures.
\item Sound and incomplete algorithms may reduce the algorithm
  complexity.
\item Sound and incomplete algorithms are often used due to the
  inability of programmers to find sound and complete algorithms.
\end{itemize}

\end{slide}

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

\begin{slide}{Good Decision procedures}

\begin{itemize}
  
\item If an incomplete reasoning mechanism is provided, we can
  conclude either that the semantics of the representation language
  does not really capture the meaning of the ``world'' and of ``{\em
    what should follow\/}'', or that the algorithms can not infer all
  the things we would expect.
  
\item Having {\bf sound and complete} reasoning procedures is
  important!

\item Sound and complete decision procedures are good candidates for
  implementing reasoning modules within larger applications.

\end{itemize}

\end{slide}

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

\begin{slide}{An extreme example}

Let's consider two decision procedures:

\noindent 
\begin{itemize}
\item $F$, which always returns the result {\sc no} independently from
  its input
\item $T$, which always returns the result {\sc yes} independently from its
  input
\end{itemize}

\vspace{1em}

\noindent 
Let's consider the problem of computing entailment between formulas;

\vspace{1em}

\noindent 
\begin{itemize}
\item $F$ is a sound algorithm for computing entailment.
\item $T$ is a complete algorithm for computing
  entailment.
\end{itemize}

\end{slide}

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

\begin{slide}{Dual problems}

Can we use a sound but incomplete decision procedure for a problem to
solve the {\bf dual problem} by inverting the answers?

$T$ is an unsound procedure for computing non-entailment between
formulas.

\includegraphics[width=.7\hsize]{fig06.11.ps}

Incompleteness of the reasoning procedures of the reasoning agent leads to
{\em unsound} reasoning of the whole agent, if the main system relies on
\textit{negative conclusions} of the reasoning agent module.

\end{slide}

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

\begin{slide}{Propositional Decision Procedures}

\begin{itemize}
  
\item Truth tables provide a sound and complete decision procedure for
  testing satisfiability, validity, and entailment in propositional
  logic.

  \begin{itemize}
  
  \item The proof is based on the observation that truth tables
    enumerate all possible models.

  \end{itemize}
  
\item Satisfiability, validity, and entailment in propositional logic
  are thus \textit{decidable} problems.
  
\item For problems involving a large number of atomic propositions the
  amount of calculation required by using truth tables may be
  prohibitive (always $2^n$, where $n$ is the number of atomic
  proposition involved in the formulas).
  
\end{itemize}

\end{slide}

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

\begin{slide}{Reduction to satisfiability}

\begin{itemize}
  
\item A formula $\phi$ is satisfiable iff there is some interpretation
  $\interp$ (i.e., a truth value assignment) that satisfies $\phi$ 
  (i.e., $\phi$ is true under $\interp$: $\interp\models\phi$).
  
\item Validity, equivalence, and entailment can be reduced to
  satisfiability:

  \begin{itemize}
  
  \item $\phi$ is a valid (i.e., a tautology) iff $\neg\phi$ is
    not satisfiable.
    
  \item $\phi$ entails $\psi$ ($\phi\models\psi$) iff
    $\phi\rightarrow\psi$ is valid (\textit{deduction theorem\/}).

    \begin{itemize}
    \item \fbox{$\phi\models\psi$ iff $\phi\land\neg\psi$ is not
        satisfiable}.
    \end{itemize}
    
  \item $\phi$ is equivalent to $\psi$ ($\phi\equiv\psi$) iff
    $\phi\leftrightarrow\psi$ is valid.
    
    \begin{itemize}
    \item $\phi\equiv\psi$ iff $\phi\models\psi$ and $\psi\models\phi$
    \end{itemize}
  
\end{itemize}

\item A \textit{sound and complete} procedure deciding satisfiability
  is all we need, and the \textit{tableaux method} is a decision
  procedure which checks the existence of a model.

\end{itemize}

\end{slide}

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

\begin{slide}{Tableaux Calculus}

\begin{itemize}
  
\item The Tableaux Calculus is a decision procedure solving the
  problem of satisfiability.
  
\item If a formula is satisfiable, the procedure will constructively
  exhibit a model of the formula.
  
\item The basic idea is to incrementally build the model by looking at
  the formula, by decomposing it in a top/down fashion. The procedure
  exhaustively looks at all the possibilities, so that it can
  eventually prove that no model could be found for unsatisfiable
  formulas.

\end{itemize}

\end{slide}

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

\overlays{5}{
\begin{slide}{Simple examples (I)}

\MiniPage
{\center
$\KB = \textit{ManUn}\land \textit{ManCity}, \neg \textit{ManUn}$
\\
\psset{unit=5em}\fromSlide{2}{%
\begin{pspicture}(-1,0)(0,2.5)
  \rput(0,2){\rnode{kb}{\psframebox{
        \Parbox{$\textit{ManUn}\land \textit{ManCity}$}
        {$\textit{ManUn}\land \textit{ManCity}$\\
         $\neg \textit{ManUn}$\fromSlide*{3}{{\color{red}$\clubsuit$}}
         }}}}
  \rput(0,1){\rnode{s1}
    {\psframebox{\Parbox{$\clubsuit$ \textit{ManCity}}
        {\textit{ManUn}\fromSlide*{3}{{\color{red}$\clubsuit$}}
         \\
         \textit{ManCity}\fromSlide*{3}{{\color{white}$\clubsuit$}}
         }}}}
  \rput(0,0){\rnode{s2}{{\color{red}\sf\bf clash!}}}
  \ncline{->}{kb}{s1}
  \ncline{->}{s1}{s2}
\end{pspicture}}}
{\center
$\KB = \textit{Chelsea}\land \textit{ManCity}, \neg \textit{ManUn}$
\\
\psset{unit=5em}\fromSlide{4}{%
\begin{pspicture}(-1,0)(0,2.5)
    \rput(0,2){\rnode{kb}{\psframebox{
          \Parbox{$\textit{Chelsea}\land \textit{ManCity}$}
          {$\textit{Chelsea}\land \textit{ManCity}$\\
           $\neg \textit{ManUn}$\fromSlide*{5}{{\color{green}$\spadesuit$}}
           }}}}
    \rput(0,1){\rnode{s1}
      {\psframebox{\Parbox{$\spadesuit$ \textit{ManCity}}
          {\textit{Chelsea}\fromSlide*{5}{{\color{green}$\spadesuit$}}
           \\
           \textit{ManCity}\fromSlide*{5}{{\color{green}$\spadesuit$}}
           }}}}
    \rput(0,0){\rnode{s2}{{\color{green}\sf\bf completed}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{s1}{s2}
\end{pspicture}}}

\end{slide}}

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

\overlays{5}{
\begin{slide}{Simple examples (II)}

\MiniPage
{\center\small
$\KB = \textit{Chelsea}\lor \textit{ManUn}, \neg \textit{Chelsea}, 
\neg \textit{ManUn}$
\\
\psset{unit=6em}\fromSlide{2}{%
\begin{pspicture}(-1,0)(2,3)
    \rput(1,2){\rnode{kb}{\psframebox{
          \Parbox{$\textit{Chelsea}\lor \textit{ManUn}$}
          {$\textit{Chelsea}\lor \textit{ManUn}$\\
           \fromSlide{3}{{\color{red}$\clubsuit$}}
           $\neg \textit{Chelsea}$\\
           \fromSlide{3}{{\color{white}$\clubsuit$}}
           $\neg \textit{ManUn}$
           \fromSlide*{3}{{\color{red}$\clubsuit$}}}}}}
    \rput(0,1){\rnode{s1}
      {\psframebox{\Parbox{~$\clubsuit$~~\textit{Chelsea}}
          {\fromSlide{3}{{\color{red}$\clubsuit$}}~\textit{Chelsea}}}}}
    \rput(2,1){\rnode{s2}
      {\psframebox{\Parbox{\textit{ManUn} $\clubsuit$}
          {\textit{ManUn}
          \fromSlide*{3}{{\color{red}$\clubsuit$}}}}}}
    \rput(0,0){\rnode{s3}{{\color{red}\sf\bf clash!}}}
    \rput(2,0){\rnode{s4}{{\color{red}\sf\bf clash!}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{kb}{s2}
    \ncline{->}{s1}{s3}
    \ncline{->}{s2}{s4}
\end{pspicture}}}
%
{\center\small
$\KB = \textit{Chelsea}\lor \textit{ManUn}, \neg \textit{ManUn}$
\\
\psset{unit=6em}\fromSlide{4}{%
\begin{pspicture}(-1,0)(2,3)
    \rput(1,2){\rnode{kb}{\psframebox{
          \Parbox{$\textit{Chelsea}\lor \textit{ManUn}$}
          {$\textit{Chelsea}\lor \textit{ManUn}$\\
            \fromSlide{5}{{\color{green}$\spadesuit$}}
            $\neg \textit{ManUn}$
            \fromSlide*{5}{{\color{red}$\clubsuit$}}}}}}
    \rput(0,1){\rnode{s1}
      {\psframebox{\Parbox{~$\spadesuit$~~\textit{Chelsea}}
          {\fromSlide{5}{{\color{green}$\spadesuit$}}~~\textit{Chelsea}}}}}
    \rput(2,1){\rnode{s2}
      {\psframebox{\Parbox{\textit{ManUn} $\clubsuit$}
          {\textit{ManUn}
          \fromSlide*{5}{{\color{red}$\clubsuit$}}}}}}
    \rput(0,0){\rnode{s3}{{\color{green}\sf\bf completed}}}
    \rput(2,0){\rnode{s4}{{\color{red}\sf\bf clash!}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{kb}{s2}
    \ncline{->}{s1}{s3}
    \ncline{->}{s2}{s4}
\end{pspicture}}}

\end{slide}}

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

\begin{slide}{Tableaux Calculus}

Finds a model for a given collection of sentences \KB in negation
normal form.

\begin{enumerate}
\item Consider the knowledge base \KB as the root node of a {\it
    refutation tree}. A node in a refutation tree is called {\em
    tableaux}.
      
\item Starting from the root, add new formulas to the tableaux,
  applying the {\it completion rules}.
  
\item Completion rules are either deterministic -- they yield a
  uniquely determined successor node -- or nondeterministic --
  yielding several possible alternative successor nodes ({\it
    branches}).
      
\item Apply the completion rules until either \\
  (a) an explicit contradiction due to the presence of two opposite
  literals in a node (a {\it clash}) is generated in each branch, or \\
  (b) there is a {\em completed} branch where no more rule is
  applicable.
  
\end{enumerate}

\end{slide}

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

\begin{slide}{Models}

\begin{itemize}
\item The completed branch of the refutation tree gives a model of
  \KB: the \KB is satisfiable.  Since all formulas have been reduced
  to literals (i.e., either positive or negative atomic propositions),
  it is possible to find an assignment of truth and falsity to atomic
  sentences which make all the sentences in the branch true.
  
\item If there is no completed branch (i.e., every branch has a
  clash), then it is not possible to find an assignment making the
  original \KB true: the \KB is unsatisfiable. In fact, the original
  formulas from which the tree is constructed can not be true
  simultaneously.

\end{itemize}

\end{slide}

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

\begin{slide}{The Calculus}

  \begin{minipage}[t]{6em}$
  \begin{array}{c}
  \phi\wedge\psi\\
  \hline
  \phi\\
  \psi
  \end{array}
  $\end{minipage}
  \begin{minipage}[c]{14em}
    {\small If a model satisfies a conjunction, then it also satisfies
      \textit{each of} the conjuncts}
  \end{minipage}

\vspace{1em}

  \begin{minipage}[t]{6em}$
  \begin{array}{c|c}
  \multicolumn{2}{c}{\phi\vee\psi}\\
  \hline
  \phi & \psi\\
  \multicolumn{2}{c}{}
  \end{array}
  $\end{minipage}
  \begin{minipage}[c]{14em}
    {\small If a model satisfies a disjunction, then it also satisfies
      \textit{one of} the disjuncts. It is a non-deterministic rule,
      and it generates two {\em alternative} branches of the
      tableaux.}
  \end{minipage}


\end{slide}

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

\begin{slide}{Negation Normal Form}

The given tableaux calculus works only if the formula has been
translated into Negation Normal Form, i.e., all the negations have
been pushed down.

\vspace{2em}

Example::

$\neg (A \lor (B \land \neg C))$

becomes

$(\neg A \land (\neg B \lor C))$


\end{slide}

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

\overlays{2}{
\begin{slide}{Entailment and Refutation}

$\phi\models\psi$ iff $\phi\land\neg\psi$ is not satisfiable. The
tableaux may exhibit a counter-example (why?).

\MiniPage
{\center\small
$\textit{Chelsea}\lor\textit{ManUn},\neg\textit{ManUn}\models\textit{Chelsea} 
$\\ {\sf (true)}
\\
\psset{unit=5em}
\begin{pspicture}(-1,0)(2,3)
    \rput(1,2){\rnode{kb}{\psframebox{
          \Parbox{$\textit{Chelsea}\lor \textit{ManUn}$}
          {$\textit{Chelsea}\lor \textit{ManUn}$\\
           $\neg \textit{Chelsea}$\\
            $\neg \textit{ManUn}$}}}}
    \rput(0,1){\rnode{s1}
      {\psframebox{\Parbox{\textit{Chelsea}}
          {\textit{Chelsea}}}}}
    \rput(2,1){\rnode{s2}
      {\psframebox{\Parbox{\textit{ManUn}}
          {\textit{ManUn}}}}}
    \rput(0,0){\rnode{s3}{{\color{red}\sf\bf clash!}}}
    \rput(2,0){\rnode{s4}{{\color{red}\sf\bf clash!}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{kb}{s2}
    \ncline{->}{s1}{s3}
    \ncline{->}{s2}{s4}
\end{pspicture}}
%
{\center\small
$\textit{Chelsea}\lor\textit{ManUn}\models\textit{ManUn}$
\\ {\sf (false)}\\
\psset{unit=5em}\fromSlide*{2}{%
\begin{pspicture}(-1,0)(2,3)
    \rput(1,2){\rnode{kb}{\psframebox{
          \Parbox{$\textit{Chelsea}\lor \textit{ManUn}$}
          {$\textit{Chelsea}\lor \textit{ManUn}$\\
            $\neg \textit{ManUn}$}}}}
    \rput(0,1){\rnode{s1}
      {\psframebox{\Parbox{\textit{Chelsea}}
          {\textit{Chelsea}}}}}
    \rput(2,1){\rnode{s2}
      {\psframebox{\Parbox{\textit{ManUn}}
          {\textit{ManUn}}}}}
    \rput(0,0){\rnode{s3}{{\color{green}\sf\bf completed}}}
    \rput(2,0){\rnode{s4}{{\color{red}\sf\bf clash!}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{kb}{s2}
    \ncline{->}{s1}{s3}
    \ncline{->}{s2}{s4}
\end{pspicture}}}

\end{slide}}

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

\overlays{3}{
\begin{slide}{Efficiency: order of rule application}

$\KB = p\land q, \neg p, a\land b\land c$

\MiniPage
{\center\small
\psset{unit=6em}\fromSlide{2}{%
\begin{pspicture}(-1,0)(0,3.5)
  \rput(0,3){\rnode{kb}{\psframebox{
        \Parbox{$a\land b\land c$}
        {$p\land q$\\
         $\neg p$\\
          $a\land b\land c$}}}}
  \rput(0,2){\rnode{s1}
    {\psframebox{\Parbox{$a$}
        {$a$\\$b$\\$c$}}}}
  \rput(0,1){\rnode{s2}
    {\psframebox{\Parbox{$p$}
        {$p$\\$q$}}}}
    \rput(0,0){\rnode{s3}{{\color{red}\sf\bf clash!}}}
    \ncline{->}{kb}{s1}
    \ncline{->}{s1}{s2}
    \ncline{->}{s2}{s3}
\end{pspicture}}}
{\center\small
\psset{unit=6em}\fromSlide{3}{%
\begin{pspicture}(-1,0)(0,2.5)
  \rput(0,2){\rnode{kb}{\psframebox{
        \Parbox{$a\land b\land c$}
        {$p\land q$\\
         $\neg p$\\
          $a\land b\land c$}}}}
  \rput(0,1){\rnode{s1}
    {\psframebox{\Parbox{$p$}
        {$p$\\$q$}}}}
  \rput(0,0){\rnode{s2}{{\color{red}\sf\bf clash!}}}
  \ncline{->}{kb}{s1}
  \ncline{->}{s1}{s2}
\end{pspicture}}}

\end{slide}}

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

\begin{slide}{Efficiency: comparison with truth tables}

\begin{itemize}
\item The complexity of truth tables depends on the number of atomic
  formulas appearing in the \KB,
\item the complexity of tableaux depends on the syntactic structure of
  the formulas in \KB.
\end{itemize}

\vspace{2em}

Try:

$\KB=((p\lor q)\land (p\lor\neg q)\land (\neg p\lor r)\land 
(\neg p\lor\neg r))$
\\
%%%({\sf CNF formula})

\end{slide}

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

\begin{slide}{Tableaux as a Decision Procedure}

Tableaux is a decision procedure for computing satisfiability,
validity, and entailment in propositional logics:

\begin{itemize}
\item it is a sound algorithm
\item it is a complete algorithm
\item it is a terminating algorithm
\end{itemize}

\end{slide}

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

\end{document}

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

\begin{slide}{Testing the hardness of satisfiability}


\begin{itemize}
\item Find a reasonable way of generating {\em random} formulas to be used
  in the test.
\item Random formulas to be characterized in terms of an {\em order
    parameter} with respect to {\em satisfiability}, and showing neat
  difficult cases in correspondence to a {\em phase transition} in the
  satisfiability probability space.
\item The phase transition separates the over-constrained from the
  under-constrained regions of the problem space.
\end{itemize}

\end{slide}

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

\begin{slide}{Propositional 3-SAT}

The easy-hard-easy pattern for satisfiability, within a sat/unsat transition
in propositional 3-SAT problems:

\fbox{$(P_{1,1} \lor P_{2,1} \lor P_{3,1}) \land \ldots \land (P_{1,L} \lor
  P_{2,L} \lor P_{3,L})$}

$P_{i,j} \in \wp$ \tab $\|\wp\| = N$

\vspace{1em}

\setlength{\unitlength}{7pt}
\begin{center}
\begin{picture}(26,22)(-4,-2)
\scriptsize
\thinlines
\put(9,20) {\makebox(0,0)[tl] 
{\tiny\fbox{\shortstack[l]{
      \Thicklines
      \makebox(3,1)[lc]{\drawline(0,0)(3,0)} \makebox(6,1)[lc]{Prob(sat)}\\
      \thinlines
      \makebox(3,1)[lc]{\dottedline{0.17}(0,0)(3,0)}  \makebox(6,1)[lc]{mean}\\
      \makebox(3,1)[lc]{\line(1,0){3}}  \makebox(6,1)[lc]{median}\\
      \makebox(3,1)[lc]{\dashline{1}(0,0)(3,0)} \makebox(6,1)[lc]{percentile 90\%}
    }}}}
\linethickness{0.3mm}
\put(0,0){\vector(1,0){20}}
\put(0,0){\vector(0,1){19}}
\thinlines
\dottedline{0.17}(22,0)(22,17)
\scriptsize
\multiput(1,-0.5)(1,0){18}{\line(0,1){0.5}}
\multiputlist(1,-1)(2,0){1,3,5,7,9,11,13,15,17}
\put(19,-1){\bf L/N}
\multiput(0,0.30357143)(0,0.30357143){56}{\line(-1,0){0.3}}
\multiput(0,1.5178572)(0,1.5178572){11}{\line(-1,0){0.5}}
\multiputlist(-2,1.5178572)(0,1.5178572){500,1000,1500,2000,2500,3000,3500,4000,4500,5000,5500}
\put(-3.5,19){\bf time}
%%% \put(-5.5,18){(CRACK)}
\multiput(22,0)(0,1.7){11}{\line(1,0){0.3}}
\multiputlist(23,0)(0,3.4){0,0.2,0.4,0.6,0.8,1}
\put(20,18){\bf Prob(sat)}

%%%CRACK: SAT
\Thicklines
\begin{drawjoin}
\jput(17., 3.111){}
\jput(8.5, 5.933){}
\jput(5.7, 9.299){}
\jput(4.2,12.308){}
\jput(3.4,15.232){}
\jput(2.8,16.218){}
\jput(2.4,16.898){}
\jput(2.1,16.898){}
\jput(1.9,16.966){}
\jput(1.7,  17.0){}
\end{drawjoin}

\thinlines
%%%CRACK: MEDIA
\begin{dottedjoin}{0.17}
\jput(17., 3.238){}
\jput(8.5, 5.208){}
\jput(5.7,6.9833){}
\jput(4.2,8.2829){}
\jput(3.4,6.9563){}
\jput(2.8, 6.935){}
\jput(2.4,4.6311){}
\jput(2.1,6.1385){}
\jput(1.9, 3.939){}
\jput(1.7,2.4099){}
\end{dottedjoin}

%%%CRACK: PERC .5
\begin{drawjoin}
\jput(17.,.12143){}
\jput(8.5,.36429){}
\jput(5.7,.94107){}
\jput(4.2,.75893){}
\jput(3.4,.30357){}
\jput(2.8,.15179){}
\jput(2.4,.12143){}
\jput(2.1,.06071){}
\jput(1.9,.06071){}
\jput(1.7,.06071){}
\end{drawjoin}

%%%CRACK: PERC .9
\begin{dashjoin}{1}
\jput(17.,5.1304){}
\jput(8.5,10.261){}
\jput(5.7,14.814){}
\jput(4.2,15.695){}
\jput(3.4,16.848){}
\jput(2.8,11.171){}
\jput(2.4, 11.08){}
\jput(2.1,6.8911){}
\jput(1.9,3.9161){}
\jput(1.7,1.8821){}
\end{dashjoin}

\end{picture}
\end{center}

\end{slide}


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

\begin{slide}{Propositional Logic at work:\\the Graph Colouring Problem}

The Graph Colouring problem is a well-known combinatorial problem from
graph theory: 

\begin{itemize}
\item A graph is defined as $G=(V,E)$, where
  $V=\set{v_1,v_2,\ldots,v_n}$ is the set of \textit{vertices} and
  $E=\set{(v_i,v_j),\ldots,(v_k,v_l)}$ the set of \textit{edges}
  connecting pairs of vertices.
  
\item Find a colouring function $C: V \rightarrow {\cal N}$, such that
  connected vertices always have different colours.
  
\item There is a \textit{decision} variant of this problem: the
  question is to decide whether for a particular number of colours, a
  couloring of the given graph exists.
\end{itemize}

\end{slide}

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

\begin{slide}{Encoding as satisfiability problem}
  
  A straightforward strategy for encoding the Graph Colouring Decision
  Problem into a satisfiability problem in propositional logic:

\begin{itemize}
\item Each assignment of a colour to a single vertex is represented by
  a propositional variable; 
\item each colouring constraint (edge of the graph) is represented by
  a set of clauses ensuring that the corresponding vertices have
  different colours, 
\item and two additional sets of clauses ensure that valid assignments
  assign exactly one colour to each vertex.
\end{itemize}

\end{slide}

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

\begin{slide}{Example}

\MiniPage
{
\begin{center}
\psset{unit=2.5em}
\begin{pspicture}(0,-0.5)(2,3)
  \rput(0,0){\circlenode{N1}{Italy}}
  \rput(2,0){\circlenode{N2}{Austria}}
  \rput(1,2){\circlenode{N3}{Hungary}}
  \ncline{N1}{N3}
  \ncline{N3}{N2}
\end{pspicture} 
\end{center}
%
\vspace{1ex}
%
2 colors (Black and White): {\color{green}{Satisfiable}}
%
\vspace{1ex} \\
%
Edge axioms (the dual are redundant): \\
$(B_{I}\leftrightarrow\neg B_{H})\land (W_{I}\leftrightarrow\neg W_{H})$\\
$(B_{H}\leftrightarrow\neg B_{A})\land (W_{H}\leftrightarrow\neg W_{A})$
%
\vspace{1ex}\\
%
Node axioms (the dual are redundant):\\
$(B_{I}\rightarrow\neg W_{I})$ \\
$(B_{H}\rightarrow\neg W_{H})$ \\
$(B_{A}\rightarrow\neg W_{A})$
}
{
\begin{center}
\psset{unit=2.5em}
\begin{pspicture}(0,-0.5)(2,3)
  \rput(0,0){\circlenode{N1}{France}}
  \rput(2,0){\circlenode{N2}{Italy}}
  \rput(1,2){\circlenode{N3}{Switzerland}}
  \ncline{N1}{N3}
  \ncline{N3}{N2}
  \ncline{N2}{N1}
\end{pspicture} 
\end{center}
%
\vspace{1ex}
%
2 colors (Black and White): {\color{red}{Unsatisfiable}}
%
\vspace{1ex} \\
%
Edge axioms (the dual are redundant): \\
$(B_{F}\leftrightarrow\neg B_{S})\land (W_{F}\leftrightarrow\neg W_{S})$\\
$(B_{S}\leftrightarrow\neg B_{I})\land (W_{S}\leftrightarrow\neg W_{I})$\\
$(B_{F}\leftrightarrow\neg B_{I})\land (W_{F}\leftrightarrow\neg W_{I})$
%
\vspace{1ex}\\
%
Node axioms (the dual are redundant):\\
$(B_{F}\rightarrow\neg W_{F})$ \\
$(B_{S}\rightarrow\neg W_{S})$ \\
$(B_{I}\rightarrow\neg W_{I})$
}


\end{slide}

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

\begin{slide}{Complexity of the problem}

\begin{center}
\begin{array}[t]{|r|r|r|r|r|}
\hline
vertices & edges & colours & vars & clauses \\ \hline
30 & 60 & 3 & 90 & 300 \\ \hline
50 & 115 & 3 & 150 & 545 \\ \hline
75 & 180 & 3 & 225 & 840 \\ \hline
100 & 239 & 3 & 300 & 1117 \\ \hline
125 & 301 & 3 & 375 & 1403 \\ \hline
150 & 360 & 3 & 450 & 1680 \\ \hline
175 & 417 & 3 & 525 & 1951 \\ \hline
200 & 479 & 3 & 600 & 2237 \\ \hline
\end{array}
\end{center}

\end{slide}

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

\begin{slide}{Other hot problems for propositional logic}

\begin{itemize}
\item The general scenario in {\bf Blocks World} planning comprises a
  number of blocks and a table. The blocks can be piled onto each
  other, where the downmost block of a pile is always on the table.
  Given an initial and a goal configuration of blocks, the problem is
  to find a sequence of single block move operations which, when
  applied to the initial configuration, leads to the goal situation.

\item In the {\bf Logistics} planning domain, packages have to be
  moved between different locations in different cities. Within
  cities, packages are carried by trucks while between cities they are
  flown in planes. Both, trucks and airplanes are of limited capacity.
  
\item {\bf Circuit fault} analysis, {\bf Scheduling}, $\cdots$

\end{itemize}

\end{slide}

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

\begin{slide}{Exercise}

Check the graph colouring problems, using the enriched tableaux calculus:

\begin{center}
  \begin{minipage}[t]{.2\textwidth}$
  \begin{array}{c}
  \phi\wedge\psi\\
  \hline
  \phi\\
  \psi
  \end{array}
  $\end{minipage}
  \begin{minipage}[t]{.2\textwidth}$
  \begin{array}{c|c}
  \multicolumn{2}{c}{\phi\vee\psi}\\
  \hline
  \phi & \psi\\
  \multicolumn{2}{c}{}
  \end{array}
  $\end{minipage}
  \begin{minipage}[t]{.2\textwidth}$
  \begin{array}{c|c}
  \multicolumn{2}{c}{\phi\rightarrow\psi}\\
  \hline
  \neg\phi & \psi\\
  \multicolumn{2}{c}{}
  \end{array}
  $\end{minipage}
  \begin{minipage}[t]{.2\textwidth}$
  \begin{array}{c|c}
  \multicolumn{2}{c}{\phi\leftrightarrow\psi}\\
  \hline
  \phi & \neg\phi\\
  \psi & \neg\psi\\
  \multicolumn{2}{c}{}
  \end{array}
  $\end{minipage}
\end{center}

\MiniPage
{{\footnotesize
\begin{center}
\psset{unit=2em}
\begin{pspicture}(0,0)(2,2)
  \rput(0,0){\rnode{N1}{Italy}}
  \rput(2,0){\rnode{N2}{Austria}}
  \rput(1,2){\rnode{N3}{Hungary}}
  \ncline{N1}{N3}
  \ncline{N3}{N2}
\end{pspicture} 
\end{center}}
%
\vspace{1ex}
%
Edge axioms: \\
$(B_{I}\leftrightarrow\neg B_{H})\land (W_{I}\leftrightarrow\neg W_{H})$\\
$(B_{H}\leftrightarrow\neg B_{A})\land (W_{H}\leftrightarrow\neg W_{A})$
%
\vspace{1ex}\\
%
Node axioms:\\
$(B_{I}\rightarrow\neg W_{I})$ \\
$(B_{H}\rightarrow\neg W_{H})$ \\
$(B_{A}\rightarrow\neg W_{A})$
}
{{\footnotesize
\begin{center}
\psset{unit=2em}
\begin{pspicture}(0,0)(2,2)
  \rput(0,0){\rnode{N1}{France}}
  \rput(2,0){\rnode{N2}{Italy}}
  \rput(1,2){\rnode{N3}{Switzerland}}
  \ncline{N1}{N3}
  \ncline{N3}{N2}
  \ncline{N2}{N1}
\end{pspicture} 
\end{center}}
%
\vspace{1ex}
%
Edge axioms: \\
$(B_{F}\leftrightarrow\neg B_{S})\land (W_{F}\leftrightarrow\neg W_{S})$\\
$(B_{S}\leftrightarrow\neg B_{I})\land (W_{S}\leftrightarrow\neg W_{I})$\\
$(B_{F}\leftrightarrow\neg B_{I})\land (W_{F}\leftrightarrow\neg W_{I})$
%
\vspace{1ex}\\
%
Node axioms:\\
$(B_{F}\rightarrow\neg W_{F})$ \\
$(B_{S}\rightarrow\neg W_{S})$ \\
$(B_{I}\rightarrow\neg W_{I})$
}

\end{slide}

