cprover
value_set_analysis_fi.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Value Set Propagation (flow insensitive)
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FI_H
13 #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FI_H
14 
16 
17 #include "value_set_domain_fi.h"
18 #include "value_sets.h"
19 
21  public value_setst,
22  public flow_insensitive_analysist<value_set_domain_fit>
23 {
24 public:
26 
27  // constructor
29  const namespacet &_ns,
30  track_optionst _track_options=TRACK_ALL_POINTERS):
32  track_options(_track_options)
33  {
34  }
35 
37 
38  virtual void initialize(const goto_programt &goto_program);
39  virtual void initialize(const goto_functionst &goto_functions);
40 
41 protected:
43 
44  bool check_type(const typet &type);
45  void get_globals(std::list<value_set_fit::entryt> &dest);
46  void add_vars(const goto_functionst &goto_functions);
47  void add_vars(const goto_programt &goto_programa);
48 
49  void get_entries(
50  const symbolt &symbol,
51  std::list<value_set_fit::entryt> &dest);
52 
53  void get_entries_rec(
54  const irep_idt &identifier,
55  const std::string &suffix,
56  const typet &type,
57  std::list<value_set_fit::entryt> &dest);
58 
59 public:
60  // interface value_sets
61  virtual void get_values(
62  locationt l,
63  const exprt &expr,
64  std::list<exprt> &dest)
65  {
67  state.value_set.function_numbering.number(l->function);
69  state.value_set.function_numbering.number(l->function);
70  state.value_set.from_target_index = l->location_number;
71  state.value_set.to_target_index = l->location_number;
72  state.value_set.get_value_set(expr, dest, ns);
73  }
74 };
75 
76 #endif // CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FI_H
The type of an expression.
Definition: type.h:22
unsigned to_target_index
Definition: value_set_fi.h:38
void add_vars(const goto_functionst &goto_functions)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
Definition: symbol.h:30
void get_entries(const symbolt &symbol, std::list< value_set_fit::entryt > &dest)
unsigned to_function
Definition: value_set_fi.h:37
goto_programt::const_targett locationt
unsigned from_function
Definition: value_set_fi.h:37
bool check_type(const typet &type)
Value Set Propagation.
Value Set (Flow Insensitive)
TO_BE_DOCUMENTED.
Definition: namespace.h:74
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Definition: dstring.h:33
void get_value_set(const exprt &expr, std::list< exprt > &dest, const namespacet &ns) const
void get_entries_rec(const irep_idt &identifier, const std::string &suffix, const typet &type, std::list< value_set_fit::entryt > &dest)
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:70
Flow Insensitive Static Analysis.
virtual void initialize(const goto_programt &goto_program)
value_set_analysis_fit(const namespacet &_ns, track_optionst _track_options=TRACK_ALL_POINTERS)
Base class for all expressions.
Definition: expr.h:42
static hash_numbering< irep_idt, irep_id_hash > function_numbering
Definition: value_set_fi.h:40
goto_programt & goto_program
Definition: cover.cpp:63
void get_globals(std::list< value_set_fit::entryt > &dest)
virtual void get_values(locationt l, const exprt &expr, std::list< exprt > &dest)
unsigned from_target_index
Definition: value_set_fi.h:38
flow_insensitive_analysist< value_set_domain_fit > baset