Commit c9bab3f4 authored by Martin Jonáš's avatar Martin Jonáš
Browse files

Multiple changes

parent 8bf1493a
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
@@ -1047,3 +1047,55 @@ year = {2005},
  booktitle = {13th International Workshop on Satisfiability Modulo
                 Theories (SMT 2015)},
  year = 	 2015}

@inproceedings{FKB13,
  author    = {Andreas Fr{\"{o}}hlich and
               Gergely Kov{\'{a}}sznai and
               Armin Biere},
  title     = {More on the Complexity of Quantifier-Free Fixed-Size Bit-Vector Logics
               with Binary Encoding},
  booktitle = {Computer Science - Theory and Applications - 8th International Computer
               Science Symposium in Russia, {CSR} 2013, Ekaterinburg, Russia, June
               25-29, 2013. Proceedings},
  pages     = {378--390},
  year      = {2013}
}

@MISC{BST10,
  author =	 {Clark Barrett and Aaron Stump and Cesare Tinelli},
  title =	 {{The Satisfiability Modulo Theories Library (SMT-LIB)}},
  howpublished = {{\tt www.SMT-LIB.org}},
  year =	 2010,
}

@INCOLLECTION{BHB14,
  author = {Petr Bauch and Vojt\v{e}ch Havel and Ji\v{r}\'{\i} Barnat},
  title = {{LTL Model Checking of LLVM Bitcode with Symbolic Data}},
  booktitle = {{MEMICS} 2014},
  publisher = {Springer},
  year = 2014,
  volume = 8934,
  series = {LNCS},
  pages = {47--59},
}

@article{Bry91,
 author = {Bryant, Randal E.},
 title = {{On the Complexity of VLSI Implementations and Graph Representations of Boolean Functions with Application to Integer Multiplication}},
 journal = {IEEE Trans. Comput.},
 volume = {40},
 number = {2},
 year = {1991},
 issn = {0018-9340},
 pages = {205--213},
 publisher = {IEEE Computer Society},
}

@inproceedings{Rud93,
  author    = {Richard Rudell},
  title     = {Dynamic variable ordering for ordered binary decision diagrams},
  booktitle = {Proceedings of the 1993 {IEEE/ACM} International Conference on Computer-Aided
               Design, 1993},
  pages     = {42--47},
  year      = {1993}
}
 No newline at end of file
+80 −56
Original line number Diff line number Diff line
@@ -269,29 +269,26 @@ theories.

Notable examples of decidable first-order theories include
\begin{itemize}
\item the theory of \emph{equality and uninterpreted functions}
  $\teuf$, which contains all structures that interpret the predicate
  $=$ as a congruence with respect to all other functions,
\item the theory of \emph{equality and uninterpreted functions}, which
  contains all structures that interpret the predicate $=$ as a
  congruence with respect to all other functions,
\item the theory of \emph{linear integer arithmetic}, which consists
  of all structures from $\teuf$ that are isomorphic to the set of
  integers and interpret the function $+$ as addition and the
  predicate $\leq$ as the integer comparison;
\item the theory of \emph{linear real arithmetic}, which consists of
  all structures from $\teuf$ that are isomorphic to real numbers and
  interpret the function $+$ as addition, and the predicate $\leq$ as
  the real comparison;
  of all structures isomorphic to integers with the function $+$ and
  predicates $\leq$ and $=$,
\item the theory of \emph{linear real arithmetic}, which consists
  of all structures isomorphic to real numbers with the function $+$ and
  predicates $\leq$ and $=$,
\item the theory of \emph{real arithmetic}\marginpar{In contrast to
    real arithmetic, integer arithmetic with multiplication was shown
    to be undecidable by Gödel.}, which consists of all structures
  from $\teuf$ that are isomorphic to real numbers and interpret the
  function $+$ as addition, $\times$ as multiplication, and the
  predicate $\leq$ as the real comparison;
  isomorphic to real numbers with functions $+$ and $\times$ and
  predicates $\leq$ and $=$,
\item the theory of \emph{arrays}, which consists of all structures
  from $\teuf$ isomorphic to the set of arrays with a binary function
  $read(a, i)$ interpreted as a value in the index $i$ of the array
  $a$, and a ternary function $write(a, i, v)$ interpreted as an array
  $a$ modified to contain the value $v$ on the index $i$;
\item the theory of fixed-size bit-vectors.
  isomorphic to the set of arrays with a binary function $read(a, i)$
  interpreted as a value in the index $i$ of the array $a$, and a
  ternary function $write(a, i, v)$ interpreted as an array $a$
  modified to contain the value $v$ on the index $i$;
\item the theory of \emph{fixed-size bit-vectors}. \marginpar{TODO: describe}
\end{itemize}
For a detailed description of these theories and implementation of the
respective $T$-solvers, we refer the reader for example to the book of
@@ -496,7 +493,8 @@ preprocessing, and eager or lazy translation of the bit-vector formula
to the equivalent propositional formula, which is subsequently solved
by a \sat solver. The transformation of a bit-vector formula to the
equivalent propositional formula is traditionally called
\emph{bit-blasting}~\cite{Kro08}. More lazy approach to the
\emph{bit-blasting}~\cite{Kro08}.  \marginpar{TODO: Nepřidat odstavec
  o propagating-complete \cnf encodings?} More lazy approach to the
bit-blasting is benefitial when the theory combination is
required. For example, solvers Z3 and Yices apply bit-blasting to all
operations except for the equality, which is handled by a specialized
@@ -509,9 +507,7 @@ possibly faster but incomplete sub-solvers for equality and inequality
reasoning and if the sub-solvers are not sufficient for deciding the
satisfiability of the formula, theory lemmas and propagated literals
generated by the sub-solvers are added to the formula and a lazy
\dpllt bit-blasting solver is
employed~\cite{HBJBT14}. \marginpar{TODO: Nepřidat odstavec o
  propagating-complete \cnf encodings?}
\dpllt bit-blasting solver is employed~\cite{HBJBT14}.

\subsection{Word-level techinques}
Although bit-blasting is highly efficient for most of practical
@@ -625,18 +621,17 @@ Although the bit-vector theory admits quantifier elimination by
expanding all quantifiers with all possible bit-vector values of the
corresponding bit-width, this is rarely practical approach. Instead,
the formula is usually converted to a equisatisfiable formula by
Skolemization and then instances of the universal quantifiers are
lazily added to the formula until a model is found by a solver for
quantifier-free bit-vector formulas or the formula is found to be
unsatisfiable. There are multiple ways to choose quantifier instances
that are sufficient to decide the satisfiability of the formula. For
the bit-vector theory, the most widely used approach is the
\emph{model-based quantifier instantiation} approach~\cite{GM09},
supported by Z3, CVC4, and Yices, combined by heuristics as E-matching
or symbolic quantifier instantiation~\cite{WHD13,Dut15}. Additionally,
for dealing with quantifiers, CVC4 supports solving quantified
formulas by \emph{counter-example guided quantifier
  instantiation}~\cite{RDKT15}.
Skolemization and then instances of the universally quantified
formulas are lazily added to the formula until a model is found or the
formula is found to be unsatisfiable by a \QFBV solver. There are
multiple ways to choose quantifier instances that are sufficient to
decide the satisfiability of the formula. For the bit-vector theory,
the most widely used approach is the \emph{model-based quantifier
  instantiation} approach~\cite{GM09}, supported by Z3, CVC4, and
Yices, combined by heuristics as E-matching or symbolic quantifier
instantiation~\cite{WHD13,Dut15}. Additionally, for dealing with
quantifiers, CVC4 supports solving quantified formulas by
\emph{counter-example guided quantifier instantiation}~\cite{RDKT15}.
% and \emph{finite model finding}~\cite{RTG13}.
However, we describe only the model-based quantifier instantiation in
detail, as the counter-example guided quantifier considers all
@@ -646,7 +641,8 @@ its performance on bit-vector formulas is limited.
\subsection{Model-based quantifier instantiation}
Given a closed formula with quantifiers, the first step is to convert
the formula to the negation normal form and apply Skolemization to
obtain equisatisfiable formula of the form
obtain equisatisfiable formula of the form \marginpar{TODO: V
  preliminaries vysvětlit notaci $\psi[x_1, \ldots, x_n]$}
\[
   \varphi ~\wedge~ \forall x_1, x_2, \dots, x_n\, (\psi[x_1, \dots, x_n]),
\]
@@ -695,32 +691,31 @@ This algorithm is trivially terminating, since there is only a finite
number of distinct models $M$ of $\varphi$. However, in some cases
exponentially many such models have to be ruled out before the solver
is able to find a correct model or decide unsatisfiability of the
whole formula. To overcome this issue, state-of-the-art SMT solvers do
not use just instances of the form $\psi[v_1, \dots, v_n]$ with
concrete values, but employ heuristics such as
E-matching~\cite{DNS05,MB07} or symbolic quantifier
instantiation~\cite{WHD13} to choose instances with ground terms which
can potentially rule out more spurious models and thus significantly
reduce the number of iterations of the algorithm. In practice,
suitable ground terms substituted for quantified variables are
selected only from subterms of the input formula.
whole formula. To overcome this issue, state-of-the-art \smt solvers
do not use just instances of the form $\psi[v_1, \dots, v_n]$ with
concrete values, but employ mentioned heuristics such as E-matching or
symbolic quantifier instantiation to choose instances with ground
terms that can potentially rule out more spurious models and thus
significantly reduce the number of iterations of the algorithm. In
practice, suitable ground terms substituted for quantified variables
are selected only from subterms of the input formula.

Note that Skolemization introduces uninterpreted functions to the
quantified formulas of form other than
$\exists^*\forall^*\varphi$. This class of formulas is usually called
\emph{exists/forall}, or simply $\exists\forall$. Therefore, for the
model-based quantifier instantiation approach to be usable for
formulas not from the exists/forall class, the underlying
quantifier-free bit-vector solver has to support reasoning about
uninterpreted functions. In case of Z3, this is achieved by
\emph{template-based model finding} -- uninterpreted functions are
assigned templates and the quantifier-free \smt solver is used to find
parameters of these templates, which satisfy the formula. For example,
an uninterpreted function $f$ may be assigned a linear template
$f(x) = ax + b$ and finding a model of $f$ reduces to finding
parameters $a$ and $b$.

\section{Computational complexity}
formulas not from the exists/forall class, the underlying \QFBV solver
has to support reasoning about uninterpreted functions. In case of Z3,
this is achieved by \emph{template-based model finding} --
uninterpreted functions are assigned templates and the \QFBV solver is
used to find satisfying parameters of these templates. For example, an
uninterpreted function $f$ may be assigned a template for linear
functions $f(x) = ax + b$ and finding a satisfying function $f$
reduces to finding values $a$ and $b$.


\section{Computational complexity of bit-vector logics}
The propositional satisfiability problem is well known from the
computational complexity perspective, as it is the first problem that
was shown to be \NP-complete. The complexity of the satisfiability
@@ -736,7 +731,36 @@ combination with the theory of uninterpreted functions is denoted by
the prefix UF, and the problems with unary and binary encoded
bit-widths are denoted by suffixes 1 and 2, respectively. For example,
QF\_UFBV2 is the decision problem for quantifier free formulas with
uninterpreted functions and binary encoded bit-withs.
uninterpreted functions and binary encoded bit-withs. The completeness
results for these classes are summarized in table
\ref{tbl:complexity}, and briefly explained in the rest of this section.

\begin{table}
\checkoddpage
\edef\side{\ifoddpage l\else r\fi}
\makebox[\textwidth][\side]{
\begin{minipage}[bt]{\fullwidth}
  \begin{center}
    \setlength{\tabcolsep}{0.6em}
    \begin{tabularx}{\textwidth}{l l l l X l r}
      \toprule
      & & \multicolumn{5}{c}{Quantifiers} \\
      \cmidrule(l){3-7}
      & & \multicolumn{2}{c}{No} & & \multicolumn{2}{c}{Yes} \\
      \cmidrule(l){3-4}
      \cmidrule(l){6-7}
      & & \multicolumn{2}{c}{Uninterpreted functions} & & \multicolumn{2}{c}{Uninterpreted functions} \\
      & & \multicolumn{1}{c}{No} & \multicolumn{1}{c}{Yes} & & \multicolumn{1}{c}{No} & \multicolumn{1}{c}{Yes} \\
      \midrule
      \multirow{2}{*}{Encoding~} & Unary & \NP & \NP & & \PSPACE & \NEXPTIME \\
       & Binary\hspace{2em} & \NEXPTIME & \NEXPTIME & & ? & \NNEXPTIME \\
      \bottomrule
    \end{tabularx}
  \end{center}
  \caption{Completeness results for various bit-vector logics and encodings~\cite{FKB13}.}
  \label{tbl:complexity}
\end{minipage}}
\end{table}

\paragraph{Unary encoded bit-widths} The bit-blasting yields a
polynomial time reduction from QF\_BV1 to \sat, showing that QF\_BV1
+105 −103

File changed.

Preview size limit exceeded, changes collapsed.

+7 −0
Original line number Diff line number Diff line
@@ -79,6 +79,13 @@
%\setcounter{page}{90}
% use \cleardoublepage here to avoid problems with pdfbookmark
\cleardoublepage
\newlength\fullmarginwidth
\fullmarginwidth=\marginparwidth
\advance\fullmarginwidth by \marginparsep

\newlength\fullwidth
\fullwidth=\textwidth
\advance\fullwidth by \fullmarginwidth
\include{Chapters/Chapter01}
\include{Chapters/Chapter02}
%\addtocontents{toc}{\protect\clearpage} % <--- just debug stuff, ignore
+5 −5
Original line number Diff line number Diff line
\thispagestyle{empty}

\hfill
%\hfill

\vfill
%\vfill

\noindent\myName: \textit{\myTitle,} \mySubtitle, %\myDegree, 
\textcopyright\ \myTime
%\noindent\myName: \textit{\myTitle,} \mySubtitle, %\myDegree,
%\textcopyright\ \myTime

%\bigskip
%
Loading