-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are there any methods provided by haybale for constraining certain variables? #19
Comments
I found that |
One way to do this is:
For a more thorough solution, you can take a look at what |
This comment was marked as abuse.
This comment was marked as abuse.
You can do let context_inmem = mutState.read(&contextPtr, struct_size_bits).unwrap();
context_inmem._eq(&context).assert().unwrap(); Or, even better, just constrain the let context = mutState.read(&contextPtr, struct_size_bits).unwrap(); // instead of BV::new
// use `context` as in the above comment |
Thanks, I see now what you mean!
Is necessary for us to allocate the |
Sorry for the delayed response (to this and the other thread) -- a lot on my plate right now. Yes, you will have to initialize those other fields if you want Haybale to consider specific values for them. If you don't initialize them, Haybale will consider that memory to be unconstrained, i.e., could have any value, including NULL, hence the null pointer error. For null pointer errors specifically, you may want to configure |
Haha, no problem. Then I need to initialize those fields. Otherwise, not only it will lead to the null pointer error, but also may consume a large of time to solve constraints. Thanks! |
e.g.
So I just want to take "context->y" as a symbolic value and restrict "context->x" to 1. Can we reach this but not modify the origin LLVM IR ?
The text was updated successfully, but these errors were encountered: