cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
dfcc_contract_clauses_codegen.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: February 2023
7
8
\*******************************************************************/
9
13
14
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_CLAUSES_CODEGEN_H
15
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_CLAUSES_CODEGEN_H
16
17
#include <
util/expr.h
>
18
#include <
util/message.h
>
19
#include <
util/namespace.h
>
20
21
class
conditional_target_group_exprt
;
22
class
dfcc_libraryt
;
23
class
goto_modelt
;
24
class
goto_programt
;
25
28
class
dfcc_contract_clauses_codegent
29
{
30
public
:
34
dfcc_contract_clauses_codegent
(
35
goto_modelt
&
goto_model
,
36
message_handlert
&
message_handler
,
37
dfcc_libraryt
&
library
);
38
49
void
gen_spec_assigns_instructions
(
50
const
irep_idt
&language_mode,
51
const
exprt::operandst
&assigns_clause,
52
goto_programt
&dest);
53
64
void
gen_spec_frees_instructions
(
65
const
irep_idt
&language_mode,
66
const
exprt::operandst
&frees_clause,
67
goto_programt
&dest);
68
69
protected
:
70
goto_modelt
&
goto_model
;
71
message_handlert
&
message_handler
;
72
messaget
log
;
73
dfcc_libraryt
&
library
;
74
namespacet
ns
;
75
78
void
encode_assignable_target_group
(
79
const
irep_idt
&language_mode,
80
const
conditional_target_group_exprt
&group,
81
goto_programt
&dest);
82
85
void
encode_assignable_target
(
86
const
irep_idt
&language_mode,
87
const
exprt
&target,
88
goto_programt
&dest);
89
92
void
encode_freeable_target_group
(
93
const
irep_idt
&language_mode,
94
const
conditional_target_group_exprt
&group,
95
goto_programt
&dest);
96
99
void
encode_freeable_target
(
100
const
irep_idt
&language_mode,
101
const
exprt
&target,
102
goto_programt
&dest);
103
107
void
inline_and_check_warnings
(
goto_programt
&goto_program);
108
};
109
110
#endif
conditional_target_group_exprt
A class for an expression that represents a conditional target or a list of targets sharing a common ...
Definition
c_expr.h:233
dfcc_contract_clauses_codegent::encode_freeable_target_group
void encode_freeable_target_group(const irep_idt &language_mode, const conditional_target_group_exprt &group, goto_programt &dest)
Generates GOTO instructions to build the representation of the given conditional target group.
Definition
dfcc_contract_clauses_codegen.cpp:187
dfcc_contract_clauses_codegent::encode_assignable_target
void encode_assignable_target(const irep_idt &language_mode, const exprt &target, goto_programt &dest)
Generates GOTO instructions to build the representation of the given assignable target.
Definition
dfcc_contract_clauses_codegen.cpp:125
dfcc_contract_clauses_codegent::encode_assignable_target_group
void encode_assignable_target_group(const irep_idt &language_mode, const conditional_target_group_exprt &group, goto_programt &dest)
Generates GOTO instructions to build the representation of the given conditional target group.
Definition
dfcc_contract_clauses_codegen.cpp:98
dfcc_contract_clauses_codegent::log
messaget log
Definition
dfcc_contract_clauses_codegen.h:72
dfcc_contract_clauses_codegent::gen_spec_assigns_instructions
void gen_spec_assigns_instructions(const irep_idt &language_mode, const exprt::operandst &assigns_clause, goto_programt &dest)
Generates instructions encoding the assigns_clause targets and adds them to dest.
Definition
dfcc_contract_clauses_codegen.cpp:43
dfcc_contract_clauses_codegent::goto_model
goto_modelt & goto_model
Definition
dfcc_contract_clauses_codegen.h:70
dfcc_contract_clauses_codegent::encode_freeable_target
void encode_freeable_target(const irep_idt &language_mode, const exprt &target, goto_programt &dest)
Generates GOTO instructions to build the representation of the given freeable target.
Definition
dfcc_contract_clauses_codegen.cpp:214
dfcc_contract_clauses_codegent::library
dfcc_libraryt & library
Definition
dfcc_contract_clauses_codegen.h:73
dfcc_contract_clauses_codegent::message_handler
message_handlert & message_handler
Definition
dfcc_contract_clauses_codegen.h:71
dfcc_contract_clauses_codegent::gen_spec_frees_instructions
void gen_spec_frees_instructions(const irep_idt &language_mode, const exprt::operandst &frees_clause, goto_programt &dest)
Generates instructions encoding the frees_clause targets and adds them to dest.
Definition
dfcc_contract_clauses_codegen.cpp:71
dfcc_contract_clauses_codegent::inline_and_check_warnings
void inline_and_check_warnings(goto_programt &goto_program)
Inlines all calls in the given program and checks that the only missing functions or functions withou...
Definition
dfcc_contract_clauses_codegen.cpp:260
dfcc_contract_clauses_codegent::ns
namespacet ns
Definition
dfcc_contract_clauses_codegen.h:74
dfcc_contract_clauses_codegent::dfcc_contract_clauses_codegent
dfcc_contract_clauses_codegent(goto_modelt &goto_model, message_handlert &message_handler, dfcc_libraryt &library)
Definition
dfcc_contract_clauses_codegen.cpp:31
dfcc_libraryt
Class interface to library types and functions defined in cprover_contracts.c.
Definition
dfcc_library.h:163
exprt
Base class for all expressions.
Definition
expr.h:57
exprt::operandst
std::vector< exprt > operandst
Definition
expr.h:59
goto_modelt
Definition
goto_model.h:27
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition
goto_program.h:72
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
expr.h
namespace.h
message.h
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
goto-instrument
contracts
dynamic-frames
dfcc_contract_clauses_codegen.h
Generated by
1.17.0