CBMC
value_set_analysis.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Value Set Propagation
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_H
13 #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_H
14 
15 #include <analyses/ai.h>
16 
17 #include "value_set_domain.h" // IWYU pragma: keep
18 #include "value_sets.h"
19 
24 template <class VSDT>
25 class value_set_analysis_templatet : public value_setst, public ait<VSDT>
26 {
27 private:
28  const namespacet &ns;
29 
30 public:
31  typedef VSDT domaint;
33  typedef typename baset::locationt locationt;
34 
36  : baset(std::make_unique<ai_domain_factory_location_constructort<VSDT>>()),
37  ns(_ns)
38  {
39  }
40 
41  // interface value_sets
42  std::vector<exprt>
43  get_values(const irep_idt &, locationt l, const exprt &expr) override
44  {
45  auto s = this->abstract_state_before(l);
46  auto d = std::dynamic_pointer_cast<const domaint>(s);
47  return d->value_set.get_value_set(expr, ns);
48  }
49 };
50 
51 typedef
54 
55 #endif // CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_H
Abstract Interpretation.
goto_programt::const_targett locationt
Definition: ai.h:124
virtual cstate_ptrt abstract_state_before(locationt l) const
Get a copy of the abstract state before the given instruction, without needing to know what kind of d...
Definition: ai.h:221
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition: ai.h:562
goto_programt::const_targett locationt
Definition: ai.h:585
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 namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
This template class implements a data-flow analysis which keeps track of what values different variab...
value_set_analysis_templatet(const namespacet &_ns)
std::vector< exprt > get_values(const irep_idt &, locationt l, const exprt &expr) override
value_set_analysis_templatet< value_set_domain_templatet< value_sett > > value_set_analysist
Value Set Propagation.