CBMC
Loading...
Searching...
No Matches
renamed.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Symbolic Execution
4
5Author: Romain Brenguier, romain.brenguier@diffblue.com
6
7\*******************************************************************/
10
11#ifndef CPROVER_GOTO_SYMEX_RENAMED_H
12#define CPROVER_GOTO_SYMEX_RENAMED_H
13
15
16#include <util/std_expr.h>
17
18class ssa_exprt;
19
22{
23 L0 = 0,
24 L1 = 1,
26 L2 = 3
27};
28
31template <typename underlyingt, levelt level>
32class renamedt : private underlyingt
33{
34public:
35 static_assert(
36 std::is_base_of<exprt, underlyingt>::value ||
37 std::is_base_of<typet, underlyingt>::value,
38 "underlyingt should inherit from exprt or typet");
39
40 const underlyingt &get() const
41 {
42 return static_cast<const underlyingt &>(*this);
43 }
44
46 {
47 simplifier.simplify(value());
48 }
49
50private:
51 underlyingt &value()
52 {
53 return static_cast<underlyingt &>(*this);
54 };
55
57 symex_level0(ssa_exprt, const namespacet &, std::size_t);
58 friend struct symex_level1t;
59 friend struct symex_level2t;
60 friend class goto_symex_statet;
61
63 explicit renamedt(underlyingt value) : underlyingt(std::move(value))
64 {
65 }
66};
67
68#endif // CPROVER_GOTO_SYMEX_RENAMED_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Central data structure: state.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
Wrapper for expressions or types which have been renamed up to a given level.
Definition renamed.h:33
renamedt(underlyingt value)
Only the friend classes can create renamedt objects.
Definition renamed.h:63
friend renamedt< ssa_exprt, L0 > symex_level0(ssa_exprt, const namespacet &, std::size_t)
Set the level 0 renaming of SSA expressions.
underlyingt & value()
Definition renamed.h:51
void simplify(simplify_exprt &simplifier)
Definition renamed.h:45
const underlyingt & get() const
Definition renamed.h:40
Expression providing an SSA-renamed symbol of expressions.
Definition ssa_expr.h:17
STL namespace.
levelt
Symex renaming level names.
Definition renamed.h:22
@ L2
Definition renamed.h:26
@ L0
Definition renamed.h:23
@ L1_WITH_CONSTANT_PROPAGATION
Definition renamed.h:25
@ L1
Definition renamed.h:24
API to expression classes.
Functor to set the level 1 renaming of SSA expressions.
Functor to set the level 2 renaming of SSA expressions.