CBMC
|
Generates GOTO functions modelling a contract assigns and frees clauses. More...
#include <dfcc_contract_functions.h>
Public Member Functions | |
dfcc_contract_functionst (const symbolt &pure_contract_symbol, goto_modelt &goto_model, message_handlert &message_handler, dfcc_libraryt &library, dfcc_spec_functionst &spec_functions, dfcc_contract_clauses_codegent &contract_clauses_codegen, dfcc_instrumentt &instrument) | |
void | instrument_without_loop_contracts_check_no_pointer_contracts (const irep_idt &spec_function_id) |
Instruments the given function without loop contracts and checks that no function pointer contracts were discovered. More... | |
const symbolt & | get_spec_assigns_function_symbol () const |
Returns the contract::c_assigns function symbol. More... | |
const symbolt & | get_spec_assigns_havoc_function_symbol () const |
Returns the contract::c_assigns::havoc function symbol. More... | |
const symbolt & | get_spec_frees_function_symbol () const |
Returns the contract::frees function symbol. More... | |
const std::size_t | get_nof_assigns_targets () const |
Returns the maximum number of targets in the assigns clause. More... | |
const std::size_t | get_nof_frees_targets () const |
Returns the maximum number of targets in the frees clause. More... | |
Public Attributes | |
const symbolt & | pure_contract_symbol |
The function symbol carrying the contract. More... | |
const code_with_contract_typet & | code_with_contract |
The code_with_contract_type carrying the contract clauses. More... | |
const irep_idt | spec_assigns_function_id |
Identifier of the contract::c_assigns function. More... | |
const irep_idt | spec_assigns_havoc_function_id |
Identifier of the contract::c_assigns::havoc function. More... | |
const irep_idt | spec_frees_function_id |
Identifier of the contract::frees function. More... | |
const irep_idt & | language_mode |
Language mode of the contract symbol. More... | |
Protected Member Functions | |
void | gen_spec_assigns_function () |
Translates the contract's assigns clause to a GOTO function that uses the assignable , object_upto , object_from , object_whole` built-ins to express targets. More... | |
void | gen_spec_frees_function () |
Translates the contract's frees clause to a GOTO function that uses the freeable built-in to express targets. More... | |
Protected Attributes | |
goto_modelt & | goto_model |
message_handlert & | message_handler |
messaget | log |
dfcc_libraryt & | library |
dfcc_spec_functionst & | spec_functions |
dfcc_contract_clauses_codegent & | contract_clauses_codegen |
dfcc_instrumentt & | instrument |
namespacet | ns |
std::size_t | nof_assigns_targets |
std::size_t | nof_frees_targets |
Generates GOTO functions modelling a contract assigns and frees clauses.
The generated functions are the following:
Definition at line 63 of file dfcc_contract_functions.h.
dfcc_contract_functionst::dfcc_contract_functionst | ( | const symbolt & | pure_contract_symbol, |
goto_modelt & | goto_model, | ||
message_handlert & | message_handler, | ||
dfcc_libraryt & | library, | ||
dfcc_spec_functionst & | spec_functions, | ||
dfcc_contract_clauses_codegent & | contract_clauses_codegen, | ||
dfcc_instrumentt & | instrument | ||
) |
pure_contract_symbol | the contract to generate code from |
goto_model | goto model being transformed |
message_handler | used debug/warning/error messages |
library | the contracts instrumentation library |
spec_functions | provides translation methods for assignable set |
contract_clauses_codegen | provides GOTO code generation methods for assigns and free clauses. |
instrument | Used to instrument generated functions for side effects |
Definition at line 30 of file dfcc_contract_functions.cpp.
|
protected |
Translates the contract's assigns clause to a GOTO function that uses the assignable
, object_upto
, object_from
, object_whole` built-ins to express targets.
Definition at line 118 of file dfcc_contract_functions.cpp.
|
protected |
Translates the contract's frees clause to a GOTO function that uses the freeable
built-in to express targets.
Definition at line 166 of file dfcc_contract_functions.cpp.
const std::size_t dfcc_contract_functionst::get_nof_assigns_targets | ( | ) | const |
Returns the maximum number of targets in the assigns clause.
Definition at line 108 of file dfcc_contract_functions.cpp.
const std::size_t dfcc_contract_functionst::get_nof_frees_targets | ( | ) | const |
Returns the maximum number of targets in the frees clause.
Definition at line 113 of file dfcc_contract_functions.cpp.
const symbolt & dfcc_contract_functionst::get_spec_assigns_function_symbol | ( | ) | const |
Returns the contract::c_assigns function symbol.
Definition at line 92 of file dfcc_contract_functions.cpp.
const symbolt & dfcc_contract_functionst::get_spec_assigns_havoc_function_symbol | ( | ) | const |
Returns the contract::c_assigns::havoc function symbol.
Definition at line 98 of file dfcc_contract_functions.cpp.
const symbolt & dfcc_contract_functionst::get_spec_frees_function_symbol | ( | ) | const |
Returns the contract::frees function symbol.
Definition at line 103 of file dfcc_contract_functions.cpp.
void dfcc_contract_functionst::instrument_without_loop_contracts_check_no_pointer_contracts | ( | const irep_idt & | spec_function_id | ) |
Instruments the given function without loop contracts and checks that no function pointer contracts were discovered.
Definition at line 77 of file dfcc_contract_functions.cpp.
const code_with_contract_typet& dfcc_contract_functionst::code_with_contract |
The code_with_contract_type carrying the contract clauses.
Definition at line 107 of file dfcc_contract_functions.h.
|
protected |
Definition at line 127 of file dfcc_contract_functions.h.
|
protected |
Definition at line 122 of file dfcc_contract_functions.h.
|
protected |
Definition at line 128 of file dfcc_contract_functions.h.
const irep_idt& dfcc_contract_functionst::language_mode |
Language mode of the contract symbol.
Definition at line 119 of file dfcc_contract_functions.h.
|
protected |
Definition at line 125 of file dfcc_contract_functions.h.
|
protected |
Definition at line 124 of file dfcc_contract_functions.h.
|
protected |
Definition at line 123 of file dfcc_contract_functions.h.
|
protected |
Definition at line 130 of file dfcc_contract_functions.h.
|
protected |
Definition at line 131 of file dfcc_contract_functions.h.
|
protected |
Definition at line 129 of file dfcc_contract_functions.h.
const symbolt& dfcc_contract_functionst::pure_contract_symbol |
The function symbol carrying the contract.
Definition at line 104 of file dfcc_contract_functions.h.
const irep_idt dfcc_contract_functionst::spec_assigns_function_id |
Identifier of the contract::c_assigns function.
Definition at line 110 of file dfcc_contract_functions.h.
const irep_idt dfcc_contract_functionst::spec_assigns_havoc_function_id |
Identifier of the contract::c_assigns::havoc function.
Definition at line 113 of file dfcc_contract_functions.h.
const irep_idt dfcc_contract_functionst::spec_frees_function_id |
Identifier of the contract::frees function.
Definition at line 116 of file dfcc_contract_functions.h.
|
protected |
Definition at line 126 of file dfcc_contract_functions.h.