Here, we summarize a few areas in the
context of software modeling where
SMT solvers are used. Model programs
are behavioral specifications that can
be described succinctly and at a high
level of abstraction. These descriptions are state machines that use abstract domains. SMT solvers are used
to perform bounded model-checking
of such descriptions. The main idea of
bounded model-checking is to explore
a bounded symbolic execution of a program or model. Thus, given a bound
(such as 17), the transitions of the state
machines are unrolled into a logical formula describing all possible executions
using 17 steps. Model-based designs
use high-level languages for describing
software systems. Implementations are
derived by refinements. Modeling languages present an advantage, as they
allow software developers to explore a
design space without committing all
design decisions up front. SMT solvers are the symbolic reasoning engines
used in model-based designs; for example, they are used for type-checking
designs and in the search for different
consistent choices. Model-based testing uses high-level models of software
systems, including network protocols,
to derive test oracles. SMT solvers have
been used in this context for exploring
related models using symbolic execution. Model-based testing is used on a
large scale by Microsoft developers in
the context of disclosure and documentation of Microsoft network protocols.
24
The model-based tools use SMT solvers
for generating combinations of test inputs, as well as for performing symbolic
exploration of models.
Combining theory solvers
How to combine multiple theory solvers is a fundamental problem for
SMT solvers. As we discussed earlier,
applications ranging from test-case
generation to software verification require a combination of theories; for
example, a combination of arithmetic
and arrays is needed to reason about
Program 3. 5. Fundamental questions
include: Is the union of two decidable
theories still decidable? Is the union
consistent? And how can we combine
different theory solvers? In general,
combining theory solvers is a very
difficult problem. However, useful
special cases have good answers. An
one advantage of
using modern smt
solvers in static
program analysis
is they accurately
capture the
semantics of most
basic operations
used by mainstream
programming
languages.
established framework for combining
theory solvers is known as the Nelson-Oppen combination method,
29 which
assumes theories do not share symbols except for the equality relation.
When the only shared symbol is the
equality relation, we say the theories
are disjoint; for example, the theory of
linear arithmetic uses the constants,
functions, and relations +, 0, 1, ≤, and
the theory of arrays uses the disjoint
set read, write. It should also be possible to merge the models from the
two theory solvers into one without
contradicting assumptions one theory
might have about the size of models.
A condition that guarantees solutions
can be combined is known as “stable
infiniteness”; a theory T is stably infinite if whenever a (quantifier-free) formula is satisfiable in T, then it is satisfiable in a model of T with an infinite
universe (size).
In many practical cases, the dis-jointness and stable infiniteness conditions are easily satisfied when combining theory solvers. However, not all
theory combinations satisfy these side
conditions, and research over the past
10 years has sought to generalize the
framework where signatures are non-disjoint or where theories are non-sta-bly infinite.
22, 34
Convexity, complexity, and propositional search. Convexity is an important notion in the context of combining theories. A theory is convex if for all
sets of ground literals S and all sets of
equalities between variables E if S implies the disjunction of E, then it also
implies at least one equation of E; for
example, the theory of free functions is
convex, but difference arithmetic over
integers is not.
Convexity plays an important role in
operations research, as well as in SMT,
because efficient, polynomial time
techniques exist for combining solvers for convex theories.
31 The key property is that the equalities can be deduced, without backtracking, instead
of guessed, with backtracking. On the
other hand, nonconvex theories incur
a potential exponential time combination overhead. It therefore becomes an
additional requirement on solvers in
the Nelson-Oppen combination method that they also indicate which variables are implied equal based on a set
of assertions.