-
Notifications
You must be signed in to change notification settings - Fork 54
Add Prover Based ShutdownManager #489
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
base: master
Are you sure you want to change the base?
Changes from 34 commits
b8ccbe0
7422f4c
a43d183
5af69e6
2b81ac8
92f2f60
b048f56
e73b889
ba6c2bc
28d5648
5de5971
0f8e757
1b6f52b
77ab3d6
223624c
55f8e08
6613b21
843b0ee
e6587bd
418bc8b
c85042b
2fe5c2b
028ef5b
b122b50
b1ad38f
856d3b6
3b16949
fa7dfb2
37a58ee
3538fdc
9e6d0ba
02bdda9
30a74dd
1812dfc
17ec72e
5a20e6d
0b95f11
1cd34dd
c85c030
407f52a
384c7b1
97c44b6
cfa1cdb
799385c
b4fbc2f
1f5c866
676aebb
65407fb
2e83b93
ee5eee0
c1dc784
41daa1f
d06d41c
4a4cac8
0c683e8
79ba7d7
295e01a
a9023f9
3ca9316
9e63816
ac5be00
1d9ec5a
e4bf4e8
f16f77d
1ab6955
fc323b9
1b268a3
c4a7a65
b7da958
50094eb
89837d5
dbbdc31
b0e7b44
0ca8d4f
cd51b02
898832d
c900399
2166410
64b21b3
cd3ef20
477efd0
ca14eff
4b429db
d447902
22bc811
a75ec8a
5f30d42
b8c9a06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| package org.sosy_lab.java_smt.api; | ||
|
|
||
| import com.google.common.collect.ImmutableMap; | ||
| import org.sosy_lab.common.ShutdownNotifier; | ||
| import org.sosy_lab.java_smt.SolverContextFactory.Solvers; | ||
|
|
||
| /** | ||
|
|
@@ -65,6 +66,28 @@ enum ProverOptions { | |
| */ | ||
| ProverEnvironment newProverEnvironment(ProverOptions... options); | ||
|
|
||
| /** | ||
| * Create a fresh new {@link ProverEnvironment} which encapsulates an assertion stack and can be | ||
| * used to check formulas for unsatisfiability. Allows the shutdown of the prover instance | ||
| * returned with the given {@link ShutdownNotifier}, without stopping other provers of the context | ||
PhilippWendler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * calling this (except for provers also connected via the given {@link ShutdownNotifier}). | ||
| * | ||
| * @param pProverShutdownNotifier a {@link ShutdownNotifier} that stops the prover returned by | ||
| * this method. The prover is not usable anymore after a shutdown has been requested and only | ||
| * ever returns {@link InterruptedException}s. The context can be used normally and new | ||
PhilippWendler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * provers can be created and used. If a {@link ShutdownNotifier} has been given to the | ||
| * context that is used to call this method, both notifiers can be used to stop the prover | ||
| * returned by this method. Note that once a shutdown-request has been given to the contexts | ||
| * {@link ShutdownNotifier}, no prover can ever be used again on that context instance. | ||
| * Solvers that don't support isolated prover shutdown throw a {@link | ||
| * UnsupportedOperationException} for this method and {@link | ||
| * #newProverEnvironment(ProverOptions...)} should be used instead. | ||
PhilippWendler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * @param options Options specified for the prover environment. All the options specified in | ||
| * {@link ProverOptions} are turned off by default. | ||
| */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So far we've left it pretty open if a solver can be reused after a shutdown request. Should the JavaDoc for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. @kfriedberger do we want to put out a policy or just give out all info that we have and leave it to the users? |
||
| ProverEnvironment newProverEnvironment( | ||
| ShutdownNotifier pProverShutdownNotifier, ProverOptions... options); | ||
|
|
||
| /** | ||
| * Create a fresh new {@link InterpolatingProverEnvironment} which encapsulates an assertion stack | ||
| * and allows generating and retrieve interpolants for unsatisfiable formulas. If the SMT solver | ||
|
|
@@ -76,6 +99,31 @@ enum ProverOptions { | |
| */ | ||
| InterpolatingProverEnvironment<?> newProverEnvironmentWithInterpolation(ProverOptions... options); | ||
|
|
||
| /** | ||
| * Create a fresh new {@link InterpolatingProverEnvironment} which encapsulates an assertion stack | ||
| * and allows generating and retrieve interpolants for unsatisfiable formulas. If the SMT solver | ||
| * is able to handle satisfiability tests with assumptions please consider implementing the {@link | ||
| * InterpolatingProverEnvironment} interface, and return an Object of this type here. Allows the | ||
PhilippWendler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * shutdown of the prover instance returned with the given {@link ShutdownNotifier}, without | ||
| * stopping other provers of the context calling this (except for provers also connected via the | ||
| * given {@link ShutdownNotifier}). | ||
| * | ||
| * @param pProverShutdownNotifier a {@link ShutdownNotifier} that stops the prover returned by | ||
| * this method. The prover is not usable anymore after a shutdown has been requested and only | ||
| * ever returns {@link InterruptedException}s. The context can be used normally and new | ||
| * provers can be created and used. If a {@link ShutdownNotifier} has been given to the | ||
| * context that is used to call this method, both notifiers can be used to stop the prover | ||
| * returned by this method. Note that once a shutdown-request has been given to the contexts | ||
| * {@link ShutdownNotifier}, no prover can ever be used again on that context instance. | ||
| * Solvers that don't support isolated prover shutdown throw a {@link | ||
| * UnsupportedOperationException} for this method and {@link | ||
| * #newProverEnvironment(ProverOptions...)} should be used instead. | ||
| * @param options Options specified for the prover environment. All the options specified in | ||
| * {@link ProverOptions} are turned off by default. | ||
| */ | ||
| InterpolatingProverEnvironment<?> newProverEnvironmentWithInterpolation( | ||
| ShutdownNotifier pProverShutdownNotifier, ProverOptions... options); | ||
|
|
||
| /** | ||
| * Create a fresh new {@link OptimizationProverEnvironment} which encapsulates an assertion stack | ||
| * and allows solving optimization queries. | ||
|
|
@@ -85,6 +133,28 @@ enum ProverOptions { | |
| */ | ||
| OptimizationProverEnvironment newOptimizationProverEnvironment(ProverOptions... options); | ||
|
|
||
| /** | ||
| * Create a fresh new {@link OptimizationProverEnvironment} which encapsulates an assertion stack | ||
| * and allows solving optimization queries. Allows the shutdown of the prover instance returned | ||
| * with the given {@link ShutdownNotifier}, without stopping other provers of the context calling | ||
| * this (except for provers also connected via the given {@link ShutdownNotifier}). | ||
| * | ||
| * @param pProverShutdownNotifier a {@link ShutdownNotifier} that stops the prover returned by | ||
| * this method. The prover is not usable anymore after a shutdown has been requested and only | ||
| * ever returns {@link InterruptedException}s. The context can be used normally and new | ||
| * provers can be created and used. If a {@link ShutdownNotifier} has been given to the | ||
| * context that is used to call this method, both notifiers can be used to stop the prover | ||
| * returned by this method. Note that once a shutdown-request has been given to the contexts | ||
| * {@link ShutdownNotifier}, no prover can ever be used again on that context instance. | ||
| * Solvers that don't support isolated prover shutdown throw a {@link | ||
| * UnsupportedOperationException} for this method and {@link | ||
| * #newProverEnvironment(ProverOptions...)} should be used instead. | ||
| * @param options Options specified for the prover environment. All the options specified in | ||
| * {@link ProverOptions} are turned off by default. | ||
| */ | ||
| OptimizationProverEnvironment newOptimizationProverEnvironment( | ||
| ShutdownNotifier pProverShutdownNotifier, ProverOptions... options); | ||
|
|
||
| /** | ||
| * Get version information out of the solver. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.