212/291
\begin{frame}
  \frametitle{BCNF Synthesis Algorithm}

  \begin{block}{BNCF Synthesis Algorithm}
    \emph{Input:} a relation $R$ and a set of FDs for $R$.
    \begin{enumerate}
    \medskip
    \item Compute a \emph{canonical set} of FDs $\mathcal{F}$.
    \smallskip

    \item \emph{Maximise the right-hand sides of the FDs:}\\
      Replace every FD \;\;$X \to Y \in \mathcal{F}$\;\; by \;\;$X \to X^+ - X$\;\;.
    \smallskip

    \item 
      \emph{Split off violating FDs one by one:}\\
        Start with $\mathcal{S} = \{\,R\,\}$. \\[1ex]
        For every $R_i \in \mathcal{S}$ and $X \to Y \in \mathcal{F}$: if
          \begin{itemize}
            \item $X$ is contained in $R_i$ ($X \subseteq R_i$), and
            \item $X$ is not a key of $R_i$ ($R_i \not\subseteq X^+$), and
            \item $Y$ overlaps with $R_i$ ($Y \cap R_i \ne \emptyset$), 
          \end{itemize}  
          then, let $Z = Y \cap R_i$ and
          \begin{itemize}
            \item remove attributes $Z$ from the relation $R_i$, and
            \item add a relation with attributes $X \cup Z$ to $\mathcal{S}$.
          \end{itemize}
    \medskip
    \end{enumerate}
  \end{block}
\end{frame}