cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
write_stack.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Variable Sensitivity Domain
4
5
Author: DiffBlue Limited.
6
7
\*******************************************************************/
8
12
13
#ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_H
14
#define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_H
15
16
#include <memory>
17
#include <vector>
18
19
class
abstract_environmentt
;
20
class
exprt
;
21
class
index_exprt
;
22
class
namespacet
;
23
class
write_stack_entryt
;
24
25
class
write_stackt
26
{
27
public
:
28
typedef
std::vector<std::shared_ptr<write_stack_entryt>>
29
continuation_stack_storet
;
30
31
write_stackt
();
32
33
write_stackt
(
34
const
exprt
&expr,
35
const
abstract_environmentt
&environment,
36
const
namespacet
&ns);
37
38
exprt
to_expression
()
const
;
39
40
size_t
depth
()
const
;
41
exprt
target_expression
(
size_t
depth
)
const
;
42
exprt
offset_expression
()
const
;
43
bool
is_top_value
()
const
;
44
45
private
:
46
void
construct_stack_to_pointer
(
47
const
exprt
&expr,
48
const
abstract_environmentt
&environment,
49
const
namespacet
&ns);
50
51
void
construct_stack_to_lvalue
(
52
const
exprt
&expr,
53
const
abstract_environmentt
&environment,
54
const
namespacet
&ns);
55
56
void
construct_stack_to_array_index
(
57
const
index_exprt
&expr,
58
const
abstract_environmentt
&environment,
59
const
namespacet
&ns);
60
61
void
add_to_stack
(
62
std::shared_ptr<write_stack_entryt> entry_pointer,
63
const
abstract_environmentt
environment,
64
const
namespacet
&ns);
65
66
enum class
integral_resultt
67
{
68
LHS_INTEGRAL
,
69
RHS_INTEGRAL
,
70
NEITHER_INTEGRAL
71
};
72
73
static
integral_resultt
get_which_side_integral
(
74
const
exprt
&expr,
75
exprt
&out_base_expr,
76
exprt
&out_integral_expr);
77
78
continuation_stack_storet
stack
;
79
bool
top_stack
;
80
};
81
82
#endif
// CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_H
abstract_environmentt
Definition
abstract_environment.h:39
exprt
Base class for all expressions.
Definition
expr.h:57
index_exprt
Array index operator.
Definition
std_expr.h:1421
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
write_stack_entryt
Definition
write_stack_entry.h:21
write_stackt::top_stack
bool top_stack
Definition
write_stack.h:79
write_stackt::construct_stack_to_array_index
void construct_stack_to_array_index(const index_exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
Construct a stack for an array position l-value.
Definition
write_stack.cpp:161
write_stackt::target_expression
exprt target_expression(size_t depth) const
Definition
write_stack.cpp:199
write_stackt::offset_expression
exprt offset_expression() const
Definition
write_stack.cpp:205
write_stackt::integral_resultt
integral_resultt
Definition
write_stack.h:67
write_stackt::integral_resultt::LHS_INTEGRAL
@ LHS_INTEGRAL
Definition
write_stack.h:68
write_stackt::integral_resultt::RHS_INTEGRAL
@ RHS_INTEGRAL
Definition
write_stack.h:69
write_stackt::integral_resultt::NEITHER_INTEGRAL
@ NEITHER_INTEGRAL
Definition
write_stack.h:70
write_stackt::get_which_side_integral
static integral_resultt get_which_side_integral(const exprt &expr, exprt &out_base_expr, exprt &out_integral_expr)
Utility function to find out which side of a binary operation has an integral type,...
Definition
write_stack.cpp:255
write_stackt::construct_stack_to_lvalue
void construct_stack_to_lvalue(const exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
Construct a stack up to a specific l-value (i.e.
Definition
write_stack.cpp:129
write_stackt::write_stackt
write_stackt()
Build a topstack.
Definition
write_stack.cpp:26
write_stackt::is_top_value
bool is_top_value() const
Is the stack representing an unknown value and hence can't be written to or read from.
Definition
write_stack.cpp:225
write_stackt::to_expression
exprt to_expression() const
Convert the stack to an expression that can be used to write to.
Definition
write_stack.cpp:176
write_stackt::construct_stack_to_pointer
void construct_stack_to_pointer(const exprt &expr, const abstract_environmentt &environment, const namespacet &ns)
Add to the stack the elements to get to a pointer.
Definition
write_stack.cpp:60
write_stackt::depth
size_t depth() const
Definition
write_stack.cpp:194
write_stackt::stack
continuation_stack_storet stack
Definition
write_stack.h:78
write_stackt::add_to_stack
void add_to_stack(std::shared_ptr< write_stack_entryt > entry_pointer, const abstract_environmentt environment, const namespacet &ns)
Add an element to the top of the stack.
Definition
write_stack.cpp:235
write_stackt::continuation_stack_storet
std::vector< std::shared_ptr< write_stack_entryt > > continuation_stack_storet
Definition
write_stack.h:29
analyses
variable-sensitivity
write_stack.h
Generated by
1.17.0