-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use multiple solvers in qalpha #140
Conversation
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.
I left a bunch of comments, but it's mostly just code-style advice.
This PR would be a great candidate for benchmarking, so you might want to add some benchmarking on top of #142. If you already have some data on the performance impact of this change from your own benchmarking script please include that data in the PR description.
@tchajed When trying to factor out Let me know what you think. I'll rebase and update the pull request description soon. |
0e73b8e
to
259c380
Compare
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.
I like the trait solution, that nicely abstracts over what we need in this case!
Can you update the PR description? Other than that (and the usual rebase onto main) this is ready to merge.
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
This also defines two implementations of the basic solver trait, one for a single solver configuration and another for multiple solvers used sequentially in a fallback fashion. Using this, the multi-solver bahavior previously implemented in inference has been factored out and made more generic. Signed-off-by: edenfrenkel <[email protected]>
The option to use fallback solvers as before is maintained via the flag `--fallback`. Signed-off-by: edenfrenkel <[email protected]>
Using the hierarchical cancellation enabled by `SolverCancelers`, functions should only cancel queries which they (perhaps recursively) launched. When the result is bubbled up to higher callers, they should cancel their queries according to their own desired behavior. This allows more general applicablity which is independent of the specific goals of any single use-case, (in this case qalpha.) Signed-off-by: edenfrenkel <[email protected]>
Signed-off-by: edenfrenkel <[email protected]>
259c380
to
58139d3
Compare
@tchajed updated and rebased |
This defines a
BasicSolver
trait insolver/src/basics.rs
, which allows making very basiccheck-sat
queries which return asat
result together with a trace, anunsat
result together with an unsat-core, orunknown
. By abstracting this basic functionality it is possible to implement this trait for a singleSolverConf
, as well as for a vector ofSolverConf
's in two different ways, once asFallbackSolvers
tried sequentially and second asParallelSolvers
tried in parallel. This is utilized inqalpha
, which now usesParallelSolvers
for its inductiveness and safety checks by default, and is configurable to useFallbackSolvers
instead via--fallback
. The simulation queries inqalpha
still use a singleSolverConf
, now abstracted behind theBasicSolver
trait as well.Solver cancellation has also been moved out of the inference code and made more generic, using the new
BasicSolverCanceler
trait andSolverCancelers
struct, which aggregates multipleBasicSolverCanceler
's and itself implementsBasicSolverCanceler
. This is used recursively to create hierarchical tree-like cancellation, where the cancellation of a node cancels all of its descendants. The idea is that functions should only cancel queries which they (perhaps recursively) launched and not assume anything about the behavior of their callers. When the result is bubbled up to those callers, they should cancel their queries according to their own desired behavior. This allows more general applicablity which is independent of the specific goals of any single use-case, (in this caseqalpha
, which cancels all solvers on the firstsat
result.)Another change is that now transition queries parallelize over disjunctive transitions, with proper cancellation if a
sat
response is encountered.