I would like to use Z3 to optimize a set of equations. The problem hereby is my equations are non-linear but most importantly they do have trigonometric functions. Is there a way to deal with that in z3? I am using the z3py API.
相关问题
- How to compute with Quaternion numbers in Z3?
- HTML5 - Canvas - Optimization for large images
- Need help fixing an algorithm that approximates pi
- Z3 real arithmetics and data types theories integr
- Improving performance of a function in python
相关文章
- Optimization techniques for backtracking regex imp
- Logging Django SQL queries with DEBUG set to False
- Optimising this C (AVR) code
- Pointer dereferencing overhead vs branching / cond
- What's the best way to minify the ASP.NET gene
- JavaScript replace with callback - performance que
- Java Optimization String vs Char Arrays
- Are preg_match() and preg_replace() slow?
Transcendental numbers and trigonometric functions are usually not supported by SMT solvers.
As Christopher pointed out (thanks!), Z3 does have support for trigonometric functions and transcendentals; but the support is rather quite limited. (In practice, this means you shouldn't expect Z3 to decide every single formula you throw at it; in complicated cases, it's most likely to simply return
unknown
.)See https://link.springer.com/chapter/10.1007%2F978-3-642-38574-2_12 for the related publication. There are some examples in the following discussion thread that can get you started: https://github.com/Z3Prover/z3/issues/680
Also, note that the optimizing solver of Z3 doesn't handle nonlinear equations; so you wouldn't be able to optimize them. For this sort of optimization problems, traditional SMT solvers are just not the right choice.
However, if you're happy with δ-satisfiability (allowing a certain error factor), then check out
dReal
, which can deal with trigonometric functions: http://dreal.github.io/ So far as I can tell, however, it doesn't perform optimization.