1#ifndef FREE_TENSOR_GEN_PB_EXPR_H
2#define FREE_TENSOR_GEN_PB_EXPR_H
4#include <unordered_map>
5#include <unordered_set>
40 std::unordered_map<Expr, std::string> results_;
41 std::unordered_map<Expr, int>
44 std::unordered_map<Expr, VarMap>
46 Expr parent_ =
nullptr;
47 std::string varSuffix_;
53 : varSuffix_(
varSuffix), noNeedToBeVars_(noNeedToBeVars) {}
55 const std::string &
varSuffix()
const {
return varSuffix_; }
57 std::pair<std::string, VarMap>
gen(
const Expr &op);
70 void visit(
const LT &op)
override;
71 void visit(
const LE &op)
override;
72 void visit(
const GT &op)
override;
73 void visit(
const GE &op)
override;
74 void visit(
const EQ &op)
override;
75 void visit(
const NE &op)
override;
Definition: gen_pb_expr.h:34
const std::string & varSuffix() const
Definition: gen_pb_expr.h:55
void visit(const Var &op) override
Definition: gen_pb_expr.cc:62
ASTHashMap< Expr, std::string > VarMap
Definition: gen_pb_expr.h:37
GenPBExpr(const std::string &varSuffix="", const ASTHashSet< Expr > &noNeedToBeVars={})
Definition: gen_pb_expr.h:51
std::pair< std::string, VarMap > gen(const Expr &op)
Definition: gen_pb_expr.cc:354
void visitExpr(const Expr &op) override
Definition: gen_pb_expr.cc:16
Definition: allocator.h:9
std::unordered_map< K, V, Hasher, HashComparator > ASTHashMap
Definition: hash.h:114
std::unordered_set< K, Hasher, HashComparator > ASTHashSet
Definition: hash.h:117