Comments (5)
That looks like it should work, but it seems more accurate to set a = claripy.BVV(0, 32)
. -1
is negative, after all.
from claripy.
I'm not sure if this approach is correct, but this is how I try to infer ranges of singed variables:
https://github.com/axt/angr-utils/blob/master/angrutils/expr.py
If you check the sat_negative
function, what I do is to evaluate if the highest bit of the variable being one could be satisfied.
from claripy.
Can confirm that this approach is correct too. I have no idea what the performance looks like compared to the inequality method, but my suspicion is that z3 is more heavily optimized for inequalities than bit-extraction logic. I really wish we had someone on z3 to whom we can ask these questions, or at least someone with a background in SMT solving...
from claripy.
For bit-vectors, it wouldn't surprise me if the bit-extraction logic was better, in terms of Z3 being able to come up with simpler constraints internally for the actual solve, but I'm definitely as clueless about the inner workings of SMT solvers as the average bear.
from claripy.
I really wish we had someone on z3 to whom we can ask these questions, or at least someone with a background in SMT solving
Just open an issue on Z3Solver GitHub repo!
from claripy.
Related Issues (20)
- Undeclared dependency on `six`
- Z3 StringV abstraction broken
- pytest skips tests HOT 1
- Replace `__pos__` op with `lambda x: x` HOT 2
- Deprecation warning for `__truediv__` for `BV`s HOT 6
- Calling solver max twice changes the result. HOT 1
- `pytest -n` fails because of `signal` occasionally
- master's CI is hanging HOT 1
- Converting StringV to Z3 looses trailing null bytes
- Unable to abstract StringS from Z3 HOT 4
- Frontend.downsize() HOT 4
- "TypeError: unhashable type: 'set'" exception in _unpack_truisms_Or() HOT 3
- ModelCacheMixin does not handle extra_constraints correctly for min HOT 1
- Expressions annotated with SimplificationAvoidanceAnnotation cause an AttributeError during simplification
- 9.2.47: various failing tests HOT 3
- Over-design for `BackendManager`? HOT 3
- setup.cfg has a typo in url
- Base.replace cannot work on Bool
- Non-terminating _excavate_ite
- Length matching error when using the `and` bit operation on two conditional expressions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from claripy.