cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
dfcc_contract_functions.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Dynamic frame condition checking for function contracts
4
5
Author: Remi Delmas, delmasrd@amazon.com
6
Date: August 2022
7
8
\*******************************************************************/
9
13
14
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_FUNCTIONS_H
15
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_FUNCTIONS_H
16
17
#include <
util/message.h
>
18
#include <
util/namespace.h
>
19
20
class
code_with_contract_typet
;
21
class
dfcc_contract_clauses_codegent
;
22
class
dfcc_instrumentt
;
23
class
dfcc_libraryt
;
24
class
dfcc_spec_functionst
;
25
class
goto_modelt
;
26
54
class
dfcc_contract_functionst
55
{
56
public
:
65
dfcc_contract_functionst
(
66
const
symbolt
&
pure_contract_symbol
,
67
goto_modelt
&
goto_model
,
68
message_handlert
&
message_handler
,
69
dfcc_libraryt
&
library
,
70
dfcc_spec_functionst
&
spec_functions
,
71
dfcc_contract_clauses_codegent
&
contract_clauses_codegen
,
72
dfcc_instrumentt
&
instrument
);
73
76
void
instrument_without_loop_contracts_check_no_pointer_contracts
(
77
const
irep_idt
&spec_function_id);
78
80
const
symbolt
&
get_spec_assigns_function_symbol
()
const
;
81
83
const
symbolt
&
get_spec_assigns_havoc_function_symbol
()
const
;
84
86
const
symbolt
&
get_spec_frees_function_symbol
()
const
;
87
89
const
std::size_t
get_nof_assigns_targets
()
const
;
90
92
const
std::size_t
get_nof_frees_targets
()
const
;
93
95
const
symbolt
&
pure_contract_symbol
;
96
98
const
code_with_contract_typet
&
code_with_contract
;
99
101
const
irep_idt
spec_assigns_function_id
;
102
104
const
irep_idt
spec_assigns_havoc_function_id
;
105
107
const
irep_idt
spec_frees_function_id
;
108
110
const
irep_idt
&
language_mode
;
111
112
protected
:
113
goto_modelt
&
goto_model
;
114
message_handlert
&
message_handler
;
115
messaget
log
;
116
dfcc_libraryt
&
library
;
117
dfcc_spec_functionst
&
spec_functions
;
118
dfcc_contract_clauses_codegent
&
contract_clauses_codegen
;
119
dfcc_instrumentt
&
instrument
;
120
namespacet
ns
;
121
std::size_t
nof_assigns_targets
;
122
std::size_t
nof_frees_targets
;
123
127
void
gen_spec_assigns_function();
128
131
void
gen_spec_frees_function
();
132
};
133
134
#endif
code_with_contract_typet
Definition
c_types.h:391
dfcc_contract_clauses_codegent
Translates assigns and frees clauses of a function contract or loop contract into GOTO programs that ...
Definition
dfcc_contract_clauses_codegen.h:29
dfcc_contract_functionst::gen_spec_frees_function
void gen_spec_frees_function()
Translates the contract's assigns clause to a GOTO function that uses the assignable,...
Definition
dfcc_contract_functions.cpp:155
dfcc_contract_functionst::nof_assigns_targets
std::size_t nof_assigns_targets
Definition
dfcc_contract_functions.h:121
dfcc_contract_functionst::spec_assigns_havoc_function_id
const irep_idt spec_assigns_havoc_function_id
Identifier of the contract::c_assigns::havoc function.
Definition
dfcc_contract_functions.h:104
dfcc_contract_functionst::message_handler
message_handlert & message_handler
Definition
dfcc_contract_functions.h:114
dfcc_contract_functionst::ns
namespacet ns
Definition
dfcc_contract_functions.h:120
dfcc_contract_functionst::instrument
dfcc_instrumentt & instrument
Definition
dfcc_contract_functions.h:119
dfcc_contract_functionst::code_with_contract
const code_with_contract_typet & code_with_contract
The code_with_contract_type carrying the contract clauses.
Definition
dfcc_contract_functions.h:98
dfcc_contract_functionst::get_spec_frees_function_symbol
const symbolt & get_spec_frees_function_symbol() const
Returns the contract::frees function symbol.
Definition
dfcc_contract_functions.cpp:92
dfcc_contract_functionst::goto_model
goto_modelt & goto_model
Definition
dfcc_contract_functions.h:113
dfcc_contract_functionst::nof_frees_targets
std::size_t nof_frees_targets
Definition
dfcc_contract_functions.h:122
dfcc_contract_functionst::contract_clauses_codegen
dfcc_contract_clauses_codegent & contract_clauses_codegen
Definition
dfcc_contract_functions.h:118
dfcc_contract_functionst::spec_assigns_function_id
const irep_idt spec_assigns_function_id
Identifier of the contract::c_assigns function.
Definition
dfcc_contract_functions.h:101
dfcc_contract_functionst::log
messaget log
Definition
dfcc_contract_functions.h:115
dfcc_contract_functionst::instrument_without_loop_contracts_check_no_pointer_contracts
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 w...
Definition
dfcc_contract_functions.cpp:67
dfcc_contract_functionst::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)
Definition
dfcc_contract_functions.cpp:19
dfcc_contract_functionst::get_spec_assigns_function_symbol
const symbolt & get_spec_assigns_function_symbol() const
Returns the contract::c_assigns function symbol.
Definition
dfcc_contract_functions.cpp:81
dfcc_contract_functionst::pure_contract_symbol
const symbolt & pure_contract_symbol
The function symbol carrying the contract.
Definition
dfcc_contract_functions.h:95
dfcc_contract_functionst::get_nof_assigns_targets
const std::size_t get_nof_assigns_targets() const
Returns the maximum number of targets in the assigns clause.
Definition
dfcc_contract_functions.cpp:97
dfcc_contract_functionst::get_spec_assigns_havoc_function_symbol
const symbolt & get_spec_assigns_havoc_function_symbol() const
Returns the contract::c_assigns::havoc function symbol.
Definition
dfcc_contract_functions.cpp:87
dfcc_contract_functionst::spec_frees_function_id
const irep_idt spec_frees_function_id
Identifier of the contract::frees function.
Definition
dfcc_contract_functions.h:107
dfcc_contract_functionst::spec_functions
dfcc_spec_functionst & spec_functions
Definition
dfcc_contract_functions.h:117
dfcc_contract_functionst::language_mode
const irep_idt & language_mode
Language mode of the contract symbol.
Definition
dfcc_contract_functions.h:110
dfcc_contract_functionst::library
dfcc_libraryt & library
Definition
dfcc_contract_functions.h:116
dfcc_contract_functionst::get_nof_frees_targets
const std::size_t get_nof_frees_targets() const
Returns the maximum number of targets in the frees clause.
Definition
dfcc_contract_functions.cpp:102
dfcc_instrumentt
This class instruments GOTO functions or instruction sequences for frame condition checking and loop ...
Definition
dfcc_instrument.h:44
dfcc_libraryt
Class interface to library types and functions defined in cprover_contracts.c.
Definition
dfcc_library.h:163
dfcc_spec_functionst
This class rewrites GOTO functions that use the built-ins:
Definition
dfcc_spec_functions.h:49
goto_modelt
Definition
goto_model.h:27
message_handlert
Definition
message.h:27
messaget
Class that provides messages with a built-in verbosity 'level'.
Definition
message.h:154
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
symbolt
Symbol table entry.
Definition
symbol.h:28
namespace.h
message.h
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
goto-instrument
contracts
dynamic-frames
dfcc_contract_functions.h
Generated by
1.17.0