CBMC
jbmc_parse_options.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: JBMC Command Line Option Processing
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_JBMC_JBMC_PARSE_OPTIONS_H
13 #define CPROVER_JBMC_JBMC_PARSE_OPTIONS_H
14 
15 #include <util/parse_options.h>
16 #include <util/timestamper.h>
17 #include <util/ui_message.h>
19 
20 #include <langapi/language.h>
21 
22 #include <goto-checker/bmc_util.h>
23 
27 
29 
32 
33 #include <json/json_interface.h>
34 #include <xmllang/xml_interface.h>
35 
36 class goto_functiont;
38 class optionst;
39 
40 // clang-format off
41 #define JBMC_OPTIONS \
42  OPT_BMC \
43  "(preprocess)" \
44  OPT_FUNCTIONS \
45  "(no-simplify)(full-slice)" \
46  OPT_REACHABILITY_SLICER \
47  "(no-propagation)(no-simplify-if)" \
48  "(document-subgoals)" \
49  "(object-bits):" \
50  "(classpath):(cp):" \
51  OPT_JAVA_JAR \
52  "(main-class):" \
53  OPT_JAVA_GOTO_BINARY \
54  "(no-assertions)(no-assumptions)" \
55  OPT_XML_INTERFACE \
56  OPT_JSON_INTERFACE \
57  "(smt1)" /* rejected, will eventually disappear */ \
58  OPT_SOLVER \
59  OPT_STRING_REFINEMENT \
60  "(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
61  OPT_SHOW_GOTO_FUNCTIONS \
62  OPT_SHOW_CLASS_HIERARCHY \
63  "(show-loops)" \
64  "(show-symbol-table)" \
65  "(list-symbols)" \
66  "(show-parse-tree)" \
67  OPT_SHOW_PROPERTIES \
68  "(drop-unused-functions)" \
69  "(property):(stop-on-fail)(trace)" \
70  "(verbosity):" \
71  "(nondet-static)" \
72  OPT_JAVA_TRACE_VALIDATION \
73  "(version)" \
74  "(symex-coverage-report):" \
75  OPT_TIMESTAMP \
76  "(i386-linux)(i386-macos)(i386-win32)(win32)(winx64)" \
77  "(ppc-macos)" \
78  "(arrays-uf-always)(arrays-uf-never)" \
79  "(arch):" \
80  OPT_FLUSH \
81  JAVA_BYTECODE_LANGUAGE_OPTIONS \
82  "(java-unwind-enum-static)" \
83  "(localize-faults)" \
84  "(java-threading)" \
85  OPT_GOTO_TRACE \
86  OPT_VALIDATE \
87  "(symex-driven-lazy-loading)"
88 // clang-format on
89 
91 {
92 public:
93  virtual int doit() override;
94  virtual void help() override;
95 
96  jbmc_parse_optionst(int argc, const char **argv);
98  int argc,
99  const char **argv,
100  const std::string &extra_options);
101 
106  static void set_default_options(optionst &);
107 
109  goto_model_functiont &function,
110  const abstract_goto_modelt &,
111  const optionst &);
112  bool process_goto_functions(goto_modelt &goto_model, const optionst &options);
113 
114  bool can_generate_function_body(const irep_idt &name);
115 
117  const irep_idt &function_name,
118  symbol_table_baset &symbol_table,
119  goto_functiont &function,
120  bool body_available);
121 
122 protected:
125 
126  std::unique_ptr<class_hierarchyt> class_hierarchy;
127 
129  int get_goto_program(
130  std::unique_ptr<abstract_goto_modelt> &goto_model,
131  const optionst &);
132  bool show_loaded_functions(const abstract_goto_modelt &goto_model);
133  bool show_loaded_symbols(const abstract_goto_modelt &goto_model);
134 
139 };
140 
141 #endif // CPROVER_JBMC_JBMC_PARSE_OPTIONS_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
jbmc_parse_optionst::get_command_line_options
void get_command_line_options(optionst &)
Definition: jbmc_parse_options.cpp:108
parse_options_baset
Definition: parse_options.h:19
java_bytecode_language.h
jbmc_parse_optionst::process_goto_functions
bool process_goto_functions(goto_modelt &goto_model, const optionst &options)
Definition: jbmc_parse_options.cpp:774
optionst
Definition: options.h:22
json_interface.h
java_trace_validation.h
validation_interface.h
jbmc_parse_optionst::process_goto_function
void process_goto_function(goto_model_functiont &function, const abstract_goto_modelt &, const optionst &)
Definition: jbmc_parse_options.cpp:639
goto_modelt
Definition: goto_model.h:25
jbmc_parse_optionst::generate_function_body
bool generate_function_body(const irep_idt &function_name, symbol_table_baset &symbol_table, goto_functiont &function, bool body_available)
Definition: jbmc_parse_options.cpp:881
jbmc_parse_optionst::object_factory_params
java_object_factory_parameterst object_factory_params
Definition: jbmc_parse_options.h:123
jbmc_parse_optionst::stub_objects_are_not_null
bool stub_objects_are_not_null
Definition: jbmc_parse_options.h:124
goto_trace.h
bmc_util.h
jbmc_parse_optionst::doit
virtual int doit() override
invoke main modules
Definition: jbmc_parse_options.cpp:342
jbmc_parse_optionst::can_generate_function_body
bool can_generate_function_body(const irep_idt &name)
Definition: jbmc_parse_options.cpp:874
jbmc_parse_optionst::show_loaded_symbols
bool show_loaded_symbols(const abstract_goto_modelt &goto_model)
Definition: jbmc_parse_options.cpp:725
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:21
show_properties.h
jbmc_parse_optionst::class_hierarchy
std::unique_ptr< class_hierarchyt > class_hierarchy
Definition: jbmc_parse_options.h:126
language.h
goto_functiont
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
Definition: goto_function.h:23
string_refinement.h
parse_options.h
optionalt
nonstd::optional< T > optionalt
Definition: optional.h:35
jbmc_parse_optionst::help
virtual void help() override
display command line help
Definition: jbmc_parse_options.cpp:919
class_hierarchy.h
jbmc_parse_optionst::get_goto_program
int get_goto_program(std::unique_ptr< abstract_goto_modelt > &goto_model, const optionst &)
Definition: jbmc_parse_options.cpp:561
timestamper.h
Emit timestamps.
xml_interface.h
jbmc_parse_optionst::set_default_options
static void set_default_options(optionst &)
Set the options that have default values.
Definition: jbmc_parse_options.cpp:91
abstract_goto_modelt
Abstract interface to eager or lazy GOTO models.
Definition: abstract_goto_model.h:20
jbmc_parse_optionst::jbmc_parse_optionst
jbmc_parse_optionst(int argc, const char **argv)
Definition: jbmc_parse_options.cpp:66
jbmc_parse_optionst::show_loaded_functions
bool show_loaded_functions(const abstract_goto_modelt &goto_model)
Definition: jbmc_parse_options.cpp:742
java_object_factory_parameterst
Definition: java_object_factory_parameters.h:15
goto_model_functiont
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
Definition: goto_model.h:182
jbmc_parse_optionst
Definition: jbmc_parse_options.h:90
ui_message.h
jbmc_parse_optionst::method_context
optionalt< prefix_filtert > method_context
See java_bytecode_languaget::method_context.
Definition: jbmc_parse_options.h:138