sbv: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.

[ bit-vectors, bsd3, formal-methods, library, math, smt, symbolic-computation, theorem-provers ] [ Propose Tags ]

Express properties about Haskell programs and automatically prove them using SMT (Satisfiability Modulo Theories) solvers. Automatically generate C programs from Haskell functions. The SBV library adds support for symbolic bit vectors and other symbolic types, allowing formal models of Haskell programs to be created.

  $ ghci -XScopedTypeVariables
  Prelude> :m Data.SBV
  Prelude Data.SBV> prove $ \(x::SWord8) -> x `shiftL` 2 .== 4*x
  Q.E.D.
  Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
  Falsifiable. Counter-example:
    x = 128 :: SWord8

You can pick the SMT solver you want to use by importing the appropriate module. The SBV library currently works with the the following SMT solvers:

import Data.SBV
Picks the default solver, which is currently set to be Z3. (Might change in the future!)
import Data.SBV.Bridge.Z3
Picks Z3 from Microsoft (http://z3.codeplex.com/).
import Data.SBV.Bridge.Yices
Picks Yices from SRI (http://yices.csl.sri.com/)
import Data.SBV.Bridge.CVC4
Picks CVC4 from New York University and the University of Iowa (http://cvc4.cs.nyu.edu)
import Data.SBV.Bridge.Boolector
Picks Boolector from Johannes Kepler University at (http://fmv.jku.at/boolector/).

SBV introduces the following types and concepts:

  • SBool: Symbolic Booleans (bits)

  • SWord8, SWord16, SWord32, SWord64: Symbolic Words (unsigned)

  • SInt8, SInt16, SInt32, SInt64: Symbolic Ints (signed)

  • SInteger: Symbolic unbounded integers (signed)

  • SReal: Symbolic algebraic reals (signed)

  • SArray, SFunArray: Flat arrays of symbolic values

  • STree: Full binary trees of symbolic values (for fast symbolic access)

  • Symbolic polynomials over GF(2^n), and polynomial arithmetic

  • Uninterpreted constants and functions over symbolic values, with user defined axioms.

  • Uninterpreted sorts, and proofs over such sorts, potentially with axioms.

Functions built out of these types can be:

  • proven correct via an external SMT solver (the prove function)

  • checked for satisfiability (the sat, and allSat functions)

  • used in synthesis (the sat function with existential variables)

  • optimized with respect to cost functions (the optimize, maximize, and minimize functions)

  • quick-checked

  • used in concrete test case generation (the genTest function), rendered as values in various languages, including Haskell and C.

Predicates can have both existential and universal variables. Use of alternating quantifiers provides considerable expressive power. Furthermore, existential variables allow synthesis via model generation.

The SBV library can also compile Haskell functions that manipulate symbolic values directly to C, rendering them as straight-line C programs.

In addition to the library, the installation will create the executable SBVUnitTests. You should run it once the installation is complete, to make sure the unit tests are run and all is well.

SBV is hosted at GitHub: http://github.com/LeventErkok/sbv. Comments, bug reports, and patches are always welcome.

The following people reported bugs, provided comments/feedback, or contributed to the development of SBV in various ways: Ian Blumenfeld, Ian Calvert, Iavor Diatchki, John Erickson, Tom Hawkins, Lee Pike, Austin Seipp, Don Stewart, Josef Svenningsson, and Nis Wegmann.

Release notes can be seen at: http://github.com/LeventErkok/sbv/blob/master/RELEASENOTES.


[Skip to Readme]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.17, 0.9.18, 0.9.19, 0.9.20, 0.9.21, 0.9.22, 0.9.23, 0.9.24, 1.0, 1.1, 1.2, 1.3, 1.4, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.2, 4.3, 4.4, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 6.0, 6.1, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 7.10, 7.11, 7.12, 7.13, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 8.10, 8.11, 8.12, 8.13, 8.14, 8.15, 8.16, 8.17, 9.0 (info)
Change log CHANGES.md
Dependencies array, base (>=4 && <5), containers, deepseq, directory, filepath, HUnit, mtl, old-time, pretty, process, QuickCheck, random, sbv, syb [details]
License BSD-3-Clause
Copyright Levent Erkok, 2010-2013
Author Levent Erkok
Maintainer Levent Erkok (erkokl@gmail.com)
Category Formal Methods, Theorem Provers, Bit vectors, Symbolic Computation, Math, SMT
Home page http://leventerkok.github.com/sbv/
Bug tracker http://github.com/LeventErkok/sbv/issues
Source repo head: git clone git://github.com/LeventErkok/sbv.git
Uploaded by LeventErkok at 2013-03-22T04:25:22Z
Distributions Arch:8.17, Debian:8.7, LTSHaskell:8.17, NixOS:8.17
Executables SBVUnitTests
Downloads 69640 total (239 in the last 30 days)
Rating 2.75 (votes: 9) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for sbv-2.10

[back to package description]

SBV: SMT Based Verification in Haskell

Please see: http://leventerkok.github.com/sbv/