P4C
The P4 Compiler
Loading...
Searching...
No Matches
symbolic_env.h
1#ifndef BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_
2#define BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_
3
4#include "backends/p4tools/common/lib/model.h"
5#include "ir/ir.h"
6#include "ir/node.h"
7
8namespace P4::P4Tools {
9
13 private:
15
16 public:
17 // Maybe coerce from Model for concrete execution?
18
20 [[nodiscard]] const IR::Expression *get(const IR::StateVariable &var) const;
21
23 [[nodiscard]] bool exists(const IR::StateVariable &var) const;
24
27 void set(const IR::StateVariable &var, const IR::Expression *value);
28
31 const IR::Expression *subst(const IR::Expression *expr) const;
32
34 [[nodiscard]] const SymbolicMapType &getInternalMap() const;
35
38 static bool isSymbolicValue(const IR::Node *);
39};
40
41} // namespace P4::P4Tools
42
43#endif /* BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_ */
Definition node.h:95
Definition symbolic_env.h:12
static bool isSymbolicValue(const IR::Node *)
Definition symbolic_env.cpp:68
const IR::Expression * get(const IR::StateVariable &var) const
Definition symbolic_env.cpp:14
const SymbolicMapType & getInternalMap() const
Definition symbolic_env.cpp:66
const IR::Expression * subst(const IR::Expression *expr) const
Definition symbolic_env.cpp:31
void set(const IR::StateVariable &var, const IR::Expression *value)
Definition symbolic_env.cpp:24
bool exists(const IR::StateVariable &var) const
Checks whether the given variable exists in the symbolic environment.
Definition symbolic_env.cpp:22
Definition common/compiler/compiler_result.cpp:3
absl::btree_map< IR::StateVariable, const IR::Expression * > SymbolicMapType
Symbolic maps map a state variable to a IR::Expression.
Definition backends/p4tools/common/lib/model.h:15