@@ -213,125 +213,128 @@ make_satcheck_prop(message_handlert &message_handler, const optionst &options)
213
213
std::unique_ptr<solver_factoryt::solvert> solver_factoryt::get_sat_solver ()
214
214
{
215
215
auto solver = util_make_unique<solvert>();
216
- const std::string &solver_option = options.get_option (" sat-solver" );
217
216
bool solver_set = false ;
218
- if (solver_option == " zchaff " )
217
+ if (options. is_set ( " sat-solver " ) )
219
218
{
219
+ const std::string &solver_option = options.get_option (" sat-solver" );
220
+ if (solver_option == " zchaff" )
221
+ {
220
222
#if defined SATCHECK_ZCHAFF
221
- solver->set_prop (
222
- make_satcheck_prop<satcheck_zchafft>(message_handler, options));
223
- solver_set = true ;
223
+ solver->set_prop (
224
+ make_satcheck_prop<satcheck_zchafft>(message_handler, options));
225
+ solver_set = true ;
224
226
#else
225
- emit_solver_warning (" zchaff" );
227
+ emit_solver_warning (" zchaff" );
226
228
#endif
227
- }
228
- else if (solver_option == " booleforce" )
229
- {
229
+ }
230
+ else if (solver_option == " booleforce" )
231
+ {
230
232
#if defined SATCHECK_BOOLERFORCE
231
- solver->set_prop (
232
- make_satcheck_prop<satcheck_booleforcet>(message_handler, options));
233
- solver_set = true ;
233
+ solver->set_prop (
234
+ make_satcheck_prop<satcheck_booleforcet>(message_handler, options));
235
+ solver_set = true ;
234
236
#else
235
- emit_solver_warning (" booleforce" );
237
+ emit_solver_warning (" booleforce" );
236
238
#endif
237
- }
238
- else if (solver_option == " minisat1" )
239
- {
239
+ }
240
+ else if (solver_option == " minisat1" )
241
+ {
240
242
#if defined SATCHECK_MINISAT1
241
- solver->set_prop (
242
- make_satcheck_prop<satcheck_minisat1t>(message_handler, options));
243
- solver_set = true ;
243
+ solver->set_prop (
244
+ make_satcheck_prop<satcheck_minisat1t>(message_handler, options));
245
+ solver_set = true ;
244
246
#else
245
- emit_solver_warning (" minisat1" );
247
+ emit_solver_warning (" minisat1" );
246
248
#endif
247
- }
248
- else if (solver_option == " minisat2" )
249
- {
250
- #if defined SATCHECK_MINISAT2
251
- if (
252
- options.get_bool_option (" beautify" ) ||
253
- !options.get_bool_option (" sat-preprocessor" )) // no simplifier
254
- {
255
- // simplifier won't work with beautification
256
- solver->set_prop (make_satcheck_prop<satcheck_minisat_no_simplifiert>(
257
- message_handler, options));
258
249
}
259
- else // with simplifier
250
+ else if (solver_option == " minisat2 " )
260
251
{
261
- solver->set_prop (make_satcheck_prop<satcheck_minisat_simplifiert>(
262
- message_handler, options));
263
- }
264
- solver_set = true ;
252
+ #if defined SATCHECK_MINISAT2
253
+ if (
254
+ options.get_bool_option (" beautify" ) ||
255
+ !options.get_bool_option (" sat-preprocessor" )) // no simplifier
256
+ {
257
+ // simplifier won't work with beautification
258
+ solver->set_prop (make_satcheck_prop<satcheck_minisat_no_simplifiert>(
259
+ message_handler, options));
260
+ }
261
+ else // with simplifier
262
+ {
263
+ solver->set_prop (make_satcheck_prop<satcheck_minisat_simplifiert>(
264
+ message_handler, options));
265
+ }
266
+ solver_set = true ;
265
267
#else
266
- emit_solver_warning (" minisat2" );
268
+ emit_solver_warning (" minisat2" );
267
269
#endif
268
- }
269
- else if (solver_option == " ipasir" )
270
- {
270
+ }
271
+ else if (solver_option == " ipasir" )
272
+ {
271
273
#if defined SATCHECK_IPASIR
272
- solver->set_prop (
273
- make_satcheck_prop<satcheck_ipasirt>(message_handler, options));
274
- solver_set = true ;
274
+ solver->set_prop (
275
+ make_satcheck_prop<satcheck_ipasirt>(message_handler, options));
276
+ solver_set = true ;
275
277
#else
276
- emit_solver_warning (" ipasir" );
278
+ emit_solver_warning (" ipasir" );
277
279
#endif
278
- }
279
- else if (solver_option == " picosat" )
280
- {
280
+ }
281
+ else if (solver_option == " picosat" )
282
+ {
281
283
#if defined SATCHECK_PICOSAT
282
- solver->set_prop (
283
- make_satcheck_prop<satcheck_picosatt>(message_handler, options));
284
- solver_set = true ;
284
+ solver->set_prop (
285
+ make_satcheck_prop<satcheck_picosatt>(message_handler, options));
286
+ solver_set = true ;
285
287
#else
286
- emit_solver_warning (" picosat" );
288
+ emit_solver_warning (" picosat" );
287
289
#endif
288
- }
289
- else if (solver_option == " lingeling" )
290
- {
290
+ }
291
+ else if (solver_option == " lingeling" )
292
+ {
291
293
#if defined SATCHECK_LINGELING
292
- solver->set_prop (
293
- make_satcheck_prop<satcheck_lingelingt>(message_handler, options));
294
- solver_set = true ;
294
+ solver->set_prop (
295
+ make_satcheck_prop<satcheck_lingelingt>(message_handler, options));
296
+ solver_set = true ;
295
297
#else
296
- emit_solver_warning (" lingeling" );
298
+ emit_solver_warning (" lingeling" );
297
299
#endif
298
- }
299
- else if (solver_option == " glucose" )
300
- {
301
- #if defined SATCHECK_GLUCOSE
302
- if (
303
- options.get_bool_option (" beautify" ) ||
304
- !options.get_bool_option (" sat-preprocessor" )) // no simplifier
305
- {
306
- // simplifier won't work with beautification
307
- solver->set_prop (make_satcheck_prop<satcheck_glucose_no_simplifiert>(
308
- message_handler, options));
309
300
}
310
- else // with simplifier
301
+ else if (solver_option == " glucose " )
311
302
{
312
- solver->set_prop (make_satcheck_prop<satcheck_glucose_simplifiert>(
313
- message_handler, options));
314
- }
315
- solver_set = true ;
303
+ #if defined SATCHECK_GLUCOSE
304
+ if (
305
+ options.get_bool_option (" beautify" ) ||
306
+ !options.get_bool_option (" sat-preprocessor" )) // no simplifier
307
+ {
308
+ // simplifier won't work with beautification
309
+ solver->set_prop (make_satcheck_prop<satcheck_glucose_no_simplifiert>(
310
+ message_handler, options));
311
+ }
312
+ else // with simplifier
313
+ {
314
+ solver->set_prop (make_satcheck_prop<satcheck_glucose_simplifiert>(
315
+ message_handler, options));
316
+ }
317
+ solver_set = true ;
316
318
#else
317
- emit_solver_warning (" glucose" );
319
+ emit_solver_warning (" glucose" );
318
320
#endif
319
- }
320
- else if (solver_option == " cadical" )
321
- {
321
+ }
322
+ else if (solver_option == " cadical" )
323
+ {
322
324
#if defined SATCHECK_CADICAL
323
- solver->set_prop (
324
- make_satcheck_prop<satcheck_cadicalt>(message_handler, options));
325
- solver_set = true ;
325
+ solver->set_prop (
326
+ make_satcheck_prop<satcheck_cadicalt>(message_handler, options));
327
+ solver_set = true ;
326
328
#else
327
- emit_solver_warning (" cadical" );
329
+ emit_solver_warning (" cadical" );
328
330
#endif
329
- }
330
- else
331
- {
332
- messaget log (message_handler);
333
- log .error () << " unknown solver '" << solver_option << " '" << messaget::eom;
334
- exit (CPROVER_EXIT_USAGE_ERROR);
331
+ }
332
+ else
333
+ {
334
+ messaget log (message_handler);
335
+ log .error () << " unknown solver '" << solver_option << " '" << messaget::eom;
336
+ exit (CPROVER_EXIT_USAGE_ERROR);
337
+ }
335
338
}
336
339
if (!solver_set)
337
340
{
0 commit comments