Go to the documentation of this file.
6 #ifndef CPROVER_GOTO_PROGRAMS_LAZY_GOTO_MODEL_H
7 #define CPROVER_GOTO_PROGRAMS_LAZY_GOTO_MODEL_H
52 typedef std::function<
152 template <
typename THandler>
161 handler.process_goto_function(fun, model, options);
164 return handler.process_goto_functions(
goto_model, options);
166 [&handler](
const irep_idt &name) ->
bool {
167 return handler.can_generate_function_body(name);
173 bool is_first_chance) {
174 return handler.generate_function_body(
175 function_name,
symbol_table,
function, is_first_chance);
197 static std::unique_ptr<goto_modelt>
202 return std::move(model.goto_model);
252 goto_model->validate(vm, goto_model_validation_options);
278 #endif // CPROVER_GOTO_PROGRAMS_LAZY_GOTO_MODEL_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::function< bool(const irep_idt &name)> can_generate_function_bodyt
symbol_tablet & symbol_table
Reference to symbol_table in the internal goto_model.
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.
const generate_function_bodyt driver_program_generate_function_body
const lazy_goto_functions_mapt goto_functions
static std::unique_ptr< goto_modelt > process_whole_model_and_freeze(lazy_goto_modelt &&model)
The model returned here has access to the functions we've already loaded but is frozen in the sense t...
language_filet & add_language_file(const std::string &filename)
language_filest language_files
Provides a wrapper for a map of lazily loaded goto_functiont.
lazy_goto_modelt & operator=(lazy_goto_modelt &&other)
bool can_produce_function(const irep_idt &id) const override
Determines if this model can produce a body for the given function.
message_handlert & message_handler
Logging helper field.
lazy_goto_functions_mapt::can_generate_function_bodyt can_generate_function_bodyt
Callback function that determines whether the creator of a lazy_goto_modelt can itself supply a funct...
const can_generate_function_bodyt driver_program_can_generate_function_body
static lazy_goto_modelt from_handler_object(THandler &handler, const optionst &options, message_handlert &message_handler)
Create a lazy_goto_modelt from a object that defines function/module pass handlers.
const goto_functionst::goto_functiont & get_goto_function(const irep_idt &id) override
Get a GOTO function body.
const_mapped_type at(const key_type &name) const
Gets the body for a given function.
A GOTO model that produces function bodies on demand.
The symbol table base class interface.
std::function< bool(const irep_idt &function_name, symbol_table_baset &symbol_table, goto_functiont &function, bool body_available)> generate_function_bodyt
lazy_goto_functions_mapt::generate_function_bodyt generate_function_bodyt
Callback function that may provide a body for a GOTO function, either as a fallback (when we don't ha...
std::unique_ptr< goto_modelt > goto_model
language_filet & add_file(const std::string &filename)
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
void initialize(const std::vector< std::string > &files, const optionst &options)
Performs initial symbol table and language_filest initialization from a given commandline and parsed ...
const post_process_functionst post_process_functions
const post_process_functiont post_process_function
::goto_functiont goto_functiont
A collection of goto functions.
Abstract interface to eager or lazy GOTO models.
void load_all_functions() const
Eagerly loads all functions from the symbol table.
std::function< void(goto_model_functiont &function, const abstract_goto_modelt &model)> post_process_functiont
Callback function that post-processes a GOTO function.
const goto_functionst & get_goto_functions() const override
Accessor to retrieve the internal goto_functionst.
std::function< bool(goto_modelt &goto_model)> post_process_functionst
Callback function that post-processes a whole GOTO model.
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
lazy_goto_modelt(post_process_functiont post_process_function, post_process_functionst post_process_functions, can_generate_function_bodyt driver_program_can_generate_function_body, generate_function_bodyt driver_program_generate_function_body, message_handlert &message_handler)
Construct a lazy GOTO model, supplying callbacks that customise its behaviour.
const symbol_tablet & get_symbol_table() const override
Accessor to get the symbol table.