@@ -117,7 +117,8 @@ void cbmc_parse_optionst::eval_verbosity()
117117 if (cmdline.isset (" verbosity" ))
118118 {
119119 v=unsafe_string2unsigned (cmdline.get_value (" verbosity" ));
120- if (v>10 ) v=10 ;
120+ if (v>10 )
121+ v=10 ;
121122 }
122123
123124 ui_message_handler.set_verbosity (v);
@@ -192,8 +193,11 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
192193 if (cmdline.isset (" localize-faults" ))
193194 options.set_option (" localize-faults" , true );
194195 if (cmdline.isset (" localize-faults-method" ))
195- options.set_option (" localize-faults-method" ,
196- cmdline.get_value (" localize-faults-method" ));
196+ {
197+ options.set_option (
198+ " localize-faults-method" ,
199+ cmdline.get_value (" localize-faults-method" ));
200+ }
197201
198202 if (cmdline.isset (" unwind" ))
199203 options.set_option (" unwind" , cmdline.get_value (" unwind" ));
@@ -239,23 +243,29 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
239243 if (cmdline.isset (" cover" ))
240244 options.set_option (" unwinding-assertions" , false );
241245 else
242- options.set_option (" unwinding-assertions" ,
246+ {
247+ options.set_option (
248+ " unwinding-assertions" ,
243249 cmdline.isset (" unwinding-assertions" ));
250+ }
244251
245252 // generate unwinding assumptions otherwise
246- options.set_option (" partial-loops" ,
247- cmdline.isset (" partial-loops" ));
253+ options.set_option (
254+ " partial-loops" ,
255+ cmdline.isset (" partial-loops" ));
248256
249257 if (options.get_bool_option (" partial-loops" ) &&
250258 options.get_bool_option (" unwinding-assertions" ))
251259 {
252- error () << " --partial-loops and --unwinding-assertions must not be given together" << eom;
260+ error () << " --partial-loops and --unwinding-assertions "
261+ << " must not be given together" << eom;
253262 exit (1 ); // should contemplate EX_USAGE from sysexits.h
254263 }
255264
256265 // remove unused equations
257- options.set_option (" slice-formula" ,
258- cmdline.isset (" slice-formula" ));
266+ options.set_option (
267+ " slice-formula" ,
268+ cmdline.isset (" slice-formula" ));
259269
260270 // simplify if conditions and branches
261271 if (cmdline.isset (" no-simplify-if" ))
@@ -293,105 +303,108 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
293303 }
294304
295305 if (cmdline.isset (" max-node-refinement" ))
296- options.set_option (" max-node-refinement" , cmdline.get_value (" max-node-refinement" ));
306+ options.set_option (
307+ " max-node-refinement" ,
308+ cmdline.get_value (" max-node-refinement" ));
297309
298310 if (cmdline.isset (" aig" ))
299311 options.set_option (" aig" , true );
300312
301313 // SMT Options
302- bool version_set = false ;
314+ bool version_set= false ;
303315
304316 if (cmdline.isset (" smt1" ))
305317 {
306318 options.set_option (" smt1" , true );
307319 options.set_option (" smt2" , false );
308- version_set = true ;
320+ version_set= true ;
309321 }
310322
311323 if (cmdline.isset (" smt2" ))
312324 {
313- options.set_option (" smt1" , false );// If both are given, smt2 takes precedence
325+ // If both are given, smt2 takes precedence
326+ options.set_option (" smt1" , false );
314327 options.set_option (" smt2" , true );
315- version_set = true ;
328+ version_set= true ;
316329 }
317330
318331 if (cmdline.isset (" fpa" ))
319332 options.set_option (" fpa" , true );
320333
321334
322- bool solver_set = false ;
335+ bool solver_set= false ;
323336
324337 if (cmdline.isset (" boolector" ))
325338 {
326- options.set_option (" boolector" , true ), solver_set = true ;
339+ options.set_option (" boolector" , true ), solver_set= true ;
327340 if (!version_set)
328- options.set_option (" smt2" , true ), version_set = true ;
341+ options.set_option (" smt2" , true ), version_set= true ;
329342 }
330343
331344 if (cmdline.isset (" mathsat" ))
332345 {
333- options.set_option (" mathsat" , true ), solver_set = true ;
346+ options.set_option (" mathsat" , true ), solver_set= true ;
334347 if (!version_set)
335- options.set_option (" smt2" , true ), version_set = true ;
348+ options.set_option (" smt2" , true ), version_set= true ;
336349 }
337350
338351 if (cmdline.isset (" cvc3" ))
339352 {
340- options.set_option (" cvc3" , true ), solver_set = true ;
353+ options.set_option (" cvc3" , true ), solver_set= true ;
341354 if (!version_set)
342- options.set_option (" smt1" , true ), version_set = true ;
355+ options.set_option (" smt1" , true ), version_set= true ;
343356 }
344357
345358 if (cmdline.isset (" cvc4" ))
346359 {
347- options.set_option (" cvc4" , true ), solver_set = true ;
360+ options.set_option (" cvc4" , true ), solver_set= true ;
348361 if (!version_set)
349- options.set_option (" smt2" , true ), version_set = true ;
362+ options.set_option (" smt2" , true ), version_set= true ;
350363 }
351364
352365 if (cmdline.isset (" yices" ))
353366 {
354- options.set_option (" yices" , true ), solver_set = true ;
367+ options.set_option (" yices" , true ), solver_set= true ;
355368 if (!version_set)
356- options.set_option (" smt2" , true ), version_set = true ;
369+ options.set_option (" smt2" , true ), version_set= true ;
357370 }
358371
359372 if (cmdline.isset (" z3" ))
360373 {
361- options.set_option (" z3" , true ), solver_set = true ;
374+ options.set_option (" z3" , true ), solver_set= true ;
362375 if (!version_set)
363- options.set_option (" smt2" , true ), version_set = true ;
376+ options.set_option (" smt2" , true ), version_set= true ;
364377 }
365378
366379 if (cmdline.isset (" opensmt" ))
367380 {
368- options.set_option (" opensmt" , true ), solver_set = true ;
381+ options.set_option (" opensmt" , true ), solver_set= true ;
369382 if (!version_set)
370- options.set_option (" smt1" , true ), version_set = true ;
383+ options.set_option (" smt1" , true ), version_set= true ;
371384 }
372385
373386 if (version_set && !solver_set)
374387 {
375388 if (cmdline.isset (" outfile" ))
376389 {
377390 // outfile and no solver should give standard compliant SMT-LIB
378- options.set_option (" generic" , true ), solver_set = true ;
391+ options.set_option (" generic" , true ), solver_set= true ;
379392 }
380393 else
381394 {
382395 if (options.get_bool_option (" smt1" ))
383396 {
384- options.set_option (" boolector" , true ), solver_set = true ;
397+ options.set_option (" boolector" , true ), solver_set= true ;
385398 }
386399 else
387400 {
388401 assert (options.get_bool_option (" smt2" ));
389- options.set_option (" z3" , true ), solver_set = true ;
402+ options.set_option (" z3" , true ), solver_set= true ;
390403 }
391404 }
392405 }
393406 // Either have solver and standard version set, or neither.
394- assert (version_set == solver_set);
407+ assert (version_set== solver_set);
395408
396409 if (cmdline.isset (" beautify" ))
397410 options.set_option (" beautify" , true );
@@ -401,8 +414,9 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
401414 else
402415 options.set_option (" sat-preprocessor" , true );
403416
404- options.set_option (" pretty-names" ,
405- !cmdline.isset (" no-pretty-names" ));
417+ options.set_option (
418+ " pretty-names" ,
419+ !cmdline.isset (" no-pretty-names" ));
406420
407421 if (cmdline.isset (" outfile" ))
408422 options.set_option (" outfile" , cmdline.get_value (" outfile" ));
@@ -457,7 +471,6 @@ int cbmc_parse_optionst::doit()
457471
458472 if (cmdline.isset (" module" ) ||
459473 cmdline.isset (" gen-interface" ))
460-
461474 {
462475 error () << " This version of CBMC has no support for "
463476 " hardware modules. Please use hw-cbmc." << eom;
@@ -514,7 +527,8 @@ int cbmc_parse_optionst::doit()
514527 return 0 ; // should contemplate EX_OK from sysexits.h
515528 }
516529
517- if (cmdline.isset (" show-reachable-properties" )) // may replace --show-properties
530+ // may replace --show-properties
531+ if (cmdline.isset (" show-reachable-properties" ))
518532 {
519533 const namespacet ns (symbol_table);
520534
@@ -668,11 +682,15 @@ int cbmc_parse_optionst::get_goto_program(
668682
669683 if (!cmdline.args .empty ())
670684 {
671- if (parse ()) return 6 ;
672- if (typecheck ()) return 6 ;
685+ if (parse ())
686+ return 6 ;
687+ if (typecheck ())
688+ return 6 ;
673689 int get_modules_ret=get_modules (bmc);
674- if (get_modules_ret!=-1 ) return get_modules_ret;
675- if (binaries.empty () && final ()) return 6 ;
690+ if (get_modules_ret!=-1 )
691+ return get_modules_ret;
692+ if (binaries.empty () && final ())
693+ return 6 ;
676694
677695 // we no longer need any parse trees or language files
678696 clear_parse ();
@@ -685,9 +703,14 @@ int cbmc_parse_optionst::get_goto_program(
685703 {
686704 status () << " Reading GOTO program from file " << eom;
687705
688- if (read_object_and_link (*it, symbol_table, goto_functions,
689- get_message_handler ()))
706+ if (read_object_and_link (
707+ *it,
708+ symbol_table,
709+ goto_functions,
710+ get_message_handler ()))
711+ {
690712 return 6 ;
713+ }
691714 }
692715
693716 if (!binaries.empty ())
@@ -851,7 +874,9 @@ bool cbmc_parse_optionst::process_goto_program(
851874
852875 // remove function pointers
853876 status () << " Removal of function pointers and virtual functions" << eom;
854- remove_function_pointers (symbol_table, goto_functions,
877+ remove_function_pointers (
878+ symbol_table,
879+ goto_functions,
855880 cmdline.isset (" pointer-check" ));
856881 remove_virtual_functions (symbol_table, goto_functions);
857882
@@ -887,8 +912,10 @@ bool cbmc_parse_optionst::process_goto_program(
887912 if (cmdline.isset (" string-abstraction" ))
888913 {
889914 status () << " String Abstraction" << eom;
890- string_abstraction (symbol_table,
891- get_message_handler (), goto_functions);
915+ string_abstraction (
916+ symbol_table,
917+ get_message_handler (),
918+ goto_functions);
892919 }
893920
894921 // add failed symbols
0 commit comments