All Projects → dreal → Dreal4

dreal / Dreal4

Licence: apache-2.0
SMT Solver for Nonlinear Theories of Reals

Labels

Projects that are alternatives of or similar to Dreal4

the-thoralf-plugin
This a type-checker plugin to rule all type checker plugins involving type-equality reasoning using smt solvers.
Stars: ✭ 22 (-69.44%)
Mutual labels:  smt
z3 tutorial
Jupyter notebooks for tutorial on the Z3 SMT solver
Stars: ✭ 117 (+62.5%)
Mutual labels:  smt
Stp
Simple Theorem Prover, an efficient SMT solver for bitvectors
Stars: ✭ 341 (+373.61%)
Mutual labels:  smt
mailer-plugin
This plugin allows you to configure email notifications for build results
Stars: ✭ 35 (-51.39%)
Mutual labels:  smt
suslik
Synthesis of Heap-Manipulating Programs from Separation Logic
Stars: ✭ 107 (+48.61%)
Mutual labels:  smt
kafka-connect-transform-kryptonite
Kryptonite for Kafka is a client-side 🔒 field level 🔓 crypto library for Apache Kafka® currently focused on Kafka Connect scenarios. It's an ! UNOFFICIAL ! community project
Stars: ✭ 30 (-58.33%)
Mutual labels:  smt
scalogno
prototyping logic programming in Scala
Stars: ✭ 38 (-47.22%)
Mutual labels:  smt
Cvc4
CVC4 is an efficient open-source automatic theorem prover for satisfiability modulo theories (SMT) problems.
Stars: ✭ 476 (+561.11%)
Mutual labels:  smt
vim-smt2
A VIM plugin that adds support for the SMT-LIB2 format (including Z3's extensions)
Stars: ✭ 35 (-51.39%)
Mutual labels:  smt
Sat smt by example
"SAT/SMT by example" free ebook
Stars: ✭ 339 (+370.83%)
Mutual labels:  smt
py2many
Transpiler of Python to many other languages
Stars: ✭ 420 (+483.33%)
Mutual labels:  smt
haskell-z3
Haskell bindings to Microsoft's Z3 API (unofficial).
Stars: ✭ 48 (-33.33%)
Mutual labels:  smt
smt
A Go library that implements a Sparse Merkle tree for a key-value map.
Stars: ✭ 83 (+15.28%)
Mutual labels:  smt
TargomanSMT
Targoman SMT framework source code
Stars: ✭ 29 (-59.72%)
Mutual labels:  smt
Pysmt
pySMT: A library for SMT formulae manipulation and solving
Stars: ✭ 352 (+388.89%)
Mutual labels:  smt
stevia
A simple (unfinished) SMT solver for QF_ABV.
Stars: ✭ 30 (-58.33%)
Mutual labels:  smt
archsat
A proof-producing SMT/McSat solver, handling polymorphic first-order logic, and using an SMT/McSat core extended using Tableaux, Superposition and Rewriting.
Stars: ✭ 20 (-72.22%)
Mutual labels:  smt
Liquidhaskell
Liquid Types For Haskell
Stars: ✭ 863 (+1098.61%)
Mutual labels:  smt
Adafruit cad parts
CAD files for various boards, components and parts
Stars: ✭ 386 (+436.11%)
Mutual labels:  smt
Smack
SMACK Software Verifier and Verification Toolchain
Stars: ✭ 305 (+323.61%)
Mutual labels:  smt

dReal: An SMT Solver for Nonlinear Theories of Reals

License Build Status codecov

How to Install

macOS 11.0 / 10.15 / 10.14:

/usr/bin/curl -fsSL https://raw.githubusercontent.com/dreal/dreal4/master/setup/mac/install.sh | bash
dreal

Ubuntu 20.04 / 18.04 / 16.04:

# 20.04
sudo apt-get install curl
curl -fsSL https://raw.githubusercontent.com/dreal/dreal4/master/setup/ubuntu/20.04/install.sh | sudo bash

# 18.04
sudo apt-get install curl
curl -fsSL https://raw.githubusercontent.com/dreal/dreal4/master/setup/ubuntu/18.04/install.sh | sudo bash

# 16.04
sudo apt-get install curl
curl -fsSL https://raw.githubusercontent.com/dreal/dreal4/master/setup/ubuntu/16.04/install.sh | sudo bash

# Test the installation.
DREAL_VERSION=4.20.12.1
/opt/dreal/${DREAL_VERSION}/bin/dreal

Python Binding

Open In Google Colab

Some of the functionality of dReal is accessible via Python3. To install the binding, run the following:

pip3 install dreal

Note that you still need to install dReal prerequisites such as IBEX and CLP in your system. Please follow the instructions.

To test the Python binding, run python3 in a terminal and type the followings:

from dreal import *

x = Variable("x")
y = Variable("y")
z = Variable("z")

f_sat = And(0 <= x, x <= 10,
            0 <= y, y <= 10,
            0 <= z, z <= 10,
            sin(x) + cos(y) == z)

result = CheckSatisfiability(f_sat, 0.001)
print(result)

The last print statement should give:

x : [1.247234518484574339, 1.247580203674002686]
y : [8.929064928123818135, 8.929756298502674383]
z : [0.06815055407334302817, 0.06858905276351445757]

More examples are available at dreal4/dreal/test/python.

Docker

We provide a Docker image of dReal4 which is based on Ubuntu 18.04. Try the following to test it:

docker pull dreal/dreal4
docker run --rm dreal/dreal4 dreal -h  # Run "dreal -h"

How to Build

Install Prerequisites

macOS 11.0 / 10.15 / 10.14:

git clone https://github.com/dreal/dreal4 && cd dreal4
./setup/mac/install_prereqs.sh

Ubuntu 20.04 / 18.04 / 16.04

git clone https://github.com/dreal/dreal4 && cd dreal4
sudo ./setup/ubuntu/`lsb_release -r -s`/install_prereqs.sh

The install_prereqs.sh installs the following packages: bazel, bison, coinor-clp, flex, gmp, ibex, nlopt, python.

Build and Test

bazel build //...
bazel test //...                     # Run all tests
./bazel-bin/dreal/dreal <smt2_file>  # Run .smt2 file

By default, it builds a release build. To build a debug-build, run bazel build //... -c dbg. In macOS, pass --apple_generate_dsym to allow lldb/gdb to show symbols.

Bazel uses the system default compiler. To use a specific compiler, set up CC environment variable. For example, CC=gcc-8.0 bazel build //....

In CI, we test that dReal can be built using the following compilers:

C++ Documentation

Please check https://dreal.github.io/dreal4.

Build Debian Package

Run bazel build //:package_debian and find .deb file in bazel-bin directory.

How to Build Compilation Database

To build a Compilation Database, run:

bazel build //:compdb

How to Use dReal as a Library

We have prepared the following example projects using dReal as a library:

If you want to use pkg-config, you need to set up PKG_CONFIG_PATH as follows:

macOS 11.0 / 10.15 / 10.14:

export PKG_CONFIG_PATH=/usr/local/opt/[email protected]/share/pkgconfig:${PKG_CONFIG_PATH}

Ubuntu 20.04 / 18.04 / 16.04:

export PKG_CONFIG_PATH=/opt/dreal/4.20.12.1/lib/pkgconfig:/opt/libibex/2.7.4/share/pkgconfig:${PKG_CONFIG_PATH}

Then, pkg-config dreal --cflags and pkg-config dreal --libs should provide necessary information to use dReal. Note that setting up PKG_CONFIG_PATH is necessary to avoid possible conflicts (i.e. with ibex formula in Mac).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].