Go to the documentation of this file.
139 gcc_version.
get(
"gcc");
144 const bool validate_only =
cmdline.
isset(
"validate-goto-binary");
146 if(validate_only ||
cmdline.
isset(
"validate-goto-model"))
167 bool unwindset_file_given=
cmdline.
isset(
"unwindset-file");
169 if(unwindset_given && unwindset_file_given)
170 throw "only one of --unwindset and --unwindset-file supported at a "
173 if(unwind_given || unwindset_given || unwindset_file_given)
180 if(unwindset_file_given)
182 unwindset.parse_unwindset_file(
188 unwindset.parse_unwindset(
193 bool unwinding_assertions=
cmdline.
isset(
"unwinding-assertions");
195 bool continue_as_loops=
cmdline.
isset(
"continue-as-loops");
196 if(continue_as_loops)
198 if(unwinding_assertions)
200 throw "unwinding assertions cannot be used with "
201 "--continue-as-loops";
203 else if(partial_loops)
204 throw "partial loops cannot be used with --continue-as-loops";
210 if(unwinding_assertions)
217 else if(partial_loops)
221 else if(continue_as_loops)
227 goto_unwind(
goto_model, unwindset, unwind_strategy);
232 bool have_file=!filename.empty() && filename!=
"-";
239 std::ofstream of(
widen(filename));
241 std::ofstream of(filename);
244 throw "failed to open file "+filename;
251 std::cout << result <<
'\n';
269 std::cout <<
"////\n";
270 std::cout <<
"//// Function: " << gf_entry.first <<
'\n';
271 std::cout <<
"////\n\n";
277 i_it->output(std::cout);
278 std::cout <<
"Is threaded: " << (is_threaded(i_it)?
"True":
"False")
345 std::cout <<
">>>>\n";
346 std::cout <<
">>>> " << gf_entry.first <<
'\n';
347 std::cout <<
">>>>\n";
348 local_bitvector_analysis.
output(std::cout, gf_entry.second, ns);
366 local_safe_pointers(gf_entry.second.body);
367 std::cout <<
">>>>\n";
368 std::cout <<
">>>> " << gf_entry.first <<
'\n';
369 std::cout <<
">>>>\n";
371 local_safe_pointers.
output(std::cout, gf_entry.second.body, ns);
375 std::cout, gf_entry.second.body, ns);
393 sese_region_analysis(gf_entry.second.body);
394 std::cout <<
">>>>\n";
395 std::cout <<
">>>> " << gf_entry.first <<
'\n';
396 std::cout <<
">>>>\n";
397 sese_region_analysis.
output(std::cout, gf_entry.second.body, ns);
465 custom_bitvector_analysis.
check(
485 points_to.
output(std::cout);
670 for(
auto const &ins : pair.second.body.instructions)
672 if(ins.code().is_not_nil())
674 if(ins.has_condition())
676 log.
status() <<
"[guard] " << ins.condition().pretty()
716 const bool is_header =
cmdline.
isset(
"dump-c-type-header");
792 call_graph.
output(std::cout);
808 call_graph.
output(std::cout);
859 log.
status() <<
"Removing calls to functions without a body"
927 "Invalid number of positional arguments passed",
929 "goto-instrument needs one input and one output file, aside from other "
1008 if(!result.has_value())
1037 log.
status() <<
"Adding up to " << max_argc <<
" command line arguments"
1151 log.
warning() <<
"Loop invariant synthesizer is still work in progress. "
1152 "It only generates TRUE as invariants."
1167 std::set<std::string> to_replace(
1171 std::set<std::string> to_enforce(
1175 std::set<std::string> to_exclude_from_nondet_static(
1201 else if(
cmdline.
isset(
"remove-const-function-pointers"))
1223 log.
status() <<
"Inlining calls of function '" <<
function <<
"'"
1234 bool have_file=!filename.empty() && filename!=
"-";
1242 std::ofstream of(
widen(filename));
1244 std::ofstream of(filename);
1247 throw "failed to open file "+filename;
1254 std::cout << result <<
'\n';
1275 log.
status() <<
"Removing calls to functions without a body"
1291 log.
warning() <<
"**** WARNING: Constant propagation as performed by "
1292 "goto-instrument is not expected to be sound. Do not use "
1293 "--constant-propagator if soundness is important for your "
1306 c_object_factory_options);
1310 object_factory_parameters,
1315 *generate_implementation,
1325 c_object_factory_options);
1327 auto options_split =
1329 if(options_split.size() < 2)
1331 "not enough arguments for this option",
"--generate-havocing-body"};
1333 if(options_split.size() == 2)
1336 std::string{
"havoc,"} + options_split.back(),
1337 object_factory_parameters,
1341 std::regex(options_split[0]),
1342 *generate_implementation,
1349 for(
size_t i = 1; i + 1 < options_split.size(); i += 2)
1352 std::string{
"havoc,"} + options_split[i + 1],
1353 object_factory_parameters,
1359 *generate_implementation,
1373 log.
status() <<
"Adding checks for uninitialized local variables"
1392 log.
status() <<
"Adding nondeterministic initialization "
1393 "of static/global variables except for "
1394 "the specified ones."
1396 std::set<std::string> to_exclude(
1403 log.
status() <<
"Adding nondeterministic initialization "
1404 "of static/global variables"
1411 log.
status() <<
"Slicing away initializations of unused global variables"
1474 const unsigned max_var=
1477 const unsigned max_po_trans=
1483 log.
status() <<
"Adding weak memory (TSO) Instrumentation"
1489 log.
status() <<
"Adding weak memory (PSO) Instrumentation"
1495 log.
status() <<
"Adding weak memory (RMO) Instrumentation"
1499 else if(mm==
"power")
1501 log.
status() <<
"Adding weak memory (Power) Instrumentation"
1507 log.
error() <<
"Unknown weak memory model '" << mm <<
"'"
1581 if(step_case && base_case)
1582 throw "please specify only one of --step-case and --base-case";
1583 else if(!step_case && !base_case)
1584 throw "please specify one of --step-case and --base-case";
1589 throw "please give k>=1";
1591 log.
status() <<
"Instrumenting k-induction for k=" << k <<
", "
1592 << (base_case ?
"base case" :
"step case") <<
messaget::eom;
1658 log.
status() <<
"Performing a function pointer reachability slice"
1704 log.
status() <<
"Slicing away initializations of unused global variables"
1715 if(
cmdline.
isset(
"aggressive-slice-preserve-function"))
1723 if(
cmdline.
isset(
"aggressive-slice-preserve-functions-containing"))
1728 cmdline.
isset(
"aggressive-slice-preserve-all-direct-paths");
1730 aggressive_slicer.
doit();
1766 " goto-instrument [-?] [-h] [--help] show help\n"
1767 " goto-instrument --version show version and exit\n"
1768 " goto-instrument [options] in [out] perform analysis or instrumentation\n"
1772 " --horn print program as constrained horn clauses\n"
1777 " --show-symbol-table show loaded symbol table\n"
1778 " --list-symbols list symbols with type information\n"
1781 " --show-locations show all source locations\n"
1782 " --dot generate CFG graph in DOT format\n"
1783 " --print-internal-representation\n"
1784 " show verbose internal representation of the program\n"
1785 " --list-undefined-functions list functions without body\n"
1787 " --list-calls-args list all function calls with their arguments\n"
1788 " --call-graph show graph of function calls\n"
1790 " --reachable-call-graph show graph of function calls potentially reachable from main function\n"
1794 " --validate-goto-binary check the well-formedness of the passed in goto\n"
1795 " binary and then exit\n"
1796 " --interpreter do concrete execution\n"
1798 "Data-flow analyses:\n"
1799 " --show-struct-alignment show struct members that might be concurrently accessed\n"
1801 " --show-threaded show instructions that may be executed by more than one thread\n"
1802 " --show-local-safe-pointers show pointer expressions that are trivially dominated by a not-null check\n"
1803 " --show-safe-dereferences show pointer expressions that are trivially dominated by a not-null check\n"
1804 " *and* used as a dereference operand\n"
1805 " --show-value-sets show points-to information (using value sets)\n"
1806 " --show-global-may-alias show may-alias information over globals\n"
1807 " --show-local-bitvector-analysis\n"
1808 " show procedure-local pointer analysis\n"
1809 " --escape-analysis perform escape analysis\n"
1810 " --show-escape-analysis show results of escape analysis\n"
1811 " --custom-bitvector-analysis perform configurable bitvector analysis\n"
1812 " --show-custom-bitvector-analysis\n"
1813 " show results of configurable bitvector analysis\n"
1814 " --interval-analysis perform interval analysis\n"
1815 " --show-intervals show results of interval analysis\n"
1816 " --show-uninitialized show maybe-uninitialized variables\n"
1817 " --show-points-to show points-to information\n"
1818 " --show-rw-set show read-write sets\n"
1819 " --show-call-sequences show function call sequences\n"
1820 " --show-reaching-definitions show reaching definitions\n"
1821 " --show-dependence-graph show program-dependence graph\n"
1822 " --show-sese-regions show single-entry-single-exit regions\n"
1825 " --no-assertions ignore user assertions\n"
1828 " --stack-depth n add check that call stack size of non-inlined functions never exceeds n\n"
1829 " --race-check add floating-point data race checks\n"
1831 "Semantic transformations:\n"
1833 " --isr <function> instruments an interrupt service routine\n"
1834 " --mmio instruments memory-mapped I/O\n"
1835 " --nondet-static add nondeterministic initialization of variables with static lifetime\n"
1836 " --nondet-static-exclude e same as nondet-static except for the variable e\n"
1837 " (use multiple times if required)\n"
1838 " --function-enter <f>, --function-exit <f>, --branch <f>\n"
1839 " instruments a call to <f> at the beginning,\n"
1840 " the exit, or a branch point, respectively\n"
1841 " --splice-call caller,callee prepends a call to callee in the body of caller\n"
1842 " --check-call-sequence <seq> instruments checks to assert that all call\n"
1843 " sequences match <seq>\n"
1844 " --undefined-function-is-assume-false\n"
1846 " convert each call to an undefined function to assume(false)\n"
1851 " --add-library add models of C library functions\n"
1853 " --model-argc-argv <n> model up to <n> command line arguments\n"
1855 " --remove-function-body <f> remove the implementation of function <f> (may be repeated)\n"
1859 "Semantics-preserving transformations:\n"
1860 " --ensure-one-backedge-per-target\n"
1861 " transform loop bodies such that there is a\n"
1862 " single edge back to the loop head\n"
1863 " --drop-unused-functions drop functions trivially unreachable from main function\n"
1865 " --constant-propagator propagate constants and simplify expressions\n"
1866 " --inline perform full inlining\n"
1867 " --partial-inline perform partial inlining\n"
1868 " --function-inline <function> transitively inline all calls <function> makes\n"
1869 " --no-caching disable caching of intermediate results during transitive function inlining\n"
1870 " --log <file> log in json format which code segments were inlined, use with --function-inline\n"
1871 " --remove-function-pointers replace function pointers by case statement over function calls\n"
1873 " --value-set-fi-fp-removal build flow-insensitive value set and replace function pointers by a case statement\n"
1874 " over the possible assignments. If the set of possible assignments is empty the function pointer\n"
1875 " is removed using the standard remove-function-pointers pass. \n"
1877 "Loop information and transformations:\n"
1879 " --unwindset-file <file> read unwindset from file\n"
1880 " --partial-loops permit paths with partial loops\n"
1881 " --unwinding-assertions generate unwinding assertions\n"
1882 " --continue-as-loops add loop for remaining iterations after unwound part\n"
1883 " --k-induction <k> check loops with k-induction\n"
1884 " --step-case k-induction: do step-case\n"
1885 " --base-case k-induction: do base-case\n"
1886 " --havoc-loops over-approximate all loops\n"
1887 " --accelerate add loop accelerators\n"
1888 " --z3 use Z3 when computing loop accelerators\n"
1889 " --skip-loops <loop-ids> add gotos to skip selected loops during execution\n"
1890 " --show-lexical-loops show single-entry-single-back-edge loops\n"
1891 " --show-natural-loops show natural loop heads\n"
1893 "Memory model instrumentations:\n"
1898 " --full-slice slice away instructions that don't affect assertions\n"
1899 " --property id slice with respect to specific property only\n"
1900 " --slice-global-inits slice away initializations of unused global variables\n"
1901 " --aggressive-slice remove bodies of any functions not on the shortest path between\n"
1902 " the start function and the function containing the property(s)\n"
1903 " --aggressive-slice-call-depth <n>\n"
1904 " used with aggressive-slice, preserves all functions within <n> function calls\n"
1905 " of the functions on the shortest path\n"
1906 " --aggressive-slice-preserve-function <f>\n"
1907 " force the aggressive slicer to preserve function <f>\n"
1908 " --aggressive-slice-preserve-functions-containing <f>\n"
1909 " force the aggressive slicer to preserve all functions with names containing <f>\n"
1910 " --aggressive-slice-preserve-all-direct-paths \n"
1911 " force aggressive slicer to preserve all direct paths\n"
1919 "User-interface options:\n"
1921 " --xml output files in XML where supported\n"
1922 " --xml-ui use XML-formatted output\n"
1923 " --json-ui use JSON-formatted output\n"
1924 " --verbosity # verbosity level\n"
void help() override
display command line help
void value_set_fi_fp_removal(goto_modelt &goto_model, message_handlert &message_handler)
Builds the flow-insensitive value set for all function pointers and replaces function pointers with a...
#define HELP_REACHABILITY_SLICER
std::list< std::string > defines
#define HELP_SHOW_GOTO_FUNCTIONS
#define HELP_LOOP_INVARIANT_SYNTHESIZER
#define HELP_REMOVE_POINTERS
void get(const std::string &executable)
void horn_encoding(const goto_modelt &goto_model, std::ostream &out)
Non-graph-based representation of the class hierarchy.
ui_message_handlert ui_message_handler
void link_to_library(goto_modelt &goto_model, message_handlert &message_handler, const std::function< void(const std::set< irep_idt > &, symbol_tablet &, message_handlert &)> &library)
Complete missing function definitions using the library.
void parse_c_object_factory_options(const cmdlinet &cmdline, optionst &options)
Parse the c object factory parameters from a given command line.
Enumerative loop invariant synthesizers.
#define RESTRICT_FUNCTION_POINTER_BY_NAME_OPT
virtual bool isset(char option) const
static void nondet_static(const namespacet &ns, goto_functionst &goto_functions, const irep_idt &fct_name)
Nondeterministically initializes global scope variables in a goto-function.
void print_global_state_size(const goto_modelt &goto_model)
void do_partial_inlining()
bool function_pointer_removal_done
void mutex_init_instrumentation(const symbol_tablet &symbol_table, goto_programt &goto_program, typet lock_type)
#define CHECK_RETURN(CONDITION)
void show_class_hierarchy(const class_hierarchyt &hierarchy, ui_message_handlert &message_handler, bool children_only)
Output the class hierarchy.
void apply_loop_contracts(const std::set< std::string > &to_exclude_from_nondet_init={})
Applies loop contract transformations.
void show_natural_loops(const goto_modelt &goto_model, std::ostream &out)
void output(std::ostream &out, const goto_programt &goto_program, const namespacet &ns) const
#define HELP_DOCUMENT_PROPERTIES
mstreamt & status() const
void replace_calls(const std::set< std::string > &to_replace)
Replace all calls to each function in the to_replace set with that function's contract.
void show_properties(const namespacet &ns, const irep_idt &identifier, message_handlert &message_handler, ui_message_handlert::uit ui, const goto_programt &goto_program)
jsont goto_function_inline_and_log(goto_modelt &goto_model, const irep_idt function, message_handlert &message_handler, bool adjust_function, bool caching)
void goto_partial_inline(goto_modelt &goto_model, message_handlert &message_handler, unsigned smallfunc_limit, bool adjust_function)
Inline all function calls to functions either marked as "inlined" or smaller than smallfunc_limit (by...
typet type
Type of symbol.
void concurrency(value_setst &value_sets, goto_modelt &goto_model)
void output_safe_dereferences(std::ostream &stream, const goto_programt &program, const namespacet &ns)
Output safely dereferenced expressions per instruction in human-readable format.
bool write_goto_binary(std::ostream &out, const symbol_tablet &symbol_table, const goto_functionst &goto_functions, irep_serializationt &irepconverter)
Writes a goto program to disc, using goto binary format.
#define FLAG_REPLACE_CALL
void dot(const goto_modelt &src, std::ostream &out)
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
A very simple, cheap analysis to determine when dereference operations are trivially guarded by a che...
bool model_argc_argv(goto_modelt &goto_model, unsigned max_argc, message_handlert &message_handler)
Set up argv with up to max_argc pointers into an array of 4096 bytes.
void parameter_assignments(symbol_tablet &symbol_table, goto_functionst &goto_functions)
removes returns
void label_function_pointer_call_sites(goto_modelt &goto_model)
This ensures that call instructions can be only one of two things:
bool splice_call(goto_functionst &goto_functions, const std::string &callercallee, const symbol_tablet &symbol_table, message_handlert &message_handler)
void show_lexical_loops(const goto_modelt &goto_model, std::ostream &out)
static bool skip_loops(goto_programt &goto_program, const loop_idst &loop_ids, messaget &message)
#define HELP_SHOW_CLASS_HIERARCHY
void slice_global_inits(goto_modelt &goto_model, message_handlert &message_handler)
Remove initialization of global variables that are not used in any function reachable from the entry ...
void configure_gcc(const gcc_versiont &gcc_version)
This template class implements a data-flow analysis which keeps track of what values different variab...
void remove_virtual_functions(symbol_table_baset &symbol_table, goto_functionst &goto_functions)
Remove virtual function calls from all functions in the specified list and replace them with their mo...
void show_uninitialized(const goto_modelt &goto_model, std::ostream &out)
static void race_check(value_setst &value_sets, symbol_tablet &symbol_table, const irep_idt &function_id, goto_programt &goto_program, w_guardst &w_guards)
void add_uninitialized_locals_assertions(goto_modelt &goto_model)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
void do_remove_const_function_pointers_only()
Remove function pointers that can be resolved by analysing const variables (i.e.
invariant_mapt synthesize_all() override
This synthesizer guarantees that, with the synthesized loop invariants, all checks in the annotated G...
void show_loop_ids(ui_message_handlert::uit ui, const goto_modelt &goto_model)
void generate_function_bodies(const std::regex &functions_regex, const generate_function_bodiest &generate_function_body, goto_modelt &model, message_handlert &message_handler)
Generate function bodies with some default behavior: assert-false, assume-false, assert-false-assume-...
bool preserve_all_direct_paths
void set_option(const std::string &option, const bool value)
void function_path_reachability_slicer(goto_modelt &goto_model, const std::list< std::string > &functions_list, message_handlert &message_handler)
Perform reachability slicing on goto_model for selected functions.
int doit() override
invoke main modules
#define FLAG_LOOP_CONTRACTS
#define HELP_REPLACE_CALL
void show_symbol_table(const symbol_tablet &symbol_table, ui_message_handlert &ui)
bool ensure_one_backedge_per_target(goto_programt::targett &it, goto_programt &goto_program)
struct configt::ansi_ct ansi_c
function_mapt function_map
void remove_unused_functions(goto_modelt &goto_model, message_handlert &message_handler)
Expression to hold a symbol (variable)
void output_xml(std::ostream &out) const
void output_dot(std::ostream &out) const
void interpreter(const goto_modelt &goto_model, message_handlert &message_handler)
std::size_t safe_string2size_t(const std::string &str, int base)
void show_value_sets(ui_message_handlert::uit ui, const goto_modelt &goto_model, const value_set_analysist &value_set_analysis)
void label_properties(goto_modelt &goto_model)
void print_struct_alignment_problems(const symbol_tablet &symbol_table, std::ostream &out)
void goto_check_c(const irep_idt &function_identifier, goto_functionst::goto_functiont &goto_function, const namespacet &ns, const optionst &options, message_handlert &message_handler)
void list_undefined_functions(const goto_modelt &goto_model, std::ostream &os)
std::list< std::string > get_comma_separated_values(const char *option) const
Collect all occurrences of option option and split their values on each comma, merging them into a si...
#define HELP_ENFORCE_CONTRACT
static call_grapht create_from_root_function(const goto_modelt &model, const irep_idt &root, bool collect_callsites)
virtual uit get_ui() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
This is unused by this implementation of guards, but can be used by other implementations of the same...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)
void show_call_sequences(const irep_idt &caller, const goto_programt &goto_program)
void doit()
Removes the body of all functions except those on the shortest path or functions that are reachable f...
void parse_function_pointer_restriction_options_from_cmdline(const cmdlinet &cmdline, optionst &options)
void full_slicer(goto_functionst &goto_functions, const namespacet &ns, const slicing_criteriont &criterion)
const char * CBMC_VERSION
void show_symbol_table_brief(const symbol_tablet &symbol_table, ui_message_handlert &ui)
#define HELP_INSERT_FINAL_ASSERT_FALSE
std::string banner_string(const std::string &front_end, const std::string &version)
preprocessort preprocessor
void branch(goto_modelt &goto_model, const irep_idt &id)
void do_indirect_call_and_rtti_removal(bool force=false)
void check_call_sequence(const goto_modelt &goto_model)
#define HELP_GOTO_PROGRAM_STATS
void register_languages() override
void dump_c(const goto_functionst &src, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &ns, std::ostream &out)
void undefined_function_abort_path(goto_modelt &goto_model)
bool is_set(const std::string &option) const
N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo")
#define PRECONDITION(CONDITION)
void document_properties_latex(const goto_modelt &goto_model, std::ostream &out)
static void interrupt(value_setst &value_sets, const symbol_tablet &symbol_table, const irep_idt &function_id, goto_programt &goto_program, const symbol_exprt &interrupt_handler, const rw_set_baset &isr_rw_set)
void remove_function_pointers(message_handlert &_message_handler, goto_modelt &goto_model, bool only_remove_const_fps)
void property_slicer(goto_functionst &goto_functions, const namespacet &ns, const std::list< std::string > &properties)
void remove_pointers(goto_modelt &goto_model, value_setst &value_sets)
Remove dereferences in all expressions contained in the program goto_model.
void instrument_goto_program()
#define HELP_REMOVE_CALLS_NO_BODY
#define HELP_LOOP_CONTRACTS
void dump_c_type_header(const goto_functionst &src, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &ns, const std::string module, std::ostream &out)
std::string get_value(char option) const
static void stack_depth(goto_programt &goto_program, const symbol_exprt &symbol, const std::size_t i_depth, const exprt &max_depth)
void rewrite_union(exprt &expr)
We rewrite u.c for unions u into byte_extract(u, 0), and { .c = v } into byte_update(NIL,...
#define HELP_SHOW_PROPERTIES
void k_induction(goto_modelt &goto_model, bool base_case, bool step_case, unsigned k)
#define HELP_REMOVE_CONST_FUNCTION_POINTERS
void count_eloc(const goto_modelt &goto_model)
void show_goto_functions(const namespacet &ns, ui_message_handlert &ui_message_handler, const goto_functionst &goto_functions, bool list_only)
#define PARSE_OPTIONS_GOTO_CHECK(cmdline, options)
static void transform_assertions_assumptions(goto_programt &goto_program, bool enable_assertions, bool enable_built_in_assertions, bool enable_assumptions)
#define HELP_CONFIG_LIBRARY
void function_enter(goto_modelt &goto_model, const irep_idt &id)
void instrument(goto_modelt &)
void set_from_symbol_table(const symbol_tablet &)
void goto_function_inline(goto_modelt &goto_model, const irep_idt function, message_handlert &message_handler, bool adjust_function, bool caching)
Transitively inline all function calls made from a particular function.
void compute_loop_numbers()
#define CPROVER_EXIT_CONVERSION_FAILED
Failure to convert / write to another format.
std::wstring widen(const char *s)
#define HELP_REPLACE_FUNCTION_BODY
void output(std::ostream &out, const goto_functiont &goto_function, const namespacet &ns) const
void weak_memory(memory_modelt model, value_setst &value_sets, goto_modelt &goto_model, bool SCC, instrumentation_strategyt event_strategy, bool no_cfg_kill, bool no_dependencies, loop_strategyt duplicate_body, unsigned input_max_var, unsigned input_max_po_trans, bool render_po, bool render_file, bool render_function, bool cav11_option, bool hide_internals, message_handlert &message_handler, bool ignore_arrays)
void parse_nondet_volatile_options(const cmdlinet &cmdline, optionst &options)
bool partial_inlining_done
unsigned safe_string2unsigned(const std::string &str, int base)
static void mmio(value_setst &value_sets, const symbol_tablet &symbol_table, const irep_idt &function_id, goto_programt &goto_program)
#define HELP_ANSI_C_LANGUAGE
void output(std::ostream &stream, const goto_programt &program, const namespacet &ns)
Output non-null expressions per instruction in human-readable format.
std::list< std::string > user_specified_properties
This is a may analysis (i.e.
void remove_functions(goto_modelt &goto_model, const std::list< std::string > &names, message_handlert &message_handler)
Remove the body of all functions listed in "names" such that an analysis will treat it as a side-effe...
A call graph (https://en.wikipedia.org/wiki/Call_graph) for a GOTO model or GOTO functions collection...
void show_locations(ui_message_handlert::uit ui, const irep_idt function_id, const goto_programt &goto_program)
The aggressive slicer removes the body of all the functions except those on the shortest path,...
void annotate_invariants(const invariant_mapt &invariant_map, goto_modelt &goto_model, messaget &log)
Annotate the invariants in invariant_map to their corresponding loops.
goto_functionst goto_functions
GOTO functions.
#define RESTRICT_FUNCTION_POINTER_OPT
void cprover_c_library_factory(const std::set< irep_idt > &functions, symbol_tablet &symbol_table, message_handlert &message_handler)
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
bool set(const cmdlinet &cmdline)
void output(std::ostream &out) const
#define RESTRICT_FUNCTION_POINTER_FROM_FILE_OPT
void remove_returns(symbol_table_baset &symbol_table, goto_functionst &goto_functions)
removes returns
std::list< std::string > name_snippets
#define CPROVER_EXIT_USAGE_ERROR
A usage error is returned when the command line is invalid or conflicting.
unsigned unsafe_string2unsigned(const std::string &str, int base)
void remove_asm(goto_functionst &goto_functions, symbol_tablet &symbol_table)
Replaces inline assembly instructions in the goto program (i.e., instructions of kind OTHER with a co...
void accelerate_functions(goto_modelt &goto_model, message_handlert &message_handler, bool use_z3, guard_managert &guard_manager)
void preserve_functions(const std::list< std::string > &function_list)
Adds a list of functions to the set of functions for the aggressive slicer to preserve.
A generic container class for the GOTO intermediate representation of one function.
void output_dot(std::ostream &out) const
void output_dot(std::ostream &) const
Output class hierarchy in Graphviz DOT format.
void check(const goto_modelt &, bool xml, std::ostream &)
void output(std::ostream &out) const
bool insert_final_assert_false(goto_modelt &goto_model, const std::string &function_to_instrument, message_handlert &message_handler)
Transform a goto program by inserting assert(false) at the end of a given function function_to_instru...
static bool read_goto_binary(const std::string &filename, symbol_tablet &, goto_functionst &, message_handlert &)
Read a goto binary from a file, but do not update config.
void validate(const validation_modet vm=validation_modet::INVARIANT, const goto_model_validation_optionst &goto_model_validation_options=goto_model_validation_optionst{}) const override
Check that the goto model is well-formed.
std::unique_ptr< generate_function_bodiest > generate_function_bodies_factory(const std::string &options, const c_object_factory_parameterst &object_factory_parameters, const symbol_tablet &symbol_table, message_handlert &message_handler)
Create the type that actually generates the functions.
void function_exit(goto_modelt &goto_model, const irep_idt &id)
#define FLAG_ENFORCE_CONTRACT
instrumentation_strategyt
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
#define CPROVER_EXIT_INTERNAL_ERROR
An error has been encountered during processing the requested analysis.
void document_properties_html(const goto_modelt &goto_model, std::ostream &out)
void add_failed_symbols(symbol_table_baset &symbol_table)
Create a failed-dereference symbol for all symbols in the given table that need one (i....
void havoc_loops(goto_modelt &goto_model)
#define CPROVER_EXIT_SUCCESS
Success indicates the required analysis has been performed without error.
void enforce_contracts(const std::set< std::string > &to_enforce, const std::set< std::string > &to_exclude_from_nondet_init={})
Turn requires & ensures into assumptions and assertions for each of the named functions.
#define HELP_REPLACE_CALLS
void string_abstraction(goto_modelt &goto_model, message_handlert &message_handler)
static unsigned eval_verbosity(const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest.
void list_eloc(const goto_modelt &goto_model)
void nondet_volatile(goto_modelt &goto_model, const optionst &options)
Havoc reads from volatile expressions, if enabled in the options.
mstreamt & warning() const
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
void thread_exit_instrumentation(goto_programt &goto_program)
#define HELP_UNINITIALIZED_CHECK
const std::list< std::string > & get_values(const std::string &option) const
symbol_tablet symbol_table
Symbol table.
std::string align_center_with_border(const std::string &text)
Utility for displaying help centered messages borderered by "* *".
void print_path_lengths(const goto_modelt &goto_model)
irep_idt name
The unique identifier.
void restore_returns(goto_modelt &goto_model)
restores return statements
void dump_cpp(const goto_functionst &src, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &ns, std::ostream &out)
void restrict_function_pointers(message_handlert &message_handler, goto_modelt &goto_model, const optionst &options)
Apply function pointer restrictions to a goto_model.
#define forall_goto_program_instructions(it, program)
static void list_calls_and_arguments(const namespacet &ns, const goto_programt &goto_program)
jsont output_log_json() const
void reachability_slicer(goto_modelt &goto_model, const bool include_forward_reachability, message_handlert &message_handler)
Perform reachability slicing on goto_model, with respect to the criterion given by all properties.
#define HELP_RESTRICT_FUNCTION_POINTER
void interval_analysis(goto_modelt &goto_model)
Initialises the abstract interpretation over interval domain and instruments instructions using inter...
void cprover_cpp_library_factory(const std::set< irep_idt > &functions, symbol_tablet &symbol_table, message_handlert &message_handler)
void goto_inline(goto_modelt &goto_model, message_handlert &message_handler, bool adjust_function)
Inline every function call into the entry_point() function.
#define HELP_NONDET_VOLATILE