\documentclass[aspectratio=169]{beamer}
%\usepackage[czech]{babel}
\usepackage[utf8]{inputenc}
%balíček na A4
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amssymb}

\usepackage{graphicx}

%\usepackage{mathpazo}

%\usepackage[mathlf]{MinionPro}
\usepackage{sansmathfonts}
%\usepackage[mathlf,textlf]{MyriadPro}
%\usepackage{mathpazo}
\usepackage[small]{eulervm}
%\usepackage{newtxmath}

\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage{array}
\usepackage{tabularx}
\usepackage{pbox}

\usepackage{tikz}

\tikzset{
   invisible/.style={opacity=0},
   visible on/.style={alt=#1{}{invisible}},
   blank/.style={},
   red on/.style={alt={#1{fill=red!10}{blank}}},
   alt/.code args={<#1>#2#3}{%
     \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
   },
 }

\captionsetup{compatibility=false}
%\renewcommand{\arraystretch}{1}
%\hypersetup{pdfpagemode={FullScreen}}

\makeatletter
    \newenvironment{withoutheadline}{
        \setbeamertemplate{headline}[default]
        \def\beamer@entrycode{\vspace*{-\headheight}}
    }{}
\makeatother

\title{SMT Solving for the Theory of Bit-Vectors}
\author{Martin Jonáš \vspace{-0.3cm}}
\institute{PhD Thesis Proposal \vspace{1cm}}
%\date
\date{\today}
%\subject{IA072 -- Seminar on Concurrency}

\usetheme{Antibes}
\setbeamertemplate{headline}{}
\setbeamertemplate{navigation symbols}{}%remove navigation symbols

\setbeamertemplate{footline}[frame number]

\definecolor{foreground}{RGB}{255,255,255}
\definecolor{background}{RGB}{24,24,24}
% \definecolor{title}{RGB}{107,174,214}
\definecolor{title}{RGB}{255,255,255}
\definecolor{main}{RGB}{39,66,96}
\definecolor{gray}{RGB}{155,155,155}
\definecolor{subtitle}{RGB}{102,255,204}
\definecolor{hilight}{RGB}{233,140,5}
\definecolor{vhilight}{RGB}{251,95,37}

\setbeamercolor{titlelike}{fg=title,bg=main}
\setbeamercolor{subtitle}{fg=subtitle}
\setbeamercolor{institute}{fg=gray}
%\setbeamercolor{normal text}{fg=foreground,bg=background}

\setbeamercolor*{block title}{fg=white, bg=main}
\setbeamercolor*{block body}{fg=black, bg=main!5}
\setbeamercolor*{block title example}{fg=white, bg=vhilight!65}
\setbeamercolor*{block body example}{fg=black, bg=vhilight!10}

\setbeamercolor{item}{fg=main} % color of bullets
%\setbeamercolor{subitem}{fg=gray}
\setbeamercolor{alerted text}{fg=hilight}
\setbeamercolor{description item}{fg=hilight}
%\setbeamercolor{itemize/enumerate subbody}{fg=gray}
\setbeamertemplate{itemize subitem}{{\textendash}}
\setbeamerfont{itemize/enumerate subbody}{size=\small}
\setbeamerfont{itemize/enumerate subitem}{size=\small}

\DeclareSymbolFont{operators}{\encodingdefault}{ppl}{m}{n}
\DeclareMathAlphabet{\mathbf}{\encodingdefault}{ppl}{bx}{n}
\DeclareMathAlphabet{\mathit}{\encodingdefault}{ppl}{m}{it}

\newcommand{\set}[1]{\{#1\}}
\newcommand{\bitvec}[1]{ \texttt{bitvec}_{#1} }
\newcommand{\so}[2]{\ensuremath{#1_{[#2]}}}
\newcommand{\concat}[2]{ \ensuremath{\texttt{concat}_{[#1,#2]}}}
\newcommand{\extract}[3]{ \texttt{extract}_{[#1, #2, #3] } }
\newcommand{\bvnot}{ \texttt{not} }
\newcommand{\bvand}{ \texttt{and} }
\newcommand{\bvor}{ \texttt{or} }
\newcommand{\bvshl}{ \texttt{shl} }
\newcommand{\bvshr}{ \texttt{shr} }
\newcommand{\computeBDD}{ \texttt{computeBDD} }
\newcommand{\sat}{\texttt{sat}}
\newcommand{\unsat}{\texttt{unsat}}
\newcommand{\Zplus}{\mathbb{N}^+}
\newcommand{\ite}{\texttt{ite}}
\newcommand{\levels}{\mathit{levels}}
\newcommand{\true}{\mathit{true}}
\newcommand{\false}{\mathit{false}}
\newcommand{\BV}{\ensuremath{\mathcal{BV}}}
\newcommand{\QFBV}{\ensuremath{\mathcal{QFBV}}}


\let\otp\titlepage
\renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}

\begin{document}

\begin{frame}[plain]
 \titlepage
\end{frame}

\section{Propositional Satisfiability}
\begin{frame}
  \frametitle{Propositional Satisfiability}

  Propositional satisfiability problem (SAT) -- decide whether a
  propositional formula is satisfiable.

  \bigskip

  For example
  $\varphi = (y \vee z)~\wedge~(\neg y \vee z)~\wedge~(y \vee x
  \vee z)~\wedge~(y \vee \neg x \vee \neg z)$ is satisfiable.

  \bigskip

  Usually solved by a \alert{conflict driven clause learning} algorithm (CDCL), which relies on:
  \begin{itemize}
  \item preprocessing,
  \item variable assignment (with heuristics),
  \item unit propagation,
  \item conflict analysis,
  \item clause learning,
  \item backtracking,
  \item restarts.
  \end{itemize}

  % \begin{example}
  %   $\varphi = (\neg y \vee z)~\wedge~(\neg y \vee z)~\wedge~(y \vee x \vee z)~\wedge~(y \vee \neg x \vee \neg z)$.

  %   \bigskip

  %   \begin{tikzpicture}[every node/.style={draw}]
  %     \node (e) at (5,4) {decide};
  %     \node [visible on=<2->] (x) at (2,3) {decide};
  %     \node [visible on=<3->] (xy) at (0,2) {propagate};
  %     \node [visible on=<4->] (xyz) at (0,0.5) {conflict (learn $\neg y$)};
  %     \node [visible on=<5->] (-y) at (9,3) {decide};
  %     \node [visible on=<6->] (-yz) at (7,2) {propagate};
  %     \node [visible on=<7->] (-yz-x) at (7,0.5) {sat};

  %     \path[auto, every node/.style={}, above]
  %     (e) edge [visible on=<2->] node {$x$} (x)
  %     (x) edge [visible on=<3->] node {$y$} (xy)
  %     (xy) edge [visible on=<4->, left] node {$z$} (xyz)
  %     (e) edge [visible on=<5->] node {$\neg y$} (-y)
  %     (-y) edge [visible on=<6->] node {$z$} (-yz)
  %     (-yz) edge [visible on=<7->, left] node {$\neg x$} (-yz-x);

  %   \end{tikzpicture}
  % \end{example}
\end{frame}

\section{Satisfiability Modulo Theories}
\begin{frame}
  \frametitle{Satisfiability Modulo Theories}

  Decide the satisfiability of a first-order formula in a given
  theory.

  \smallskip

  Function symbols are given interpretations by the theory.

  \bigskip

  Traditionally solved by \alert{CDCL modulo theories} -- combination of
  CDCL and a specialized theory solver.

  \pause

  \begin{example}
    Let $\varphi = (x + y = 3) \wedge (x > 1) \wedge (y = 2 \vee y = 1)$.

    \begin{enumerate}[<+->]
    \item Propositional model $\{ x + y = 3,~x > 1,~y = 2,~\neg(y = 1) \} $.
    \item This model \textbf{is not} consistent with the theory of integers.
    \item Conjoin $\neg (x + y = 3) \vee \neg (x > 1) \vee \neg (y = 2) \vee (y = 1)$ to $\varphi$.
    \item Propositional model $\{ x + y = 3,~x > 1,~\neg(y=2),~y = 1\} $.
    \item This model \textbf{is} consistent with the theory of integers.
    \item $\varphi$ is satisfiable.
    \end{enumerate}
  \end{example}
\end{frame}

\section{Theory of Bit-Vectors}
\begin{frame}
  \frametitle{Theory of Bit-Vectors}

  Theory of bit-vectors describes bounded integers (or vectors of
  bits) with:
  \begin{itemize}
  \item arithmetic operations,
  \item bitwise operations,
  \item comparison.
  \end{itemize}

  Often used in modelling of software.

  \bigskip

  Different from mathematical integers -- for example the formula
  \[
    \varphi = (x^{[32]} >_s 0)~\wedge~(y^{[32]} >_s 0)~\wedge~(x^{[32]} + y^{[32]} = 0)
  \]

  is \alert{satisfiable}.
\end{frame}

\section{Quantifier-free Bit-Vector Logic}
\begin{frame}
  \frametitle{Quantifier-free Bit-Vector Logic} Quantifier-free
  bit-vector formulas usually solved by reduction to a propositional
  formula (\emph{bit-blasting}) and using a SAT solver.

  \smallskip

  Approach taken by Z3, CVC4, Boolector, UCLID, Yices, \ldots.

  \bigskip

  Alternative approaches exist:
  \begin{itemize}
  \item model-constructing satisfiability calculus,
  \item abstract CDCL,
  \item stochastic local search.
  \end{itemize}
\end{frame}

\section{Quantified Bit-Vector Logic}
\begin{frame}
  \frametitle{Quantified Bit-Vector Logic}

  In many software verification applications, quantifiers are
  necessary.

  \bigskip

  Quantifier bit-vector formulas traditionally solved by
  \alert{quantifier instantiation}.

  \pause

  \begin{example}
    Let $\varphi = a > 3 ~\wedge~ \forall x\,(a \not = 2 \cdot x)$
    \pause
    \begin{itemize}[<+->]
    \item $a > 3$ is satisfiable with model $a = 4$.
    \item $a = 4$ not a model of $\forall x \,(a \not = 2 \cdot x)$ -- consider $x = 2$.
    \item Add instance of the quantifier for $x = 2$.
    \item $a > 3 ~\wedge~ (a \not = 2 \cdot 2)$ is satisfiable with model $a = 5$.
    \item $a = 5$ is a model of $\forall x \,(a \not = 2 \cdot x)$.
    \item $\varphi$ is satisfiable
    \end{itemize}
  \end{example}
\end{frame}

\section{Symbolic Approach to Quantified Bit-Vectors}
\begin{frame}
  \frametitle{Symbolic Approach to Quantified Bit-Vectors}
  Bit-vector formulas can be represented by \alert{binary decision diagrams} (BDD).

  \bigskip

  Assuming that $x^{[4]} = x_3x_2x_1x_0$, formula
  \[
    x^{[4]} >_u 0
  \]
  is represented by

  \begin{center}
  \begin{tikzpicture}[every node/.style={draw, circle}]
    \node (x0) at (2,4) {$x_0$};
    \node (x1) at (3,3) {$x_1$};
    \node (x2) at (4,2) {$x_2$};
    \node (x3) at (5,1) {$x_3$};

    \node [rectangle] (true) at (0,0) {true};
    \node [rectangle] (false) at (6,0) {false};

    \path[auto, every node/.style={}, above, dashed]
    (x0) edge [above right] node {$0$} (x1)
    (x1) edge [above right] node {$0$} (x2)
    (x2) edge [above right] node {$0$} (x3)
    (x3) edge [above right] node {$0$} (false);

    \path[auto, every node/.style={}, above left]
    (x0) edge [] node {$1$} (true)
    (x1) edge [] node {$1$} (true)
    (x2) edge [] node {$1$} (true)
    (x3) edge [] node {$1$} (true);

  \end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}
  \frametitle{Symbolic Approach to Quantified Bit-Vectors}

  Efficient algorithm are known for operations with BDDs (conjunction,
  disjunction, quantifiers).

  \bigskip

  Quantification usually reduces the size of the BDD -- useful for
  quantified bit-vectors.

  \bigskip

  Representation by (reduced and ordered) BDDs is canonical -- formula
  is unsatisfiable iff the BDD has root false.
\end{frame}

\begin{frame}
  We have implemented the solver Q3B, which
  \begin{itemize}
  \item simplifies the formula,
  \item converts the formula to the BDD,
  \item tries to use approximations if the precise BDD computation is
    too expensive.
  \end{itemize}

  \bigskip

  Our results and results of SMT-COMP 2016 show that Q3B is
  \alert{more efficient} than standard SMT solvers.
\end{frame}

\section{Aims of the Work}
\begin{frame}
  \frametitle{Aims of the Work}
  \textbf{Major aims}
  \begin{itemize}
  \item Further development of the symbolic solver for quantified-bit
    vectors.
  \item Hybrid approach to quantified bit-vectors.
  \end{itemize}

  \bigskip

  \textbf{Minor aims}
  \begin{itemize}
  \item Determining a computational complexity of quantified bit-vector logic with
    bit-widths represented in binary.
  \item Extending simplifications using unconstrained variables
  \end{itemize}
\end{frame}

\section{Publications}
\begin{frame}
  \frametitle{Publications}
  \begin{itemize}
  \item \textsc{Jonáš}, M. and J. \textsc{Strejček}. \emph{``Solving
      Quantified Bit-Vector Formulas Using Binary Decision Diagrams.''}
    In: SAT 2016, Bordeaux, France, July 5-8, 2016, Proceedings. 2016,
    pp. 267-283 \bigskip

  Main author of the text of the paper, implemented the SMT solver and conducted all the experiments.
\item \textsc{Chalupa} M., M. \textsc{Jonáš}, J. \textsc{Slabý},
  J. \textsc{Strejček}, and M. \textsc{Vitovská}. \emph{``Symbiotic 3:
    New Slicer and Error-Witness Generation -- (Competition
    Contribution).''} In: TACAS 2016, Eindhoven, The Netherlands, April
  2-8, 2016, Proceedings, pp. 946-949

  \bigskip

  Wrote parts of the paper and prepared the environment that was used
  to run experiments with the implemented tool Symbiotic.
\end{itemize}
\end{frame}

\end{document}

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