ROSE 0.11.145.192
InputVariables.h
1#ifndef ROSE_BinaryAnalysis_Concolic_InputVariables_H
2#define ROSE_BinaryAnalysis_Concolic_InputVariables_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_CONCOLIC_TESTING
5#include <Rose/BinaryAnalysis/Concolic/BasicTypes.h>
6
7#include <Rose/BinaryAnalysis/SymbolicExpression.h>
8#include <Rose/Constants.h>
9
10namespace Rose {
11namespace BinaryAnalysis {
12namespace Concolic {
13
25class InputVariables: public Sawyer::SharedObject {
26public:
28 using Ptr = InputVariablesPtr;
29
30private:
31 using Variables = Sawyer::Container::Map<uint64_t, ExecutionEventPtr>; // map symbolic variable ID to program input
32 Variables variables_;
33 SymbolicExpression::ExprExprHashMap bindings_; // used for substitutions
34
36 // Constructors, etc.
38protected:
39 InputVariables();
40
41public:
43 static Ptr instance();
44
45 ~InputVariables();
46
48 // Properties and queries
50public:
51
56 const SymbolicExpression::ExprExprHashMap& bindings() const;
57
64 ExecutionEventPtr event(const std::string &variableName) const;
65 ExecutionEventPtr event(const SymbolicExpressionPtr &variable) const;
69 // High-level functions.
71
84 void activate(const ExecutionEventPtr&, InputType, size_t idx1 = INVALID_INDEX, size_t idx2 = INVALID_INDEX);
85
95 void deactivate(const ExecutionEventPtr&);
96
102 void playback(const ExecutionEventPtr&);
103
108 void unplayback(const ExecutionEventPtr&);
109
111 void addBindingsToSolver(const SmtSolverPtr&) const;
112
114 void print(std::ostream&, const std::string &prefix = "") const;
115
117 // Mid-level functions
119
129 void define(const ExecutionEventPtr&, InputType, size_t idx1 = INVALID_INDEX, size_t idx2 = INVALID_INDEX);
130
141 void undefine(const ExecutionEventPtr&);
142
149 void bind(const ExecutionEventPtr&);
150
160 void unbind(const ExecutionEventPtr&);
161
163 // Low-level functions.
165
170 void bindVariableValue(const SymbolicExpressionPtr &variable, const SymbolicExpressionPtr &value);
171
176 void unbindVariableValue(const SymbolicExpressionPtr &variable);
177};
178
179} // namespace
180} // namespace
181} // namespace
182
183#endif
184#endif
Container associating values with keys.
Definition Sawyer/Map.h:72
Base class for reference counted objects.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
void print(const GlobalVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple global variables.
The ROSE library.