CBMC
havoc_assigns_clause_targets.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Havoc multiple and possibly dependent targets simultaneously
4 
5 Author: Remi Delmas, delmasrd@amazon.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_HAVOC_ASSIGNS_CLAUSE_TARGETS_H
13 #define CPROVER_GOTO_INSTRUMENT_CONTRACTS_HAVOC_ASSIGNS_CLAUSE_TARGETS_H
14 
16 #include <util/expr.h>
17 
18 class namespacet;
19 class symbol_tablet;
20 class goto_programt;
21 class goto_functionst;
22 class message_handlert;
23 
45 {
46 public:
57  const irep_idt &_function_id,
58  const std::vector<exprt> &_targets,
59  const goto_functionst &_functions,
60  cfg_infot &_cfg_info,
61  const source_locationt &_source_location,
62  symbol_tablet &_st,
63  message_handlert &_message_handler)
65  _function_id,
66  _functions,
67  _cfg_info,
68  _st,
69  _message_handler),
70  targets(_targets),
71  source_location(_source_location)
72  {
73  }
74 
76  void get_instructions(goto_programt &dest);
77 
78 private:
117  void havoc_if_valid(car_exprt car, goto_programt &dest);
118 
120  void havoc_static_local(car_exprt car, goto_programt &dest);
121 
122  const std::vector<exprt> &targets;
124 };
125 #endif // CPROVER_GOTO_INSTRUMENT_CONTRACTS_HAVOC_ASSIGNS_CLAUSE_TARGETS_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
havoc_assigns_clause_targetst::havoc_if_valid
void havoc_if_valid(car_exprt car, goto_programt &dest)
Generates instructions to conditionally havoc the given conditional address range expression car,...
Definition: havoc_assigns_clause_targets.cpp:64
symbol_tablet
The symbol table.
Definition: symbol_table.h:13
havoc_assigns_clause_targetst::get_instructions
void get_instructions(goto_programt &dest)
Generates the assigns clause replacement instructions in dest.
Definition: havoc_assigns_clause_targets.cpp:31
havoc_assigns_clause_targetst::havoc_static_local
void havoc_static_local(car_exprt car, goto_programt &dest)
Havoc a static local expression.
Definition: havoc_assigns_clause_targets.cpp:133
cfg_infot
Stores information about a goto function computed from its CFG.
Definition: cfg_info.h:38
havoc_assigns_clause_targetst::source_location
const source_locationt & source_location
Definition: havoc_assigns_clause_targets.h:123
havoc_assigns_clause_targetst::targets
const std::vector< exprt > & targets
Definition: havoc_assigns_clause_targets.h:122
instrument_spec_assignst
A class that generates instrumentation for assigns clause checking.
Definition: instrument_spec_assigns.h:189
expr.h
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
havoc_assigns_clause_targetst
Class to generate havocking instructions for target expressions of a function contract's assign claus...
Definition: havoc_assigns_clause_targets.h:44
message_handlert
Definition: message.h:27
source_locationt
Definition: source_location.h:18
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:24
instrument_spec_assigns.h
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:72
car_exprt
Class that represents a normalized conditional address range, with:
Definition: instrument_spec_assigns.h:76
havoc_assigns_clause_targetst::havoc_assigns_clause_targetst
havoc_assigns_clause_targetst(const irep_idt &_function_id, const std::vector< exprt > &_targets, const goto_functionst &_functions, cfg_infot &_cfg_info, const source_locationt &_source_location, symbol_tablet &_st, message_handlert &_message_handler)
Definition: havoc_assigns_clause_targets.h:56