![]() |
P4C
The P4 Compiler
|
#include <symbolic_env.h>
Public Member Functions | |
| bool | exists (const IR::StateVariable &var) const |
| Checks whether the given variable exists in the symbolic environment. | |
| const IR::Expression * | get (const IR::StateVariable &var) const |
| const SymbolicMapType & | getInternalMap () const |
| void | set (const IR::StateVariable &var, const IR::Expression *value) |
| const IR::Expression * | subst (const IR::Expression *expr) const |
Static Public Member Functions | |
| static bool | isSymbolicValue (const IR::Node *) |
A symbolic environment maps variables to their symbolic value. A symbolic value is just an expression on the program's initial state.
|
nodiscard |
|
nodiscard |
|
static |
Determines whether the given node represents a symbolic value. Symbolic values may be stored in the symbolic environment.
| void P4Tools::SymbolicEnv::set | ( | const IR::StateVariable & | var, |
| const IR::Expression * | value ) |
Sets the symbolic value of the given state variable to the given value. Constant folding is done on the given value before updating the symbolic state.
| const IR::Expression * P4Tools::SymbolicEnv::subst | ( | const IR::Expression * | expr | ) | const |
Substitutes state variables in @expr for their symbolic value in this environment. Variables that are unbound by this environment are left untouched.
Traverses the IR to perform substitution.