Closed Lukas-Dresel closed 2 years ago
Implement unknown as an exception the same way as I got halfway through doing in order to support timeouts better?
On Thu, Sep 6, 2018 at 1:26 PM Lukas Dresel notifications@github.com wrote:
So, @rhelmot https://github.com/rhelmot , @zardus https://github.com/zardus , @ltfish https://github.com/ltfish: we have an interesting dilemma on our hands now where we implemented a portfolio frontend dishing the constraints out to multiple different solvers and returning the first answers received by any of the solvers.
However, some solvers, e.g. CVC4, return unknown almost immediately for some constraints they can't deal with. This means we now need to be able to differentiate between unknown, unsat and sat results returned from solvers in order to only accept answers in the portfolio that are certain. What do you think is the best way to deal with this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angr/claripy/issues/89, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYg9WnKfGFNEs1Z7Hq69YbLJIwJBkZHks5uYYT_gaJpZM4Wdp8P .
We have the following ideas to deal with this issue:
check_satisfiability
for now, that actually returns the solver response as it is received, so 'SAT'
, 'UNSAT'
or 'UNKNOWN'
ResultUnknown
exceptionsatisfiable
return None in the case of unknown
, this would still evaluate to FalseRight now I think this list is in the order of our preference as we think what the cleanest solutions are.
We already have a function, it's called satisfiable()
. We can just make it return members of an enum who we override the __nonzero__
such that SAT is truthy and the rest are falsey. I like that idea the best.
I agree with @rhelmot. Let's go for an enum, with only SAT being truthy. If we also override __eq__
to evaluate to z3.sat and "sat" as well, then I think we'll have a nice universal solution.
This issue has been marked as stale
because it has no recent activity. Please comment or add the pinned
tag to prevent this issue from being closed.
This issue has been marked as stale
because it has no recent activity. Please comment or add the pinned
tag to prevent this issue from being closed.
This is now solved as of #285 - there are multiple kinds of unknowns, each of which gets a different kind of exception raised for them.
So, @rhelmot , @zardus , @ltfish: we have an interesting dilemma on our hands now where we implemented a portfolio frontend dishing the constraints out to multiple different solvers and returning the first answers received by any of the solvers.
However, some solvers, e.g. CVC4, return
unknown
almost immediately for some constraints they can't deal with. This means we now need to be able to differentiate betweenunknown
,unsat
andsat
results returned from solvers in order to only accept answers in the portfolio that are certain. What do you think is the best way to deal with this?