CBMC
pointer_logic.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Pointer Logic
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H
13 #define CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H
14 
15 #include <util/mp_arith.h>
16 #include <util/expr.h>
17 #include <util/numbering.h>
18 
19 class namespacet;
20 class pointer_typet;
21 
23 {
24 public:
25  // this numbers the objects
27 
28  struct pointert
29  {
31 
33  : object(std::move(_obj)), offset(std::move(_off))
34  {
35  }
36  };
37 
40  const pointert &pointer,
41  const pointer_typet &type) const;
42 
44  exprt pointer_expr(const mp_integer &object, const pointer_typet &type) const;
45 
47  explicit pointer_logict(const namespacet &_ns);
48 
49  mp_integer add_object(const exprt &expr);
50 
52  const mp_integer &get_null_object() const
53  {
54  return null_object;
55  }
56 
59  {
60  return invalid_object;
61  }
62 
63  bool is_dynamic_object(const exprt &expr) const;
64 
65  void get_dynamic_objects(std::vector<mp_integer> &objects) const;
66 
67 protected:
68  const namespacet &ns;
70 };
71 
72 #endif // CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H
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
const mp_integer & get_invalid_object() const
Definition: pointer_logic.h:58
mp_integer invalid_object
Definition: pointer_logic.h:69
numberingt< exprt, irep_hash > objects
Definition: pointer_logic.h:26
exprt pointer_expr(const pointert &pointer, const pointer_typet &type) const
Convert an (object,offset) pair to an expression.
mp_integer null_object
Definition: pointer_logic.h:69
void get_dynamic_objects(std::vector< mp_integer > &objects) const
mp_integer add_object(const exprt &expr)
const mp_integer & get_null_object() const
Definition: pointer_logic.h:52
const namespacet & ns
Definition: pointer_logic.h:68
bool is_dynamic_object(const exprt &expr) const
pointer_logict(const namespacet &_ns)
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
Definition: pointer_expr.h:24
BigInt mp_integer
Definition: smt_terms.h:17
pointert(mp_integer _obj, mp_integer _off)
Definition: pointer_logic.h:32