CBMC
Loading...
Searching...
No Matches
dfcc_spec_functions.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Dynamic frame condition checking for function contracts
4
5Author: Remi Delmas, delmasrd@amazon.com
6
7\*******************************************************************/
8
14
15#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_SPEC_FUNCTIONS_H
16#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_SPEC_FUNCTIONS_H
17
18#include <util/message.h>
19#include <util/namespace.h>
20
22class dfcc_libraryt;
23class goto_modelt;
24class goto_programt;
25class symbolt;
26
33{
35 INVALID,
37 NONDET
38};
39
49{
50public:
55
77 const irep_idt &function_id,
79 std::size_t &nof_targets);
80
103 const irep_idt &function_id,
108 std::size_t &nof_targets);
109
132 const irep_idt &function_id,
133 std::size_t &nof_targets);
134
156 const irep_idt &language_mode,
157 goto_programt &program,
158 std::size_t &nof_targets);
159
183 void
184 to_spec_frees_function(const irep_idt &function_id, std::size_t &nof_targets);
185
205 const irep_idt &language_mode,
206 goto_programt &program,
207 std::size_t &nof_targets);
208
209protected:
215
219 const typet &get_target_type(const exprt &expr);
220};
221
222#endif
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
A class for an expression that represents a conditional target or a list of targets sharing a common ...
Definition c_expr.h:233
Class interface to library types and functions defined in cprover_contracts.c.
This class rewrites GOTO functions that use the built-ins:
void to_spec_assigns_function(const irep_idt &function_id, std::size_t &nof_targets)
Transforms (in place) a function.
void to_spec_frees_instructions(const exprt &write_set_to_fill, const irep_idt &language_mode, goto_programt &program, std::size_t &nof_targets)
Rewrites in place program expressed in terms of built-ins specifying freeable targets declaratively u...
void generate_havoc_function(const irep_idt &function_id, const irep_idt &havoc_function_id, std::size_t &nof_targets)
Generates the havoc function for a function contract.
message_handlert & message_handler
void to_spec_assigns_instructions(const exprt &write_set_to_fill, const irep_idt &language_mode, goto_programt &program, std::size_t &nof_targets)
Rewrites in place program expressed in terms of built-ins specifying assignable targets declaratively...
const typet & get_target_type(const exprt &expr)
Extracts the type of an assigns clause target expression The expression must be of the form: expr = c...
void generate_havoc_instructions(const irep_idt &function_id, const goto_programt &original_program, const exprt &write_set_to_havoc, dfcc_ptr_havoc_modet ptr_havoc_mode, goto_programt &havoc_program, std::size_t &nof_targets)
Translates original_program that specifies assignable targets into a program that havocs the targets.
void to_spec_frees_function(const irep_idt &function_id, std::size_t &nof_targets)
Transforms (in place) a function.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
Base class for all expressions.
Definition expr.h:56
A generic container class for the GOTO intermediate representation of one function.
Class that provides messages with a built-in verbosity 'level'.
Definition message.h:154
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
Symbol table entry.
Definition symbol.h:28
The type of an expression, extends irept.
Definition type.h:29
dfcc_ptr_havoc_modet
Represents the different ways to havoc pointers.
@ NONDET
havocs the pointer to an nondet pointer
@ INVALID
havocs the pointer to an invalid pointer