Giter VIP home page Giter VIP logo

dreal4's Introduction

Ubuntu OS X Coverage Builds/UnitTests Coverity Scan
Coverity Scan Build Status

dReal: An SMT Solver for Nonlinear Theories of the Reals

Please visit http://dreal.cs.cmu.edu for more information.

Download

Please check out our releases page to download latest static binaries.

How to Build

In most cases, running ./build.sh in the top dReal directory should suffice. If not, see below.

Required Packages

Documentations

dreal4's People

Contributors

em-mcg avatar jwnimmer-tri avatar martinjos avatar scungao avatar soonho-tri avatar soonhokong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dreal4's Issues

Packaging

bazel build //:package collects what we need. After untar the package, we can do:

g++-4.9 --std=c++14 sat_checker.cc                      \
		`pkg-config --cflags --libs ibex`       \
		-I./usr/include -I./usr/include/dreal/  \
		-Lusr/lib -ldreal

TODOs:

  • In OSX, we still need to fix the rpath of the generated library. We do this in make_package.sh but should be done inside of bazel.

  • In Ubuntu, users need to set LD_LIBRARY_PATH. There is a way to avoid it and we can mention the technique and show it in an exmple.

  • Need to set-up dreal.pc (pkg-config) file. So that one can do:

    g++-4.9 --std=c++14 sat_checker.cc `pkg-config --cflags --libs dreal`

Evaluator needs an update

  • Given f = e1 rop e2, it should return a pair ({VALID, UNSAT, UNKNOWN} x Interval).

  • Since IBEX does not handle e1 != e2, we need to add:

      const ibex::ExprNode* Convert(const Expression& e);
    

    to convert e1 - e2 and use it in Evaluator instead of f.

Build error

Ubuntu16 + gcc-5

===
npz3@godel:~/src/dreal4$ bazel  build --compiler gcc-5 //...
INFO: Analysed 391 targets (0 packages loaded).
INFO: Found 391 targets...
ERROR: /home/npz3/src/dreal4/test/BUILD:7:1: Linking of rule '//test:ibex_test' failed (Exit 1)
/usr/local/lib/libCoinUtils.so: undefined reference to `dgetrf_'
/usr/local/lib/libCoinUtils.so: undefined reference to `dgetrs_'
collect2: error: ld returned 1 exit status
INFO: Elapsed time: 10.557s, Critical Path: 9.09s
FAILED: Build did NOT complete successfully
===

Fix test sizes

  1. fix warnings from --test_verbose_timeout_warnings.
  2. add smt2_test, dr_test where we can specify an explicit size.

Revisit SMT2 parsing

Need to introduce term instead of having formula and expression at the parsing-level.

Valgrind has limited supports for rounding-modes.

I've observed a different behavior of dReal when it's run with valgrind. Here is a self-included example-program showing the issue:

#include <cfenv>
#include <limits>
#include <iostream>
#include <cmath>

using std::cout;
using std::endl;
using std::numeric_limits;

int main() {
  double x = M_PI;
  double y = M_E;
  cout.precision(numeric_limits<double>::max_digits10 + 2);
  fesetround(FE_DOWNWARD);
  cout << (x * y) / x << endl;
  fesetround(FE_UPWARD);
  cout << (x * y) / x << endl;
}

Without valgrind, we have:

2.718281828459044646
2.718281828459045979

With valgrind, we have:

2.71828182845904509
2.718281828459045091

This limitation is actually documented in the manual:

Rounding: Valgrind does observe the 4 IEEE-mandated rounding modes (to nearest, to +infinity, to -infinity, to zero) for the following conversions: float to integer, integer to float where there is a possibility of loss of precision, and float-to-float rounding. For all other FP operations, only the IEEE default mode (round to nearest) is supported.

http://valgrind.org/docs/manual/manual-core.html

Change Evaluator for forall case

For ∀y f(x, y), we will evaluate f(x, y) using the domain of y.
Find a counterexample,!f(a, b) and check ||f(I_x, b)|| < \delta.

Add high-level APIs

  • checking satisfiability of a formula
  • constrained/unconstrained optimization

Handle ceil/floor

For ceil(e), we can introduce an integer variable i with a constraint e <= i < e + 1. Then substitute ceil(e) with i in expressions.

We can do the similar thing for floor(e): e - 1 < i <= e.

Potential memory leak

const ExprNode* IbexConverter::VisitConstant(const Expression& e) {
// Case e := c.
// We bloat the constant c into a smallest interval [lb, ub] to avoid
// numerical issues.
const double c{get_constant_value(e)};
return &ibex::ExprConstant::new_scalar(BloatPoint(c));
}

Changing line 98 to return &ibex::ExprConstant::new_scalar(c); causes memory leaks. I'm investigating the issue.

Dreal4 Static Binary

There is no option to build a static-binary of dReal4 in the bazel build.

Can you provide this feature ?
As an alternate solution, can you provide the static-binary in the Download section?

Support ITE

TODO

  • Add support ite in parser/scanner.
  • Add ITE-elim phase: Recursively rewriting F[ite(C, t₁, t₂)] => (C ⇒ F[t₁]) ∧ (C ⇒ F[t₂]).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.