P4C
The P4 Compiler
Loading...
Searching...
No Matches
symbolic_env.h
1/*
2 * SPDX-FileCopyrightText: 2022 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_
8#define BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_
9
10#include "backends/p4tools/common/lib/model.h"
11#include "ir/ir.h"
12#include "ir/node.h"
13
14namespace P4::P4Tools {
15
19 private:
21
22 public:
23 // Maybe coerce from Model for concrete execution?
24
26 [[nodiscard]] const IR::Expression *get(const IR::StateVariable &var) const;
27
29 [[nodiscard]] bool exists(const IR::StateVariable &var) const;
30
33 void set(const IR::StateVariable &var, const IR::Expression *value);
34
37 const IR::Expression *subst(const IR::Expression *expr) const;
38
40 [[nodiscard]] const SymbolicMapType &getInternalMap() const;
41
44 static bool isSymbolicValue(const IR::Node *);
45};
46
47} // namespace P4::P4Tools
48
49#endif /* BACKENDS_P4TOOLS_COMMON_LIB_SYMBOLIC_ENV_H_ */
Definition node.h:53
Definition symbolic_env.h:18
static bool isSymbolicValue(const IR::Node *)
Definition symbolic_env.cpp:72
const IR::Expression * get(const IR::StateVariable &var) const
Definition symbolic_env.cpp:18
const SymbolicMapType & getInternalMap() const
Definition symbolic_env.cpp:70
const IR::Expression * subst(const IR::Expression *expr) const
Definition symbolic_env.cpp:35
void set(const IR::StateVariable &var, const IR::Expression *value)
Definition symbolic_env.cpp:28
bool exists(const IR::StateVariable &var) const
Checks whether the given variable exists in the symbolic environment.
Definition symbolic_env.cpp:26
Definition common/compiler/compiler_result.cpp:7
P4::flat_map< IR::StateVariable, const IR::Expression * > SymbolicMapType
Symbolic maps map a state variable to a IR::Expression.
Definition backends/p4tools/common/lib/model.h:20