@@ -69,11 +69,12 @@ public void allLocalTest() throws InterruptedException, SolverException {
69
69
}
70
70
71
71
@ Test
72
- public void nonlocalContextTest ()
72
+ public void nonLocalContextTest ()
73
73
throws ExecutionException , InterruptedException , SolverException {
74
74
requireIntegers ();
75
75
assume ().that (solverToUse ()).isNotEqualTo (Solvers .CVC5 );
76
76
77
+ // generate a new context in another thread, i.e., non-locally
77
78
Future <SolverContext > result = executor .submit (() -> factory .generateContext ());
78
79
79
80
try (SolverContext newContext = result .get ()) {
@@ -103,11 +104,12 @@ public void nonlocalContextTest()
103
104
}
104
105
105
106
@ Test
106
- public void nonlocalFormulaTest ()
107
+ public void nonLocalFormulaTest ()
107
108
throws InterruptedException , SolverException , ExecutionException {
108
109
requireIntegers ();
109
110
assume ().that (solverToUse ()).isNotEqualTo (Solvers .CVC5 );
110
111
112
+ // generate a new formula in another thread, i.e., non-locally
111
113
Future <BooleanFormula > result =
112
114
executor .submit (
113
115
() -> {
@@ -132,13 +134,14 @@ public void nonlocalFormulaTest()
132
134
}
133
135
134
136
@ Test
135
- public void nonlocalProverTest () throws InterruptedException , ExecutionException {
137
+ public void nonLocalProverTest () throws InterruptedException , ExecutionException {
136
138
requireIntegers ();
137
139
assume ().that (solverToUse ()).isNotEqualTo (Solvers .CVC5 );
138
140
139
141
BooleanFormula formula = hardProblem .generate (DEFAULT_PROBLEM_SIZE );
140
142
141
143
try (BasicProverEnvironment <?> prover = context .newProverEnvironment ()) {
144
+ // generate a new prover in another thread, i.e., non-locally
142
145
Future <?> task =
143
146
executor .submit (
144
147
() -> {
@@ -206,7 +209,7 @@ public <T> void localInterpolationTest() throws InterruptedException, SolverExce
206
209
207
210
@ SuppressWarnings ({"unchecked" , "resource" })
208
211
@ Test
209
- public <T > void nonlocalInterpolationTest () throws InterruptedException , ExecutionException {
212
+ public <T > void nonLocalInterpolationTest () throws InterruptedException , ExecutionException {
210
213
requireIntegers ();
211
214
requireInterpolation ();
212
215
assume ().that (solverToUse ()).isNotEqualTo (Solvers .CVC5 );
@@ -218,6 +221,7 @@ public <T> void nonlocalInterpolationTest() throws InterruptedException, Executi
218
221
(InterpolatingProverEnvironment <T >) context .newProverEnvironmentWithInterpolation ()) {
219
222
T id1 = prover .push (f1 );
220
223
224
+ // push a formula in another thread, i.e., non-locally
221
225
Future <?> task1 =
222
226
executor .submit (
223
227
() -> {
@@ -240,6 +244,7 @@ public <T> void nonlocalInterpolationTest() throws InterruptedException, Executi
240
244
241
245
assert task1 .get () == null ;
242
246
247
+ // compute/check interpolants in different threads, i.e., non-locally
243
248
Future <BooleanFormula > task2 =
244
249
executor .submit (
245
250
() -> {
@@ -260,6 +265,7 @@ public <T> void nonlocalInterpolationTest() throws InterruptedException, Executi
260
265
BooleanFormula itp = task2 .get ();
261
266
prover .pop ();
262
267
268
+ // use interpolants in another thread, i.e., non-locally
263
269
Future <?> task4 =
264
270
executor .submit (
265
271
() -> {
@@ -311,6 +317,11 @@ public void wrongContextTest()
311
317
// key not found: i@15
312
318
// Boolector crashes with a segfault:
313
319
// boolector_assert: argument 'exp' belongs to different Boolector instance
320
+ //
321
+ // To fix this issue, we would need to track which formula was created in which context,
322
+ // which might result in quite some management and memory overhead.
323
+ // We might want to see this as very low priority, as there is no real benefit for the user,
324
+ // except having a nice error message.
314
325
315
326
// Boolector does not support integer, so we have to use two different versions for this test.
316
327
BooleanFormula formula =
0 commit comments