1#ifndef BACKENDS_P4TOOLS_COMMON_LIB_MODEL_H_
2#define BACKENDS_P4TOOLS_COMMON_LIB_MODEL_H_
7#include "absl/container/btree_map.h"
10#include "ir/visitor.h"
15using SymbolicMapType = absl::btree_map<IR::StateVariable, const IR::Expression *>;
38 const IR::Literal *preorder(IR::StateVariable *var)
override;
39 const IR::Literal *preorder(IR::SymbolicVariable *var)
override;
40 const IR::Literal *preorder(IR::TaintExpression *var)
override;
42 explicit SubstVisitor(
const Model &model,
bool doComplete);
47 using ExpressionMap = std::map<const IR::Expression *, const IR::Literal *>;
63 const IR::Literal *
evaluate(
const IR::Expression *expr,
bool doComplete,
64 ExpressionMap *resolvedExpressions =
nullptr)
const;
68 const IR::StructExpression *evaluateStructExpr(
69 const IR::StructExpression *structExpr,
bool doComplete,
70 ExpressionMap *resolvedExpressions =
nullptr)
const;
74 const IR::BaseListExpression *evaluateListExpr(
75 const IR::BaseListExpression *listExpr,
bool doComplete,
76 ExpressionMap *resolvedExpressions =
nullptr)
const;
81 [[nodiscard]]
const IR::Expression *
get(
const IR::SymbolicVariable *var,
bool checked)
const;
86 void set(
const IR::SymbolicVariable *var,
const IR::Expression *val);
absl::btree_map< const IR::SymbolicVariable *, const IR::Expression *, IR::SymbolicVariableLess > SymbolicMapping
This type maps symbolic variables to their value assigned by the solver.
Definition solver.h:20