-
Notifications
You must be signed in to change notification settings - Fork 171
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
Native Z3 interface #848
Native Z3 interface #848
Conversation
If any of you want to look:
|
Another weird bug, documenting here to pick up later
z3 exprs generated:
|
nice!! |
Another simple looking transform which doesn't verify.
|
it might make you feel better to know that the problem with overflow intrinsics isn't related to path conditions, this can't be verified either:
|
ok so your add.with.overflow isn't computing the right result when there's overflow. remember: always simplify the circumstances surrounding a failing test.
(this verifies using the old backend and using Alive2, but not using your new one) |
this one does verify
|
so does this one
|
|
concat order was wrong, everything seems to be working now. |
ok, nice work! I want a test case for timeouts using this API. do like a 1024 bit division or something like that where it has no chance whatsoever of completing. have you tried turning off the KLEE code entirely? does everything still work in that case? |
include/souper/Infer/Z3Driver.h
Outdated
} | ||
bool verify(Inst *RHS, Inst *RHSAssumptions = nullptr) { | ||
Translate(RHS); | ||
if (RHSAssumptions) AddConstraint(RHSAssumptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the "then" part on another line please
so @manasij7479 do you want to land this and then do models in a separate pr? if so, that's fine I want you to support (and test) Z3 timeouts in this PR though |
include/souper/Infer/Z3Driver.h
Outdated
} | ||
|
||
bool Translate(souper::Inst *I) { | ||
if (!I) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on a new line
include/souper/Infer/Z3Driver.h
Outdated
|
||
} | ||
|
||
std::string Name = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary initializer
include/souper/Infer/Z3Driver.h
Outdated
case souper::Inst::Var: { | ||
Put(I, ctx.bv_const(Name.c_str(), W)); | ||
auto DFC = getDataflowConditions(I, IC); | ||
if (DFC) AddConstraint(DFC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the then part on a new line
@manasij7479 can you explain what the changes to the alive driver are doing? |
|
||
namespace souper { | ||
bool isTransformationValidZ3(souper::Inst *LHS, souper::Inst *RHS, | ||
const std::vector<InstMapping> &PCs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation
AliveDriver changes are just splitting out reusable code into a separate TU. |
Will do. |
Implemented but not yet tested support for timeouts. |
@manasij7479 the "weird valid transformation which escapes simplification" could be here: #738. Most likely the timeout will kick in before the synthesis candidate is verified as correct. I hope this helps and is not out of scope. |
very wide division by non-constant should do it |
See the newer PR |
*.with.overflow encoding seems mysteriously broken.
Other things work, and is about 20-30% faster than our klee+smtlib interface.
Don't merge yet.