29 #ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_H
30 #define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_H
54 #define FLAG_DFCC "dfcc"
55 #define OPT_DFCC "(" FLAG_DFCC "):"
58 " {y--dfcc} {uharness} \t " \
59 "activate dynamic frame condition checking for contracts using the given " \
60 "harness as entry point\n"
62 #define FLAG_ENFORCE_CONTRACT_REC "enforce-contract-rec"
63 #define OPT_ENFORCE_CONTRACT_REC "(" FLAG_ENFORCE_CONTRACT_REC "):"
64 #define HELP_ENFORCE_CONTRACT_REC \
65 " {y--enforce-contract-rec} {ufunction}[{y/}{ucontract}] \t " \
66 "wrap {ufunction} with an assertion of the contract and assume recursive " \
68 "{ufunction} satisfy the contract\n"
79 std::string
what()
const override;
106 const std::optional<irep_idt> &to_check,
107 const bool allow_recursive_calls,
108 const std::set<irep_idt> &to_replace,
110 const std::set<std::string> &to_exclude_from_nondet_static,
133 const std::optional<std::pair<irep_idt, irep_idt>> &
to_check,
135 const std::map<irep_idt, irep_idt> &
to_replace,
170 const std::optional<std::pair<irep_idt, irep_idt>> &
to_check;
A class for an expression that represents a conditional target or a list of targets sharing a common ...
Base class for exceptions thrown in the cprover project.
std::string reason
The reason this exception was generated.
Translates assigns and frees clauses of a function contract or loop contract into GOTO programs that ...
A contract is represented by a function declaration or definition with contract clauses attached to i...
This class instruments GOTO functions or instruction sequences for frame condition checking and loop ...
Class interface to library types and functions defined in cprover_contracts.c.
This class rewrites GOTO functions that use the built-ins:
Entry point into the contracts transformation.
std::set< irep_idt > function_pointer_contracts
std::set< irep_idt > pure_contract_symbols
dfcc_spec_functionst spec_functions
void instrument_harness_function()
void instrument_other_functions()
const loop_contract_configt loop_contract_config
void reinitialize_model()
Re-initialise the GOTO model.
const std::set< std::string > & to_exclude_from_nondet_static
dfcct(const optionst &options, goto_modelt &goto_model, const irep_idt &harness_id, const std::optional< std::pair< irep_idt, irep_idt >> &to_check, const bool allow_recursive_calls, const std::map< irep_idt, irep_idt > &to_replace, const loop_contract_configt loop_contract_config, message_handlert &message_handler, const std::set< std::string > &to_exclude_from_nondet_static)
Class constructor.
void link_model_and_load_dfcc_library()
dfcc_swap_and_wrapt swap_and_wrap
dfcc_lift_memory_predicatest memory_predicates
void wrap_checked_function()
void lift_memory_predicates()
const std::optional< std::pair< irep_idt, irep_idt > > & to_check
void check_transform_goto_model_preconditions()
Checks preconditions on arguments of transform_goto_model.
std::size_t max_assigns_clause_size
Tracks the maximum number of targets in any assigns clause handled in the transformation (used to spe...
void transform_goto_model()
Applies function contracts and loop contracts transformation to GOTO model using the dynamic frame co...
dfcc_instrumentt instrument
void wrap_replaced_functions()
message_handlert & message_handler
const irep_idt & harness_id
dfcc_contract_clauses_codegent contract_clauses_codegen
const bool allow_recursive_calls
std::set< irep_idt > other_symbols
dfcc_contract_handlert contract_handler
const std::map< irep_idt, irep_idt > & to_replace
void partition_function_symbols(std::set< irep_idt > &pure_contract_symbols, std::set< irep_idt > &other_symbols)
Partitions the function symbols of the symbol table into pure contracts and other function symbols sy...
void wrap_discovered_function_pointer_contracts()
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Exception thrown for bad function/contract specification pairs passed on the CLI.
invalid_function_contract_pair_exceptiont(std::string reason, std::string correct_format="")
std::string what() const override
A human readable description of what went wrong.
std::string correct_format
Class that provides messages with a built-in verbosity 'level'.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Translates assigns and frees clauses of a function contract or loop contract into goto programs that ...
Specialisation of dfcc_contract_handlert for contracts.
Add instrumentation to a goto program to perform frame condition checks.
Dynamic frame condition checking library loading.
Collects all user-defined predicates that call functions is_fresh, pointer_in_range,...
Translate functions that specify assignable and freeable targets declaratively into active functions ...
Given a function_id and contract_id, swaps its body to a function with a fresh mangled name,...
void dfcc(const optionst &options, goto_modelt &goto_model, const irep_idt &harness_id, const std::optional< irep_idt > &to_check, const bool allow_recursive_calls, const std::set< irep_idt > &to_replace, const loop_contract_configt loop_contract_config, const std::set< std::string > &to_exclude_from_nondet_static, message_handlert &message_handler)
Applies function contracts transformation to GOTO model, using the dynamic frame condition checking a...
Loop contract configurations.