Code Monkey home page Code Monkey logo

Comments (5)

zardus avatar zardus commented on June 27, 2024

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.

axt avatar axt commented on June 27, 2024

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.

rhelmot avatar rhelmot commented on June 27, 2024

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.

zardus avatar zardus commented on June 27, 2024

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.

ltfish avatar ltfish commented on June 27, 2024

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)

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.