SMT solvers are useful both for verification, proving the
correctness of programs, software testing based on
symbolic execution, and for
synthesis, generating program fragments by searching over the space of possible programs. Outside of software verification, SMT solvers have also been used for
type inference and for modelling theoretic scenarios, including modelling actor beliefs in nuclear
arms control.
Verification Computer-aided
verification of computer programs often uses SMT solvers. A common technique is to translate preconditions, postconditions, loop conditions, and assertions into SMT formulas in order to determine if all properties can hold. There are many verifiers built on top of the
Z3 SMT solver. Boogie is an intermediate verification language that uses Z3 to automatically check simple imperative programs. The VCC verifier for concurrent C uses Boogie, as well as Dafny for imperative object-based programs, Chalice for concurrent programs, and Spec# for C#. F* is a dependently typed language that uses Z3 to find proofs; the compiler carries these proofs through to produce proof-carrying bytecode. The Viper verification infrastructure encodes verification conditions to Z3. The sbv library provides SMT-based verification of Haskell programs, and lets the user choose among a number of solvers such as Z3, ABC, Boolector, cvc5, MathSAT and Yices. There are also many verifiers built on top of the Alt-Ergo SMT solver. Here is a list of mature applications: • Why3, a platform for deductive program verification, uses Alt-Ergo as its main prover; • CAVEAT, a C-verifier developed by CEA and used by Airbus; Alt-Ergo was included in the qualification DO-178C of one of its recent aircraft; •
Frama-C, a framework to analyse C-code, uses Alt-Ergo in the Jessie and WP plugins (dedicated to "deductive program verification"); •
SPARK uses CVC4 and Alt-Ergo (behind GNATprove) to automate the verification of some assertions in SPARK 2014; •
Atelier-B can use Alt-Ergo instead of its main prover (increasing success from 84% to 98% on the ANR Bware project benchmarks ); •
Rodin, a B-method framework developed by Systerel, can use Alt-Ergo as a back-end; • Cubicle, an open source model checker for verifying safety properties of array-based transition systems. • EasyCrypt, a toolset for reasoning about relational properties of probabilistic computations with adversarial code. Many SMT solvers implement a common interface format called SMTLIB2 (such files usually have the extension ".smt2"). The LiquidHaskell tool implements a refinement type based verifier for Haskell that can use any SMTLIB2 compliant solver, e.g. cvc5, MathSat, or Z3.
Symbolic-execution based analysis and testing An important application of SMT solvers is
symbolic execution for analysis and testing of programs (e.g.,
concolic testing), aimed particularly at finding security vulnerabilities. Example tools in this category include SAGE from
Microsoft Research, KLEE, S2E, and Triton. SMT solvers that have been used for symbolic-execution applications include Z3, STP , the Z3str family of solvers, and Boolector.
Interactive theorem proving SMT solvers have been integrated with proof assistants, including
Rocq and
Isabelle/HOL. ==See also==